Тёмный

Structural Patterns (comparison) - Design Patterns (ep 12) 

Christopher Okhravi
Подписаться 155 тыс.
Просмотров 93 тыс.
50% 1

Video series on Design Patterns for Object Oriented Languages. This time we compare a few structural patterns.
💙 BUY MY BOOK:
leanpub.com/the-object-orient...
CORRECTION: At 2:10 I draw a has-a arrow from the concrete decorators to the abstract decorator. This is a mistake. The arrow should be drawn from the abstract decorator to the component. Otherwise the pattern doesn't work. Sorry about that, and thanks Naman Saxena for pointing it out! Later in the video I put letters in the boxes. Expressed in letters the arrow should go from D to C. Mea culpa.
More specifically:
Adapter Pattern
vs
Proxy Pattern
vs
Facade Pattern
vs
Decorator Pattern
vs
Bridge Pattern
...and then we throw in Strategy Pattern in the end :)
► The playlist
• Design Patterns in Obj...
► Head First: Design Patterns
geni.us/nlbA6
► Design Patterns: Elements of Reusable Object-Oriented Software
geni.us/PsXmo
💪 Patreon Community
/ christopherokhravi
📚 Products I Recommend
geni.us/71ZXF

Опубликовано:

 

23 сен 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 162   
@chrisjust7445
@chrisjust7445 6 лет назад
Seeing all 6 of those UML diagrams on one board is a great way to see just how different or similar the various patterns are.
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
I'm glad you think so :) That's sort of what I was thinking myself :) Thanks for watching!
@Artem992
@Artem992 6 лет назад
Here's a silly story I've made up to memorize and fit it all together 😁 On Fridays one guy likes to finish the day with a shot of plain rum, actually he used to distill it on his own, but that was too complicated process so he started buying bottles in a local shop, which is a great FACADE that removes all the complexity and pain of production process away from him. Couple months later he decides that plain rum is good but maybe it might taste better when DECORATED with lemon and other ingredients. But damn he's too lazy so he heads to a local bar. Apparently, that bar is a limited club, so in order to get in, he gotta know a friend who's already a club member (PROXY) who could tell the security he's cool enough to get in. The security guy is angry and just mumbles something, but our man happened to recognise some phrases in Spanish so he ADAPTED to the situation and replied in that language. That made the security guy smile so he happily allows this gringo to enter! Finally our man reaches out to the bartender who is standing behind the counter, which in fact resembles a BRIDGE between all of the party people and the bottles of various spirits on the shelves. And they all SHOUT OUT to Chris and wish him luck with his book :)
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
Hahahha dude this is tooo good :) :) :)
@betterculture
@betterculture 6 лет назад
This "story" should be pinned and referenced in Christopher's book. It happened really you know! :D
@ishwarkhandelwal75
@ishwarkhandelwal75 5 лет назад
Too good a example Dude :)
@michor10
@michor10 5 лет назад
It really amazes me how much of these discussed patterns really are things that we use often without even noticing. That being said, it is really important to sometimes sit down and define what they really mean and what they are applied for (or when they make the most sense). Great video as always, Christopher!
@TheJustinmulli
@TheJustinmulli 2 года назад
I can confirm that the bridge pattern is a natural conclusion, because I did it in my app the other week without knowing it's a pattern, and then watched your bridge pattern video the other day which pleasantly surprised me, since it means my design makes sense. In fact, it was even more or less the same example you used with different media types being used for the same UI components/widgets.
@r1konTheAutomator
@r1konTheAutomator 4 месяца назад
I gotta say...there are maybe 3 people who teach coding that I get a whole lot from. Jeffrey Way, Caleb Portzio, Luke Downing, and now you. You're a very good teacher my man
@liangzeng5778
@liangzeng5778 5 лет назад
The decorator pattern UML has a small problem. The D has C instead of CD has D.
@PoulJulle-wb9iu
@PoulJulle-wb9iu 4 года назад
why are u watching lol
@HIOLLJ
@HIOLLJ 4 года назад
Yes, spotted the same.
@Adam-uu8dc
@Adam-uu8dc 3 года назад
I was just about to write this lol.
@feepin2058
@feepin2058 3 года назад
qFDGEOFGJerljgopergerjgoernglerjogrg - Yes.
@averyiker9137
@averyiker9137 3 года назад
Pro trick: you can watch series on Flixzone. Been using it for watching all kinds of movies recently.
@wilwazka2957
@wilwazka2957 2 года назад
This is a remarkable effort to help anyone getting the concepts right away with such simplicity and ease. Thanks!
@suvaaich9354
@suvaaich9354 5 лет назад
One of the best video comparing Structural Patterns on youtube today - Thanks mate.
@safvanp567
@safvanp567 7 месяцев назад
00:03 Comparison of structural patterns: bridge, adapter, decorator, proxy, and facade 02:02 Structural patterns like decorator and facade provide ways to simplify complex interactions. 06:15 Proxy pattern is used to control access to a real subject 08:19 Bridge pattern involves an abstraction and an implementer with multiple concrete implementations 12:21 The adapter pattern converts the interface of a class into another interface that the client expects. 14:32 Facade simplifies a complex subsystem, while Adapter adapts from one interface to another. 18:23 The proxy pattern provides a surrogate or a placeholder for another object to control access to it. 20:18 Proxy pattern is used to control access to a single thing, while decorator pattern is used to solve the problem of class explosion and treat different combinations of classes as a special case. 23:36 Structural patterns like Decorator and Proxy solve different problems. 25:23 The bridge pattern decouples an abstraction from its implementation. 29:10 Strategy pattern is about dependency injection 31:00 Bridge pattern is a flexible way of coupling classes using interfaces. 34:20 Facade pattern simplifies complex subsystems by providing a simpler interface. 35:50 The video discusses the importance of books in learning and working with object-oriented programming.
@richardnipples7574
@richardnipples7574 6 лет назад
I enjoy your teaching style; It'd be great if you could expand on these patterns by showing us some use cases in which these patterns can be applied. Again, these series are great.
@Diego-db4uw
@Diego-db4uw 6 лет назад
With this comparison, I realized that the abstract decorator is a proxy for the concrete component. Super series! Thanks. Waiting for the next one.
@mazhar5721
@mazhar5721 3 года назад
Videos like this are really helpful because they also help to do a quick revision of previous concepts.
@boblim623
@boblim623 4 месяца назад
decorator: add function, multi-function, so that there will not be a lot of classes proxy: assess control bridge: two hierarchy, injection B into A
@andryushkax2116
@andryushkax2116 3 года назад
wow -- this video is just great, especially sort of seeing the bridge pattern as a more general form as strategy pattern
@safvanp567
@safvanp567 7 месяцев назад
Christopher, your teaching style is exceptional, and I truly appreciate the clarity and depth you bring to these complex concepts. Thank you so much for sharing your knowledge in such an engaging manner. The idea of you writing a book is incredibly exciting! It's definitely going to be an amazing contribution to the field. Looking forward to delving even deeper into these fascinating topics through your upcoming book.
@konzinovmaverick4539
@konzinovmaverick4539 6 лет назад
It's always a pleasure to see youtube notifications saying you have posted new episode. This last one deals well with understanding differences with structural pattern. And as someone has already mentioned you should write a book about this subject. Thanks to your good sense of explanation it will surely be a success. +1
@LeandroTabaj
@LeandroTabaj 2 года назад
Super interesting video for me. I think it's the first time I actually understand many of these patterns. Thank you!
@seanbuckmaster
@seanbuckmaster Год назад
Binge watching the series... this was a very needed comparison between things that seemed related but nebulous before this instruction. Thanks for the lesson.
@seiyonpala5962
@seiyonpala5962 4 года назад
excellent teaching......!! i'm still in shock how easily u covered all the points of them
@obi-center
@obi-center 5 лет назад
Wow! You are my favourite teacher, bro :) Now I am ready to finish my project. Thank you!
@hassangholipoor2569
@hassangholipoor2569 Год назад
I don't know how to say that But I Just want to appreciate you for making this playlist, Its awesome
@sarenodev
@sarenodev 3 года назад
This comparison video is very helpful to identify and choose the most suitable pattern for a specific problem.
@leomeror
@leomeror 3 года назад
32:00 "Programming is discovered rather than invented", I really like that and helps a lot with understanding where these design patterns stem from. :)
@ilovepickles7427
@ilovepickles7427 5 лет назад
Wow. You are a phenomenal teacher. Amazing! Thank you.
@sagarsati310
@sagarsati310 3 года назад
I got a habit of saying 'SUPER' before everything. You are super talented. Thanks for this series :)
@nijuyonkadesu
@nijuyonkadesu 3 месяца назад
wuahhhh, this is what it feels like to be taught by the best professor ~
@LavGupta08
@LavGupta08 6 лет назад
Hey Chris, Thank you so much for this helpful and great series. Waiting eagerly for the next video.
@mildlyinteresting1000
@mildlyinteresting1000 4 года назад
Q: Dumb Questions Is it possible to create your own Design Patterns? Or is that something you have to be a “patterns guru” to do? A: First, remember that patterns are discovered, not created. So, anyone can discover a Design Pattern and then author its description; however, it’s not easy and doesn’t happen quickly, nor often. Being a “patterns writer” takes commitment. You should first think about why you’d want to - the majority of people don’t author patterns; they just use them. However, you might work in a specialized domain for which you think new patterns would be helpful, or you might have come across a solution to what you think is a recurring problem, or you may just want to get involved in the patterns community and contribute to the growing body of work. (c) Head First
@misterkoko-code5140
@misterkoko-code5140 6 лет назад
Super awesome! I have been waiting for this episode.
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
Glad to hear. Thanks for sticking around :)
@EuanFR
@EuanFR 6 лет назад
I am pleased to hear that strategy pattern looks like half the bridge.. because it also is the conclusion that I came to. bridge is to my mind, a more generalized strategy pattern (as I commented in the bridge pattern video).
@vrhfvrhf
@vrhfvrhf 2 года назад
Thank you very much Christopher, this serie helped me very much in my career
@Mr47even
@Mr47even 5 лет назад
Happy new year Chris . Thank you for all the efforts . Keep going bro , say my hi to your cat 😉
@crankitsourav8686
@crankitsourav8686 4 года назад
The way this guy trying to speak the unspeakable(i.e. underlying essence that only be get through experience) is mindblowing. only I watch what he want to covey.
@lohitagarwalla4586
@lohitagarwalla4586 Год назад
Love from India. Great explanation. Thank you
@RalphTiama
@RalphTiama 3 года назад
I hope you are one of my teacher in programming, your awesome🔥
@francomendiola8459
@francomendiola8459 6 лет назад
Excelente video, gracias por la explicacion.
@MultiverseDigital
@MultiverseDigital 4 года назад
thanks Man your tutorial are very helpful . i statrd to read GOF befor this tutoral and i kind of got lost . after watched your vedios things start to make sence .. Thanks Bro !!
@Sky4CE
@Sky4CE 6 лет назад
Amazing explanation of bridge pattern, just awesome! thanks)
@renarsdilevka6573
@renarsdilevka6573 4 года назад
Just brilliant, as always, natural mentor and teacher :)
@JavierGardella
@JavierGardella 6 лет назад
Excellent explained! Thank you so much!!!
@arthuran4361
@arthuran4361 4 года назад
Very Good comparing between the strategy pattern and bridge pattern.
@CuriousCyclist
@CuriousCyclist 6 лет назад
Boy, that was good! Thanks Chris!
@leonidpiliptsevich5329
@leonidpiliptsevich5329 3 года назад
awesome comparison!
@vevinm5268
@vevinm5268 6 лет назад
Really awesome videos!, Waiting for rest of the design pattern videos..hope you will cover those soon
@c4stus
@c4stus 6 лет назад
Great As always, thank you Chris
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
+Krzysztof Romanowski Thanks :)
@murguletdiana4662
@murguletdiana4662 5 лет назад
Awesome job! Thank you
@georgemilev9986
@georgemilev9986 5 лет назад
Absolutely great video! Definitely would like to get your book.
@juriddu
@juriddu 2 года назад
Thanks, you make me a better developer.
@alexjin5232
@alexjin5232 6 лет назад
Great stuff! I would for sure buy your book linking the concepts together.
@marceloleoncaceres6826
@marceloleoncaceres6826 9 месяцев назад
Another Great video, Thanks for sharing, I really appreciate your job
@Bisadi
@Bisadi 3 года назад
Thanks for all videos. Here comparison of strategy and bridge was very interesting to me.
@senthilrajanr1
@senthilrajanr1 3 года назад
A big thank you
@VisualBRON
@VisualBRON 6 лет назад
As accessible as ever ... thanks!
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
Glad to hear! Remember to let me know if I start to get lazy :) Thanks for watching :)
@asashrafali
@asashrafali 2 года назад
Thanks, This is Amazing!
@rajulyricwritter703
@rajulyricwritter703 6 лет назад
Excellently explained....
@MrSalireza
@MrSalireza 4 года назад
You did a great job Ostad, keep it up ;)
@MrWandalen
@MrWandalen 2 года назад
That's cool. Thanks!
@nemanjastankovic941
@nemanjastankovic941 3 года назад
These videos are so adictive 😁😁. Thanks for your effort 🤓
@bsuperbrain
@bsuperbrain 6 лет назад
Supernice! Waiting for the others. And for a comparison of the factory and the builder.
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
Thanks for plus 1:ing more comparison videos. I'm glad the format was useful :)
@chuanyangwei7130
@chuanyangwei7130 3 года назад
good comparison between bridge and decorator!!!
@denisbielishev
@denisbielishev 2 года назад
I really appreciate your efforts. Thanks a lot. You mentioned composition when we inject something into a class. But I think it's aggregation, not composition. Because composition is when we create an instance in a class and cannot separate it.
@habibgamal3696
@habibgamal3696 11 месяцев назад
how are you ammmmazing like this ,thank you very very very much for this series , it is realy so cool😍😍😍😍
@user-xw1xz8il1t
@user-xw1xz8il1t 7 месяцев назад
Thank you! :)
@rsdntevl
@rsdntevl 5 лет назад
Comparison videos are always welcomed
@jaydevparmar9876
@jaydevparmar9876 6 лет назад
very helpful, thanks
@Ritesh91188
@Ritesh91188 6 лет назад
great one!!!!!!!! keep it up!!!!!!
@ankitjhunjhunwala9895
@ankitjhunjhunwala9895 5 лет назад
Great videos, thanks it's of great help :)
@kamleshgangaramani9445
@kamleshgangaramani9445 5 лет назад
superb, you are champion.
@sebastianidzkowski6810
@sebastianidzkowski6810 5 лет назад
great video!
@kalhariliyanagama
@kalhariliyanagama 3 года назад
Chris you can compare decorator and builder as well. for example in your decorator video the example coffee with condiments can be solved with a builder and I feel is more suited to be solved as a builder since it's more like a creational problem
@johngarzone6092
@johngarzone6092 4 года назад
Me: Where will our study of design patterns lead us? Christopher: Dependency injection into madness!!!! 33:00
@abdelaziz2788
@abdelaziz2788 3 года назад
Awesome.
@jayantdarade
@jayantdarade Год назад
Wonderful
@ganeshkumbhar7774
@ganeshkumbhar7774 6 лет назад
excellent strategy to explain....
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
Thanks. I’m glad to hear :) Thanks for watching :)
@sipanarevshatyan6354
@sipanarevshatyan6354 6 лет назад
32:00 you probably mean Design Patterns are discovered rather than invented (not programming). Very good news to write a book about Design Patterns. I will be waiting for that book, you have a very special style of explaining the essence of Design Patterns.
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
I actually did mean "programming was discovered not invented". But then I was trying to say that perhaps the same goes for design patterns. Like if math was discovered, then anything we inductively prove using the axioms ought be considered discovered rather than invented. Similarly, if the axioms of programming was discovered, then anything we build using programming too ought to be discovered rather than invented. Sorry for not being clear. Sometimes even my thinking is sloppy :D Thanks for picking up the quote. It's a super interesting quote :)
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
Also, thanks for pushing for the book. I'm glad to hear that it would be interesting :)
@monzermasri4490
@monzermasri4490 5 лет назад
great job
@andriikukuruza6844
@andriikukuruza6844 3 года назад
thanks!
@MohammedAbdulKhaliq
@MohammedAbdulKhaliq 6 лет назад
Fine tuning your moustache , hahaha!! :) Please please please cover the other patterns or atleast create a short video for each one having the basic explanation and an example. Thank you.
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
:) :) :) :) Thank you very much for your encouragement :)
@barakros
@barakros 3 года назад
the empty sub set can be implemented as null object pattern🤓 great videos!
@piotrjaga6929
@piotrjaga6929 Год назад
thanks
@sanketbaldia6855
@sanketbaldia6855 6 лет назад
Waiting for more videos on design patterns.
@bbabak2
@bbabak2 3 года назад
Hi Chris, I found your channel a few days ago. On the GoF patterns, I should say the content is really good. Specially this video that compares all constructional patterns. It would be great if you do the same for creational and behavioral patterns as well. Thanks a lot. Babak
@dreameryet
@dreameryet 2 года назад
Hi Chris. Let me start by saying - great job!!! There's a small mistake in the UML of the decorator. A Decorator has a Component, and not as drawn in this video, i.e. a concrete decorator has a decorator, which simply misses the point of being able to decorate the core component.
@nitendratiwari3709
@nitendratiwari3709 3 года назад
Hi Crish, really appreciate your efforts for all design patterns, in this comparison you didn't include Composite design pattern. It will be good to see all structural design patterns together.
@nixlq
@nixlq 4 года назад
In decorator pattern, it is also important the order of the decorators, not just which
@kunliu8961
@kunliu8961 5 лет назад
Thanks a lot for this video. Just one question for the Decorator UML. I think is the Decorator has-a Component. But in this video, you draw the ConcreteDecorator has-a Decorator?
@iristich
@iristich 5 лет назад
@ Christopher thanks again for your magic, any news about your book?
@Den-Geist-Befreien
@Den-Geist-Befreien 6 лет назад
Like the videos! If you could, maybe some code examples from the java core libraries that implement these patterns would be cool! For Example: Take Reader object from Files.IO package which can be decorated with a FileReader which can be decorated a BufferedReader; then explain the inner workings of the pattern! That would be cool!
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
Good point! Actually, exactly this example is the Head First book :) :) :) But about real world examples. I’ll try to make them an important part of the ebook :) A few others have requested more real examples as well. Thank you for your encouragement and feedback! :)
@Den-Geist-Befreien
@Den-Geist-Befreien 6 лет назад
Thank you for your reply! My apologizes... my own mistake on the Reader Class; should be File Class decorated by FileReader... and so forth. All from the java.io package ;P duh
@sovan107
@sovan107 6 лет назад
Great news about your upcoming book on design patterns. Nice comparison between the all the structural patterns. And I was just thinking about the relation between Bridge and Strategy pattern when you introduced the UML diagrams of both to show the difference. You do read minds :P . Thank you!
@ChristopherOkhravi
@ChristopherOkhravi 6 лет назад
Awesome. I'm happy to accommodate :) Thank you for watching and for the very kind comment :)
@christiangabrielchamula768
@christiangabrielchamula768 2 года назад
Hi Chris, awesome class please explain Compisite Pattern thanks
@Nurilka
@Nurilka 6 лет назад
Hi! Thanks for the great explanation as always :) I already ordered a copy of Head First book via your link, but if you do write a book in the end, I'll probably buy yours as well. Question: Would you be covering State Design Pattern any time soon? The info I find on the Internet or here on RU-vid is very confusing, and your explanation usually works wonders for me. Thanks again. Nurit.
@felipewatanabe7128
@felipewatanabe7128 5 лет назад
I think Facade is very useful for libraries that are complex bcs it has more solutions than you actually need.
@TedFanat
@TedFanat 4 года назад
Tried to use it for my micro-libraries even before i hear about GoF Patterns, so yeah)
@kennethcarvalho3684
@kennethcarvalho3684 11 месяцев назад
Comparing similarities would be nice too
@binhphunghoa6860
@binhphunghoa6860 4 года назад
Thank you for your explanation in the video. very easy to understand and comprehensive. I have 1 question about the Bridge design pattern. According to the UML there are 2 independent hierarchy in which let say Interface A has Interface B but indeed there are not any guarantees that A must have B inside (at least we have to ensure ourselves ), because A is an interface so we have not any mechanisms to do so ( please correct me if i am wrong). I am wondering what if i define Interface A and it has Not only B interface but also C,D,E,F .... and when i implement A , the implementation may have either B or C ,D or even 3 of them. so is it stil Bridge Pattern. how if A implementation does not have any B , C , D...
@Mr47even
@Mr47even 6 лет назад
Hi , thx for really helpful videos . Does repository pattern exist in your todos ? :)
@nvthn96
@nvthn96 6 лет назад
Nice
@bhavnaravish2286
@bhavnaravish2286 5 лет назад
Can you share the same comparisons video for behavioral and Creational Design patterns.
@venkataraojunju8495
@venkataraojunju8495 5 лет назад
I want the topic about how dp solves design patterns
@dominikkisiaa3305
@dominikkisiaa3305 4 года назад
I'm not sure, but shouldn't be there dashed lines, when implementing an Interface? Like in the Proxy-Pattern? The two implementing classes R and P should have a dashed connection to S because of the dependency and not inheritance, shouldn't they? Nevertheless thanks for the comparison! Helped me a lot!
Далее
Template Method Pattern - Design Patterns (ep 13)
50:42
Bridge Pattern - Design Patterns (ep 11)
52:04
Просмотров 144 тыс.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Let's Take The Bridge Pattern To The Next Level
17:13
The Only Time You Should Use Polymorphism
13:55
Просмотров 88 тыс.
Proxy Pattern - Design Patterns (ep 10)
37:35
Просмотров 161 тыс.
Facade Pattern - Design Patterns (ep 9)
16:19
Просмотров 178 тыс.