Symfony Live London 2013

La mentira de la interfaz HttpKernelInterface

Igor Wiedler  · 

Presentación

Vídeo

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

so interface what is that what is that really and when you usually when you hear that word probably the first thing that you think about is this language construct in PHP well you're right interface and then the name of the interface and the curly braces

but that's really not what it's about at all it's not a vowel language constructs I think that's kind of a general thing with OOP object-oriented programming where we focus too much on the language constructs as opposed to the real concepts

behind them so when you're learning iop what's the first things you learn about where you have a class and then you have an object and an object is an instance of a class and then it is inheritance and visibility and all that crap that really doesn't

matter because fundamentally what it's really about is message passing it's about objects that are like cells in an organism and they're exchanging messages they're sending messages to each other so that's really what an interface is all

about it's you a different term for it would be protocol and I kind of like this term because we also use it for network protocols which puts more emphasis on the actual communication it's not invoking a procedure it's sending a message and that's

kind of a different way of looking at things so I think fundamentally it's all about communication so take Bob for example this is Bob and Bob's really happy he's walking down the street runs into this really cute girl called Alice so he says hi

and then I was response but he doesn't really understand because she's speaking in a different language and you can also think of an interface as a language so they're speaking different languages they can't really communicate so how do we

solve this problem how can we make both Bob and Alice really happy well one solution to this will be to use a translator so this guy knows both of the languages and whenever they want to communicate they just send a message to the translator to translate it

and passes it on so translate to translate it and tells Bob Aloha i'm bob is happy yay as toe he sends the message back and a different way that you could think about this is that these are objects and they have different interfaces and this translator

is essentially just an adapter so let's take a look at history I really like this quote if you watch the software industry backwards it starts with kids flailing ends with all guys solving impossible problems by thinking hard and it's kind of exaggerating

of course but I think there is some truth to it that we don't really know what we're doing and I'm not saying that all of the old guys knew what they were doing back in the day but if we do look at history I think there's a lot we can gain

from that so you might recognize these two fine gentlemen who recognizes love anyone a few too so the guy in the red shirt is mr. dennis ritchie inventor of the C programming language and he was working at bell labs in the 1970s so what I want to do now is

just go back to nineteen seventy and see what they were doing and the other guy the guy in the white shirt and the strange glasses that's Ken Thompson creator of the be programming language and basically the father of UNIX so these guys were Bell Labs

creating UNIX and all of the tools around it so here's another picture again dennis ritchie this time a bit older longer beard and the other guy next to him is a man called Doug McElroy so this was the tech lead back at Bell Labs and he was more or less

in charge of the entire units operation if you will so what this guy did well for one he had a really big nose so that's one of the things he's known for but what he did was put the pipe into unix he's the inventor of the unix pipe and he mandated

that the unix pipe be put into unix so now we have pipes yay and there's this famous quote by him where he describes this unix pipe as a universal interface because what it really is is just a stream of texts between two endpoints and it just flows in

one direction so this is this is a unix pipe you have two processes and be completely isolated each process is just running doing its own thing and they're not in any way connected apart from the unix pipe and the only thing that you can do is send a message

from the sending end into the receiving so it's a unidirectional way of sending messages and so we have all these different unix utilities and you can really nicely just tack them together to build workflows of data transformations so here's just a

[ ... ]

Nota: se han omitido las otras 2.262 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.