Abstract Factory Pattern - Design Patterns (ep 5)

Поделиться
HTML-код
  • Опубликовано: 5 янв 2025

Комментарии • 518

  • @fischerwells8853
    @fischerwells8853 2 месяца назад +7

    7 years later, this series is still the best for learning design patterns.

  • @worldown
    @worldown 7 лет назад +426

    I study and improve not only patterns but also English. Thank you for clearful and not boring lessons =)

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 лет назад +19

      Thank you for the kind words and for watching :)

    • @joselosddrd
      @joselosddrd 7 лет назад +3

      I also improve patterns and English... you said why.. Well because We're learning English -__- xD

    • @mickaj
      @mickaj 7 лет назад +66

      this is no joke, this guy articulates words with speed of a Gatling gun and yet he's perfectly understandable. not even a single word gets ambiguous or hard to catch!

    • @akashchourasiya72
      @akashchourasiya72 3 года назад +1

      LOL😂

    • @РовшенБердимырадов
      @РовшенБердимырадов 2 года назад

      Хорош

  • @mesesamboby
    @mesesamboby Год назад +13

    It's 2023 and I am watching the series (of course with pen and notebook ready). Thank you very much Chris! The value you add is huge.

  • @ayushdayani7157
    @ayushdayani7157 6 месяцев назад +2

    The example of Dark and Light mode was beautiful. It gave the most clarity about the use case of abstract factory. Kudos!

  • @neonskyscape
    @neonskyscape 4 года назад +21

    I have to admit (yeah I watch it now in 2020) that I really haven't seen any tutorial videos on YT that are as immersive and fun to watch as this one. I am a computer science student that likes to explore CS-related content and I accidentally stumbled upon your channel. I may say that these 25+ min videos are better structured than all the lectures I have attended at my University. Well done!
    I am a subscriber now! Thanks for creating and sharing this interesting content!

  • @nametakenfan
    @nametakenfan Год назад +5

    Freaking HERO - I have been banging my head against the wall for about 2 hours trying to understand Abstract Factory Patterns and you managed to clarify everything in about 25 min. The recap of the definition at the end really brought everything together. Thanks for helping me not fail my CS course

  • @Alarith1988
    @Alarith1988 7 лет назад +94

    Finally understood the difference between Factory Method Pattern and Abstract Factory Pattern.
    Thank you very much. Great series!

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 лет назад +8

      I'm glad to hear. Thanks for sharing :) and thanks for watching :)

    • @MrAceman82
      @MrAceman82 3 года назад

      It helped me also :)

  • @vicinityconcepts1165
    @vicinityconcepts1165 5 лет назад +15

    This is a great video, you covered the pattern very well. I wanted to add one additional point which you will see in many implementations of this pattern: When you have multiple concrete implementations of a factory, you have the same problem you had when faced with multiple concrete implementations of a product. You want to get the type of product you need, but don't want to get your hands dirty with the business logic involved in creating it. With multiple concrete factories, how can you apply a polymorphic solution for creating the correct type of factory? The answer is a factory of factories. The same way we abstractify the logic for creating products, we can abstractify the logic for creating factories that produce families of products.
    Let's use your operating system example: You want platform-specific UI's, and have created UI factories for Mac OS, Linux, and Windows. Maybe you also have subclasses of those factories for things like light mode, dark mode, accessibility mode, etc. When the program begins, you detect the operating system and graphical settings, and send those details to your factory of UI factories. You are given back the correct concrete UI factory implementation specific to your needs, and can start producing UI elements. Without this extra polymorphic layer, you may be faced with the same problem that the factory pattern was devised to solve.

    • @AbdAllahBoda
      @AbdAllahBoda 4 года назад

      I love it when people write down what I'm saying in my head, makes me feel connected to the world somehow. :)
      Thanks for sharing your knowledge. :)

  • @briannkurunungi2837
    @briannkurunungi2837 2 года назад +1

    Men, Chris, your energy is infectious, lots of love. Thanks a bunch

  • @faridiflex
    @faridiflex 7 лет назад +2

    The best video that explains Abstract Factory pattern.
    Very well edited to keep the pace of video fast enough.

  • @AfriandiHaryanto
    @AfriandiHaryanto 4 года назад +6

    Posted years ago, yet this one still the best explanation I found so far..
    Thanks (a lot) Chris..!!

  • @Jacob-bz5hn
    @Jacob-bz5hn 2 года назад +1

    Literally been trying to wrap my head around the abstract factory pattern for the longest time and your video finally helped me understand what it is and why is is useful!!!!!💯I love your teaching style!!!!! Thank you so much!

  • @shubhambhardwaj8990
    @shubhambhardwaj8990 6 лет назад +3

    The explanation that why we go from factory method to abstract factory is what really helped wrap my head around the concept, Thanks a ton!! :)

  • @mylaidbacklife
    @mylaidbacklife 3 года назад

    I'm in 5 mins and I think I found the right channel for concepts! Because supposedly anyone can code these days!

  • @dmytrouchkin1415
    @dmytrouchkin1415 6 лет назад +32

    You got a talent to explaining difficult abstractions.
    Keep it up, man - result is incredible.

  • @chaitanyakabra7049
    @chaitanyakabra7049 Месяц назад

    i can't believe this playlist was release 7 years ago , it still is so relevant in 2024.

  • @slipperydippery
    @slipperydippery 4 года назад +15

    The UI example was so much clearer than the Head First pizza examples! This makes sense in a way that I can use it for my own projects, thanks!

  • @vislobokovaleksander
    @vislobokovaleksander 4 года назад +3

    I tried to understand this via wikipedia's diagrams and descriptions, but it was too overwhelming for me couple of weeks ago. And now they are REALLY simple. Great thanks to you, man. You are really sticking to KISS principle :)). thank you again

  • @tivmego
    @tivmego 7 лет назад +51

    Man, this video series might be ever green when you are done with it! youtube has connected us in an observer pattern in that since I subscribed, I get updates on your current videos :D

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 лет назад +6

      +tivmego haha thanks! Makes me glad to hear :) Thanks for watching :)

    • @espritgaronne9975
      @espritgaronne9975 6 лет назад

      lol

    • @xavmanisdabestest
      @xavmanisdabestest 4 года назад +4

      I need to subscribe too! I was constantly polling his channel for new videos like a scrub

  • @rein29233
    @rein29233 11 месяцев назад

    Finally in forver i understood this concept. You are the only i have seen provide a really easy example that is applicable in real life.

  • @mayankkukadia
    @mayankkukadia 7 лет назад

    Thanks a lot Christopher for the perfect explanation on Abstract Factory and Factory Method pattern.
    I have seen dozen of tutorials on Abstract Factory pattern but most of them are confusing or miss leading.
    After watching this video, now I perfectly understood Abstract Factory pattern.
    Thank You again.

  • @mantur8207
    @mantur8207 7 лет назад

    Christopher your last example in the video on Mobile App theme is EXCELLENT. It clarifies the real time use of abstract factory pattern and also why we can not use factory method pattern in this example.

  • @ryanconnollyatwork1356
    @ryanconnollyatwork1356 7 лет назад +3

    You have such a great way to teach and keep the user engaged. With the ever important point of the "Why" not just the "How", this video is one of the best in this subject IMO. Thank you very much for sharing!

  • @cdarius0
    @cdarius0 6 лет назад +2

    25:00 really hits the nail on it's head. Thank you for the nice work!

  • @youcefsb4708
    @youcefsb4708 4 года назад

    It must be a hell of a feeling to read all these comments and see how helpful you are to others, keep it up please, you are good at this, thank you!

  • @OutsidePawn
    @OutsidePawn 2 года назад

    I think the concept of Factories finally makes sense to me now. I can see how the process of creation of an object has been abstracted away. However, contrary to what I've read somewhere that it is meant to avoid the 'new' keyword, your explanation makes much more sense. I can see now how one might want to avoid 'new' keyword unnecessarily in order to have dynamic object creation code. Still, it is necessary to understand that you cannot completely avoid the 'new' keyword as the concrete factories themselves must be created at some point in the code. I think the key power of factories is their ability to provide a means of creating and using 'wishful' objects of classes that don't even yet exist in the code. Thanks a lot man.

  • @gh8326
    @gh8326 4 года назад

    Estaba viendo videos de este patrón, vi tu video y dije: pues veamos si logro entender después de varios videos y solo te puedo decir que eres un genio explicando. Te estoy enormemente agradecido...

  • @whatshappening5712
    @whatshappening5712 4 года назад

    You deserve all 3 buttons from RUclips

  • @rafatrench
    @rafatrench 7 лет назад

    The method you use for teaching is very dynamic, but at the same time through, thanks to that I was easily able to understand the whole concept. Keep it up!

  • @rajeev7842
    @rajeev7842 3 года назад +1

    This is some premium explanation making complex topics simple to understand, and I love the way you repeat things so that the idea gets cemented into our head, hats off to you sir, great explanation I hope you never stop doing these, We novice developers need people like you.. :)

  • @sadradorostkar3797
    @sadradorostkar3797 4 года назад

    Your teaching is better than all the teachers that i saw in 12 years of studying at Iran awful schools :) love you bro....

  • @idanlazimi
    @idanlazimi 7 лет назад

    By far the one of the best teachers on RUclips. Thanks

  • @solkara
    @solkara 7 лет назад +238

    Please include code examples as they really help cement the idea, like you did in decorator pattern.

    • @koruspring1519
      @koruspring1519 6 лет назад +15

      Second this. I know this is about abstraction but man.. the example is too 'abstract'.

    • @kapilpadaliya2387
      @kapilpadaliya2387 5 лет назад +15

      Watch Derek Banas Vidoes on Design pattern after every explaination.

    • @saganawski
      @saganawski 5 лет назад +5

      @@kapilpadaliya2387 thanks. Derek's demonstration really helped me

    • @sohamdatey22
      @sohamdatey22 4 года назад

      check out this video For amazing content with code Example nicely presented ruclips.net/video/Mz3y-s1jkkE/видео.html

    • @HippieInHeart
      @HippieInHeart 2 года назад +3

      concrete factories, cement, did i accidentally walk into a construction supply shop or something? lol. but yeah, i agree, code examples would be pretty helpful.

  • @malino24-souls
    @malino24-souls 2 года назад

    Very good explanation. We had a deep discussion in lessons yesterday because there was the perception that abstract factories return factories but this was massively helpful.

  • @rh7201
    @rh7201 7 лет назад

    your example of dark theme and light theme of an application is the most make sense of application development. Thank you.

  • @Obsi995
    @Obsi995 6 лет назад +3

    I swear it all made sense with that last themes example. Amazing.

    • @ChristopherOkhravi
      @ChristopherOkhravi  6 лет назад +1

      I’m glad to hear! That’s awesome. How lucky 😊😊 Thanks for watching 😊

  • @sorskilla
    @sorskilla 7 лет назад +1

    You're really onto something with your design patterns series here. Keep on keeping on. I especially appreciate the fact that you compare the implementation to real world applications. For a follow up series I'd suggest revisiting the patterns after a while and focusing on the comments, most common questions, misconceptions, etc.

  • @harkitnebamake
    @harkitnebamake 4 года назад

    Beautifully explained with good example of UI controls.

  • @ambarishkapil8004
    @ambarishkapil8004 4 года назад

    Hey Chris, nice explanation. Absolutely love your big hand gestures and passionate rants.

  • @sriplano748
    @sriplano748 2 года назад

    Yet another awesome video!! When I listen to your explanation it makes me really think as opposed to just be a passive listener. Thank you very much Sir!!

  • @Hdjandbkwk
    @Hdjandbkwk 4 года назад +1

    Thanks for the awesome videos!
    I think the main difference between Factory Method and Abstract Factory is that Factory Method relies on inheritance and let subclass decides how to create object through the factory method(s), whereas Abstract Factory uses composition, client gets an object that implements abstract factory interface and uses that object to create items.
    Abstract Factory is at a higher level since it is an object, while factory method is only a method.

  • @davidsegalle7745
    @davidsegalle7745 3 года назад +1

    I am learning this for the first time and I was so incredibly proud of thinking, damn that would be useful for dark mode in apps or even os. Guess what, took you 30 seconds to say that, I know it's nothing special but it just felt like I was incredibly smart for a second

  • @_overide
    @_overide 6 лет назад +2

    Possibly the best explanation I've ever seen. Thank you Chris!

  • @arshadyusuf4803
    @arshadyusuf4803 6 лет назад

    Wow Christopher.. You are the man!! I tried in couple of other places, but didn't quite grasp AFP. But you made this so simple..! You don't know how thankful I am to you!!

  • @tomahawkay8455
    @tomahawkay8455 3 года назад

    Design Patterns : Never been easier with Christopher Okhravi
    Thank you sir for your high quality content and especially for your eagerness to make sure that the topics are understandable and enjoyable :)

  • @ibrahim47
    @ibrahim47 5 лет назад

    I'm reading the book and i felt like i drowned in an endless ocean of PIZZAS, and luckily i found your channel and now i'm able to skip the rest of the factory patterns part from the book. That was a great boost, Thank you :D
    Of course i'll move back and forth between this playlist and the book, it's really helpful

  • @sazuru5708
    @sazuru5708 4 года назад

    invert bottom right stack and draw green lines to the bottom to avoid line crossing, thanks for the videos!

  • @mitulmunjal3379
    @mitulmunjal3379 2 года назад +4

    Your explanation is very crystal clear and possesses exact amount of depth which is needed to learn design patterns. I am really enjoying these videos.
    If you can please try to reduce the joining of different video clips, it will tremendously help in focussing more on the topic as frequent clips somewhat cause a distraction. But yes, this content is GOLD!

    • @oztv_
      @oztv_ 11 месяцев назад

      we love the jump cuts

  • @ShyamSharma-pg1zu
    @ShyamSharma-pg1zu 3 года назад

    Your teaching style is so nice and easy. Thanks a lot

  • @enmanuelbolzonello4754
    @enmanuelbolzonello4754 4 года назад

    Thanks for all these videos talking about design patterns. Very good and clear explanation.

  • @amraboughazala5986
    @amraboughazala5986 5 лет назад +1

    for the arrows it can work if you selected arrows starting from concrete factories from the bottom only heading to product B and another starting points from top heading to productA.
    Good job you deserve all the good comments.

  • @Hodebrot
    @Hodebrot 5 лет назад

    Dude, you‘re an absolute educational monster. In Uni the reasoning for using composition instead of inheritance was a joke. I mean litterally. The prof cited a joke and that was it. By whatching your videos I am starting to see an actual reason to use composition instead of inheritance. Thanks a lot!

  • @kinvain
    @kinvain 4 года назад

    The explanation is utterly great! And the final example is way better then any "abstract" pizza factory.

  • @dp-bhatt
    @dp-bhatt 7 лет назад

    I think you explained the most difficult design pattern in the simplest way. Thanks again :)

  • @obamabinladen5055
    @obamabinladen5055 3 года назад

    This is top notch stuff. Your viewpoint and how you think about it makes the patterns clearer.

  • @AgrawalRajat
    @AgrawalRajat 3 года назад

    Finally watched Christopher video at 1.5x speed. Because I had already watched his previous factory design pattern video :) :P

  • @leviermonaites6832
    @leviermonaites6832 3 года назад

    I never knew someone with such a great speaking talent man, really really great!

  • @eraykalkan
    @eraykalkan 7 лет назад

    Some examples on the book are rather ambiguous for someone who is new to the concept. Thanks for coming up with more understandable real world examples and analogies.

  • @360theosiris
    @360theosiris 7 лет назад

    Another amazing video. Your way of explaining really makes things stick. Thank you! *Edit: and please don't listen to people saying you repeat yourself or overexplain things. In the first vid I kinda had the same feeling. But then i realized that's part of the genius and why, at the end of the video, everything is so clear! :)

  • @manishbolbanda9872
    @manishbolbanda9872 10 месяцев назад

    hey, first of all thank you for the wonderful explanation,especially the example of light and dark theme icons.. i have read the chapter from book and i must say they really complicated the example in that

  • @abhishekmiet
    @abhishekmiet 3 года назад

    Loved the explanation, was struggling with Abstract factory for more than a day...

  • @nguyenhoangminhtrung2779
    @nguyenhoangminhtrung2779 4 года назад

    some heroes don't wear capes.
    They are giving free knowledge for free with a perfect explanation.

    • @ChristopherOkhravi
      @ChristopherOkhravi  4 года назад

      Haha 😊 Thank you very much for these words. It makes it all worth it 😊😊

  • @cunami2
    @cunami2 7 лет назад

    Moment when u after reading tones of text, and watching 10+ videos, after single video made by Chris everything makes perfect sence...

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 лет назад

      +cunami2 haha :) Thanks I'm very glad you feel that way :)

  • @sumitnegi7409
    @sumitnegi7409 3 месяца назад

    loved the way this guy explains. Nice

  • @urosmilic3300
    @urosmilic3300 4 года назад

    GREAT WORK MATE. You helped me a lot with these patterns, i didn't really understood them until i watched your series..

  • @wellingtongamagomes7411
    @wellingtongamagomes7411 5 лет назад

    This video provided us an excellent explanation about abstract factory pattern and the main points of difference between the abstract factory and the factory method, congrats brother. Thank you very much!

  • @kinty255
    @kinty255 7 лет назад

    I understand this pattern so much better now. Thank you for the great explanation!

  • @riteshsharma929
    @riteshsharma929 5 лет назад

    As a novice to design I often have hard time thinking where this thing could be applicable.
    The example in end of themes in UI was of a great help. Thank you. 😊

  • @utsavshrestha7162
    @utsavshrestha7162 9 месяцев назад

    Thank you. Much easier to understand as a visual learner.

  • @quirkymarshmallow9324
    @quirkymarshmallow9324 4 года назад

    I wouldn't really call it simple design pattern. But I can certainly see how valuable it is. Thanks for the video!

  • @sushmitagoswami2033
    @sushmitagoswami2033 5 лет назад

    you are the best teacher i have ever seen

  • @kamildabek_
    @kamildabek_ 3 года назад

    I love the UI example i.e. dark theme factory vs light theme factory. Really grounds the concept!

  • @CostruttoreFolle
    @CostruttoreFolle 4 года назад

    Awesome video! I had seen only the factory design pattern videos but I cant wait to see the others! Excellent teacher

  • @kumarprateek1279
    @kumarprateek1279 5 лет назад

    This playlist is really good for getting a start in design patterns.

  • @konzinovmaverick4539
    @konzinovmaverick4539 7 лет назад +1

    Just want to thank you again for this new video. You still doing good job and the draws in the video were very meaningful. I'm surely gonna be design pattern expert at the end of this serie. Cant wait for the next one

  • @ervingegprifti2612
    @ervingegprifti2612 Год назад

    Just put ProductA & ConcreteProductA on the down left side so to avoid line crossing. I haven't read all the comments, so perhaps that was mentioned before :). Wonderful explanation.

  • @ayushagarwal2504
    @ayushagarwal2504 Год назад

    Just love the way you teach dude

  • @aksovicdalibor998
    @aksovicdalibor998 4 года назад

    First off, great videos! Really understandable and straight forward. A bit late to the party, as I am, and don't actually know if someone has already commented this (probably has), but if it would be so important that the lines don't cross, you could have drawn the blue ones from the bottom of the concrete factories, going under the concrete products to the right side of them. This would make them all parts of visually distinguishable groups (like a two sea currents on a map, for example). Hope this helps someone! :D

  • @musings2134
    @musings2134 3 месяца назад

    You did God's work by making these videos! May you get rewarded for it.

  • @Aruna721
    @Aruna721 6 лет назад

    Best design pattern tutorial series ever!

  • @sachinjaybhay7439
    @sachinjaybhay7439 3 года назад

    Fantastic series of lectures... Really appreciate the efforts taken to bring out the essence of each pattern... The key I think is the problem, solution definitions and the relatable examples... Kudos

  • @riteshtyagi5439
    @riteshtyagi5439 6 лет назад +12

    Amazing tutorials sir, the best I have ever seen for design patterns, this is exactly what I was looking for. Thank you so much

  • @geedhu000
    @geedhu000 7 лет назад

    Thanks for wonderful video. It helped to understand the difference of Factory Vs Abstract Factory clearly.

  • @saudnaeem
    @saudnaeem 6 лет назад

    I watched your videos and passed my design patterns Exam with good grade. Thank you so much for such great effort. Stay blessed

  • @ToBa2501
    @ToBa2501 2 года назад +1

    Hello, I have a question. What if you add an additional methodFactory to the factory because you need to create a new product? Would that mean you must change all factories because each factory has to implement the new creation method? Doesn't that mean that this violates the OpenCLose principle? Is this pattern still useful if the product types increase very often?

  • @miketh4434
    @miketh4434 4 года назад

    You are a very talented teacher. Thanks a lot really

  • @Vahi
    @Vahi 6 лет назад +1

    I am really impressed by your way of teaching
    Really helped me understand the abstract factory and factory methods pattern
    Glad I found your lessons on youtube
    Keep up the good work

  • @vivekraj1427
    @vivekraj1427 3 года назад

    Best series on design pattern👍👌

  • @IdanMoral
    @IdanMoral 7 лет назад

    I've a good example that you can use to explain this pattern:
    If you make a nature simulator that creates animals and environments for them you can use abstract facory pattern
    to create a factory the makes combinations of different animals and environments.
    one concrete factory can create combination of arctic animals and arctic environment,
    and other can create a combination of desert animals and desert environment.
    if you try to combine arctic animals and desert environment it doenst make sense.
    I hope it helps :)
    (Btw, continue making your awsome videos!)

  • @sv3167
    @sv3167 4 года назад

    What is going on, this guys is way better than my teacher.. Goooooood job, I understand now!!!!!

  • @kapilkumar-mf7pn
    @kapilkumar-mf7pn 5 лет назад

    u are really genious.....
    jo aapko ye subject samajh mai aaya

  • @djpeterson7479
    @djpeterson7479 4 года назад

    A friend and I wrote custom game engine a while back ago. It supported DX9 and OpenGL. I really wish I had thought of this when creating resources. We used a more traditional Factory Method approach which made it possible to share resources from different graphic APIs. So you had to be really careful which you used. Abstract Factory probably would have made this better. Thanks for the video!

  • @mark22390
    @mark22390 7 лет назад

    Watched the entire series and I had to subscribe to your channel.... easy to understand and you give great examples. cant wait for the next video!!!

  • @albinsjostrand7050
    @albinsjostrand7050 6 лет назад +2

    Loving these walkthroughs! Perfect for the courses I'm taking that always have very unclear explanations, but where you make it very clear!

  • @abcdeereijgfhd3215
    @abcdeereijgfhd3215 3 года назад +1

    Well this really sounds like oop concept. Just another way to say. Thx for ur great explanations

  • @renarsdilevka6573
    @renarsdilevka6573 4 года назад

    You are excellent, Christopher, just brilliant

  • @simaphore
    @simaphore 2 года назад

    Your explanation is brilliant!

  • @AnubhavShrivastava
    @AnubhavShrivastava 6 лет назад +1

    the way you speak and present is awesome :)
    thank you.

    • @ChristopherOkhravi
      @ChristopherOkhravi  6 лет назад

      Thank you very much. I appreciate it :) And thank you for watching :)

  • @lankymorley
    @lankymorley 7 лет назад

    I love this series, thanks for your super clear explanations. I'm a fan of the jump cuts, they keep my mind from wandering.

  • @n0block
    @n0block 5 лет назад +2

    Something clicked in my mind while watching this video. Thank you.