Adapter Pattern – Design Patterns (ep 8)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
alright, what we're going to talk about today is.. these things ... adapters but within the content of software development, this of course means the adapter design pattern. The thing is there is 4 patterns that are very much a like, so it's difficult to tell which one is which and it's kind of difficult to sort of... figure out the new answers. I'm the first one to agree that I have to consistently look them up to sort of keep them apart the four patterns can be easily confused are ... adapter pattern facade pattern proxy pattern and declarator pattern now, such a poor pen, let me fill this in in a previous video we already talked about the declarator pattern if you haven't check that out already, be sure to check it out it is not at all mandatory to watch this video, but it might help we haven't however talked about adapter facade and proxy so what we're going to do is that we're going to talk in this video about adapter pattern only in the next video we'll talk about facade only and in the next video, we'll talk about proxy pattern only and declarators, we don't need to talk about again because we already talked about it but then I'll stick in an extra video where we actually talk about the difference between these 3 without going into too much detail. Let me just go over a quick hint on the difference are Adapter pattern is about making 2 interfaces that aren't compatible compatible Facade pattern is about taking a bunch of complex interactions and creating a facade that you can use instead of dealing with complex objects and complex interactions proxy is a way of placing a proxy between something you want to call so you want to call a particular thing, but instead of calling that thing, you call the proxy who calls that thing. The reasons could be for examples: security, caching or stuff like that and finally declarator. We know from before is a way of adding behaviour to some particular object without actually opening that up and changing that object. Adapter makes interfaces compatible facade hides some complex logic proxy intercepts a call and thus controls access to the underlying object. And declarator adds behaviour to some particular object i.e. the object that it's declarating now less forget about this stuff and let's only talk about adapter pattern, and now we're only talking adapter pattern by the way the adapter pattern is also known as a wrapper a simple wrapper and this will make a lot of sense because the adapter, what is does, is it wraps something so you can adapt to a specific interface, but now we're getting ahead of ourself but now let's get into it so, if you're new playlist or channel, what we are doing is we are walking through all of the patterns in this book head first design patterns. one by one by one by one which is why we are at the adapter pattern and obviously, as you can see of what we've talked about before, we will now diverge slightly from the order of the book in order to be able to do that whole thing where we talk about the differences between these patterns so we put proxy pattern in a place earlier than in this book but whatever. If you're new to design pattern, I would highly recommend that you get this book, it's super pedagogical. It seems super long but the reason it's super long but the reason it's super long because it has all these images and silly examples and fire side chat between different patterns
Info
Channel: Christopher Okhravi
Views: 145,105
Rating: 4.9630799 out of 5
Keywords: adapter pattern, adapter design pattern, adaptor pattern, head first: design patterns, head first, design patterns, head first design patterns, design pattern, chrokh
Id: 2PKQtcJjYvc
Channel Id: undefined
Length: 26min 35sec (1595 seconds)
Published: Sun Aug 06 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.