Factory Design Pattern

  Рет қаралды 804,429

Derek Banas

Derek Banas

Күн бұрын

Пікірлер: 703
@derekbanas
@derekbanas 5 жыл бұрын
Learn in One Videos for Every Programming Language Subscribe to Bookmark them: bit.ly/2FWQZTx C++ : kzbin.info/www/bejne/iKbFXn2pn7Kbjbs Python : kzbin.info/www/bejne/hGXQdq18ec-kqqM Java : kzbin.info/www/bejne/pF7bcqSZd6iqqZY PHP : kzbin.info/www/bejne/bYWpYWOef65qbrs MySQL : kzbin.info/www/bejne/r4HYZ6SMasesq5Y JavaScript : kzbin.info/www/bejne/nJvYapyfbb6mfdU C# : kzbin.info/www/bejne/oprWmqqLj6-Lp7M HTML5 : kzbin.info/www/bejne/oXXce4FtprZ4iqM CSS3 : kzbin.info/www/bejne/eYbbeZKojLh8Z80 JQuery : kzbin.info/www/bejne/eIi7mJp4YrlkoLM TypeScript : kzbin.info/www/bejne/Y4G1kIunjJ59gLc ECMAScript : kzbin.info/www/bejne/gJLOoJxmfJ2feMk Swift : kzbin.info/www/bejne/mnzEoJ2Fj5KUsJo R : kzbin.info/www/bejne/qWSpoK2Mm8lqp5Y Haskell : kzbin.info/www/bejne/ZmPCeWaCn9aAqJo Handlebars : kzbin.info/www/bejne/annYcqGDa8dlmpo Bootstrap : kzbin.info/www/bejne/naKydqKLh5qFfsk Rust : kzbin.info/www/bejne/i2Kod5p5g7F3eJo Matlab : kzbin.info/www/bejne/hIS2hZ6hgLeUmKs Arduino : kzbin.info/www/bejne/h4DCe5-wZtajetk Crystal : kzbin.info/www/bejne/eqmpgWCNn9anqcU Emacs : kzbin.info/www/bejne/f5LKk6lvbJl6orM Clojure : kzbin.info/www/bejne/mZqqqnuhedqDd6c Shell : kzbin.info/www/bejne/nqjVn6CHqtKnhtk Perl : kzbin.info/www/bejne/jXbKmXyOqJ15bMU Perl6 : kzbin.info/www/bejne/omHdgaqenLyHna8 Elixir : kzbin.info/www/bejne/pnOxgJSsh9SBgpI D : kzbin.info/www/bejne/qKi9d4ekm56Verc Fortran : kzbin.info/www/bejne/lZCVhpp8g76anJo LaTeX : kzbin.info/www/bejne/jJnQnH-ohM9_qdk F# : kzbin.info/www/bejne/mWjIf3eAg5xobrc Kotlin : kzbin.info/www/bejne/fpDSeJxuqtp3pqM Erlang : kzbin.info/www/bejne/f3bLqJZoppatfZY Groovy : kzbin.info/www/bejne/eGqbm5Zuncmob8k Scala : kzbin.info/www/bejne/equppWOPoL-ibq8 Lua : kzbin.info/www/bejne/n37ElKuQhrKDjtU Ruby : kzbin.info/www/bejne/epvManSCeMyZpq8 Go : kzbin.info/www/bejne/eXechGeHj9qJaZI Objective C : kzbin.info/www/bejne/a5bWgqSQfq9rack Prolog : kzbin.info/www/bejne/iarOqYqme9yAfdU LISP : kzbin.info/www/bejne/r562ometfdekr7c Express : kzbin.info/www/bejne/rnWmfJaEd6umq6s Jade : kzbin.info/www/bejne/omakiZaOdrVnqJo Sass : kzbin.info/www/bejne/rauWnHiigcd4fqc
@TheFerayon
@TheFerayon 5 жыл бұрын
You are amazing!
@riddhieducation4966
@riddhieducation4966 3 жыл бұрын
kzbin.info/www/bejne/e3KymImFj890iZY factory pattern in .net and .net core
@derekbanas
@derekbanas 11 жыл бұрын
You use the Factory design pattern when you want to define the class of an object at runtime. It also allows you to encapsulate object creation so that you can keep all object creation code in one place. The abstract pattern just makes more complex objects
@voidpointer398
@voidpointer398 4 ай бұрын
still helping developers after 11 years amazing video
@Jehan99100
@Jehan99100 11 жыл бұрын
I am studying for an interview as a Senior Java Developer and I found these to be very helpful. I am sure I learned all this before but it is a nice refresher since I do not always use them every day at work and I have a bad memory. Thanks Derek, we really appreciate this service you provide.
@justintorre694
@justintorre694 4 жыл бұрын
This tutorial was made so long ago but is still so perfect
@teratoma.
@teratoma. 3 жыл бұрын
what do u mean long ago??? 8 years ago was 2 years ago
@jojokuki9701
@jojokuki9701 3 жыл бұрын
"long ago"... very relative
@derekbanas
@derekbanas 12 жыл бұрын
I eat egg beaters (Egg Whites) now and again. I purely eat this way because I try to be healthy and I really don't like meat. I never liked eating it. I don't have anything against anyone that hunts. When I was little I had to eat deer meat to survive. Thankfully now I can eat what I want :)
@kitsurubami
@kitsurubami 4 жыл бұрын
60 seconds into the video and you already explained it so much better than any other resource i have seen so far. and i have watched a ton of them. thank you!
@derekbanas
@derekbanas 4 жыл бұрын
Thank you for the compliment I'm happy I could help
@sodatta11
@sodatta11 11 жыл бұрын
The best thing about your tutorials is that they are precise. That prevents any kind of confusion.. Sometimes I rewind a bit to pick the pace, but over all your lessons are very well imprinted in the viewer's mind. Great Work!
@NC-ps2ck
@NC-ps2ck 10 жыл бұрын
I just wanted to say that when you outline the basic info in text in the beginning, that is extremely helpful. I'm the type of person who likes to get the gist of something aside from textbook descriptions, and those brief and concise intros are awesome. Thank you very much.
@derekbanas
@derekbanas 12 жыл бұрын
You're very welcome :) It is very nice to be able to help people all over the world. I'm glad you liked the video
@Razorrr16
@Razorrr16 3 жыл бұрын
Congrats on this video because you made it very clear and simple! 🙌 However I'd like to make some notes that can help understand this best to new coders: 1. Encapsulating the decision making of what EnemyShip to create in the Factory, you avoid duplication of code (yes, youd said it). But I can imagine coders thinking "WHERE!?". Well if you don't do it in the Factory class, then you are gonna put that logic in every place that you may need to create an EnemyShip, such as the main() method you used in the first example. 2. Another benefit is that inside the factory method you can handle exceptions, such as when the string passed to choose the concrete EnemyShip is invalid, you can for instance throw an IllegalArgumentException. If needed you can catch that exception in the client class (ie: the class using the factory) or maybe just throw a RuntimeException. Hope it helps!
@tivmego
@tivmego 11 жыл бұрын
I have not watched all of your DP tutorials but if the method of teaching used here is the same applied all through the tutorial, then you have won my heart and time. I want to thank you for your time. God bless you!
@Lukomeyan
@Lukomeyan 9 жыл бұрын
I see there are quite a few negative comments. I believe the point of this tutorial is to demonstrate use of the factory pattern. Sometimes when you need to illustrate certain aspects of programming you need to skip a few things and ignore "style" and other factors as you're on a clock when creating a video. I believe the factory pattern is brought across quite well in this video and it really helped me understand it.
@derekbanas
@derekbanas 9 жыл бұрын
+Luke Slywalker Thank you very much for the compliment :) i appreciate it.
@derekbanas
@derekbanas 11 жыл бұрын
Yes that is where the design patterns came from. They were great solutions for common problems that eventually people started writing down.
@derekbanas
@derekbanas 11 жыл бұрын
I'm glad you are enjoying the videos :)
@abolfazlsaravani2214
@abolfazlsaravani2214 2 жыл бұрын
every once in a while I come here to refresh my memory. it is fast and concise. after all these years, still one of the best for design patterns.
@derekbanas
@derekbanas 11 жыл бұрын
You are very welcome :) thanks for taking the time to say you liked it
@derekbanas
@derekbanas 11 жыл бұрын
If you are dealing with many data formats a facade may help you hide that complexity. A factory may help if you need to create many instances for each file format. An adapter may also help you deal with incompatible interfaces? It all depends on what your dealing with. I hope that helps?
@derekbanas
@derekbanas 11 жыл бұрын
Thank you :) I'm planning on making an advanced algorithms tutorial that will be covered as I continue making Android tutorials. I'm planning on covering a bunch of topics other then Android over the next few months including C, C++, JEE Topics, Advanced Algorithms, Ruby and some random psychology topics people have been asking for
@dhammond249
@dhammond249 10 жыл бұрын
Good tutorial. No fluffing around, no waiting for someone to slow type out everything, only important information explained precisely. Nice stuff
@derekbanas
@derekbanas 10 жыл бұрын
Thank you for all the nice compliments :)
@johnesco
@johnesco 11 жыл бұрын
So I just started Ruby and ran into this same issue. I had lots of if-elses to control what got created and how and started to run into maintainability issues. The ideas here were general enough to be applicable to almost any (possibly all?) OO based languages. Thanks so much for posting this!
@derekbanas
@derekbanas 12 жыл бұрын
The diet I created helped me to lose over 80 pounds. It focused on quantity over calories. That forced me to find low calorie / low fat / low sodium alternatives for everything. I've never eaten factory produced meat so I have no idea what it tastes like luckily :) I've seen the videos and agree the process is both terrible for the animals as well as for those who eat the food, but I always try to avoid judging. I agree that regular eggs are way better :D
@justfair4181
@justfair4181 7 жыл бұрын
I will anwser some questions though. A Simple Factory pattern is one that returns an instance of one of several possible classes, depending on the data provided to it. Usually all of the classes it returns have a common parent class and common methods, but each of them performs a task differently and is optimized for different kinds of data. The Factory Method pattern is a clever but subtle extension of this idea, where no single class makes the decision as to which subclass to instantiate. Instead, the superclass defers the decision to each subclass. This pattern does not actually have a decision point where one subclass is directly selected over another class. Instead, programs written to this pattern define an abstract class that creates objects but lets each subclass decide which object to create.
@derekbanas
@derekbanas 11 жыл бұрын
Thank you :) I'm experimenting with new ways to teach so that information sticks in the brain. I'm glad you enjoy the videos.
@derekbanas
@derekbanas 11 жыл бұрын
Thank you :) I did my best to make the tutorials easy to grasp so they could be applied to other languages. Thank you for telling me I succeeded.
@tibimose823
@tibimose823 8 жыл бұрын
Super cool. I just wrote in about 2 hours a random football commentary. I made classes : Player, Team and TeamFactory (+some particular teams classes) and now the player can pass and shoot. This is so cool because after you implement it, you only have to add stuff and it doesn't break anything. Thank you!!
@derekbanas
@derekbanas 8 жыл бұрын
That's awesome! I'm happy I could help. I love making little fake people in my computer and then just watch them live in there :)
@tibimose823
@tibimose823 8 жыл бұрын
I'm really curious what are your thoughts on this implementation of the factory: public class TeamFactory { public Team createTeam (Class
@derekbanas
@derekbanas 11 жыл бұрын
You're very welcome :) Thank you for taking the time to say you liked it
@khanasfireza9515
@khanasfireza9515 4 жыл бұрын
I have used these design patterns, figured some of them myself, but never knew these had names before watching this video. But great playlist learned some new design patterns which I think will help me in my upcoming projects. Thank you so much, sir.
@derekbanas
@derekbanas 4 жыл бұрын
I’m happy I could help :)
@derekbanas
@derekbanas 11 жыл бұрын
You're very welcome :) Thank you for taking the time to tell me you like the videos.
@derekbanas
@derekbanas 12 жыл бұрын
I was for a few months, but my body couldn't handle it. I used to get very jumpy all of the time. If you go completely raw your body processes the food very quickly which a least in me caused stress. If you are an athlete I'd highly recommend it, but it didn't work for me. I only eat grains, veggies and cheese. I could never give up cheese :) No sweets either
@derekbanas
@derekbanas 12 жыл бұрын
If you created a subclass with a method that is only in the subclass and not in the super class you wouldn't be able to access that method by referring the subclass as the super class using polymorphism. Technically you could with reflection, but I'm ignoring that for now. You may want to look at my reflection tutorial? I bet it will open the world to you, but just understand it isn't considered a good idea to use reflection very often. It is very powerful, but confusing to some people
@derekbanas
@derekbanas 11 жыл бұрын
My number one goal is to make complex topics easy to understand. Thank you very much for telling me that I succeeded! You're very welcome :)
@hullyoung
@hullyoung 5 жыл бұрын
super helpful, I love your approach where you explain the 'bad' approach first then explain 'good' way to implement the same functionality with factory pattern.
@derekbanas
@derekbanas 5 жыл бұрын
Thank you :) I'm happy you are enjoying the DP videos
@elfusortega
@elfusortega 11 жыл бұрын
I agree with Derek, while you could make it a Singleton pattern you would be adding more 'complexity' or 'semantics' to a single class, thus giving more responsabilities to a single class, and remember one of the best things to achieve better modularity (I can't think of a OOP definition) you need to have well defined responsabilities for each class.
@derekbanas
@derekbanas 11 жыл бұрын
Thank you :) I'm sorry, but a may not understand the question. This is just an example of using the factory method.EnemyShip is used only to be able to pass its subclasses so it is more dynamic
@derekbanas
@derekbanas 11 жыл бұрын
You're very welcome :) I do my best to make the topics interesting
@derekbanas
@derekbanas 11 жыл бұрын
Yes encapsulation and decoupling is the goal of the factory and many other patterns. I'm very happy to have helped :)
@derekbanas
@derekbanas 11 жыл бұрын
I'd follow the advice of your professor since he will decide on your grade :) I personally like to cover the patterns from the least complicated to the more complicated. I also like to structure them so that after you learn a concept in one pattern I like to reenforce it by using a similar pattern. The difference between me and professors is that I don't believe there are as many rules as they do. I hope that helps
@theismywedding
@theismywedding 7 жыл бұрын
Hey man, I am a student at the university of applied sciences in Rotterdam ( the netherlands ) and I would like to thank you from the bottom of my heart for all these amazing informative videos, they really help me out!
@derekbanas
@derekbanas 7 жыл бұрын
Thank you for taking the time to tell me that they helped :) I greatly appreciate that. It is also particularly cool that I'm helping people in other countries because I never travel. I feel like I'm seeing the world in some weird way :D
@JICH2028
@JICH2028 10 жыл бұрын
Great video,thanks! According to headfirst, this is a simple factory pattern... Your voice is like a auctioneer. It is quick but very clear.
@derekbanas
@derekbanas 10 жыл бұрын
Jimmy Cheng You're very welcome :) I'm glad you liked it.
@vincentconrad9289
@vincentconrad9289 6 жыл бұрын
Why not supplying the class of the object, that should be created, to the factory and create the instance via Reflections? This way you could avoid these "bad code" if statements. You could also limit the factory to only accept Classes of your SuperType X via createIntance(Class
@jiabinchen6598
@jiabinchen6598 11 жыл бұрын
Your lecture is way better than tons of professors. thank you so much
@derekbanas
@derekbanas 11 жыл бұрын
You're very welcome :) yes I covered facade. It is on my KZbin channel in the design patterns playlist
@derekbanas
@derekbanas 12 жыл бұрын
You could call it immediately after creation. You could give every ship an id and then refer to it that way. You could cycle through all ships using an enhanced for. You could use reflection. There are many ways. Don't worry I'll be covering refactoring very soon and it will provide real world examples on when and how to use design patterns
@derekbanas
@derekbanas 11 жыл бұрын
Thank you :) I'm very happy i was able to succeed with what I aimed to do in this video. I'm glad you liked it
@mostinho7
@mostinho7 4 жыл бұрын
Used to create instances of objects that share a superclass Type returned needs to be determined at runtime so we use factory. Centralizes the code that creates the objects 2:05 uml diagram
@derekbanas
@derekbanas 11 жыл бұрын
I'm very happy that you enjoyed it :) That was a little typo on my part. It would be better to say extends with the abstract class
@derekbanas
@derekbanas 11 жыл бұрын
I'm not sure what your asking in your first question. As per the second one it is ok to make it static, but you then won't be able to subclass
@jaimeogrady6843
@jaimeogrady6843 6 жыл бұрын
You explain really well, have an easy to understand accent and your code is pretty clear. Thank you for sharing your knowledge!
@derekbanas
@derekbanas 6 жыл бұрын
Thank you very much :)
@derekbanas
@derekbanas 11 жыл бұрын
I'm glad you fixed it. Always feel free to ask questions :)
@koendemonie4883
@koendemonie4883 11 жыл бұрын
EnemyShip newShip = null; that statement in your factory, you can remove that since you return the values directly instead of returning the newEnemyShip :)
@derekbanas
@derekbanas 11 жыл бұрын
You're very welcome :) It is very nice to be able to help so many nice people
@VectorMed
@VectorMed 11 жыл бұрын
Great tutorial. Really powerful to explain the concept, then step through code line by line to explain why someone would want to use it. I also appreciate that you took the time to edit out downtime in editing the code so you could explain this in much less time.
@derekbanas
@derekbanas 11 жыл бұрын
Yes that is the same thing
@derekbanas
@derekbanas 11 жыл бұрын
Thank you for taking the time to tell me the video helped :)
@derekbanas
@derekbanas 12 жыл бұрын
You're very welcome :) Thank you for the kind words
@derekbanas
@derekbanas 11 жыл бұрын
Not a problem. This stuff can get complicated. There are many moving parts :)
@sixbutton9
@sixbutton9 7 жыл бұрын
Humble Brag: Completed 1HR Tutorials: Go, Python, Java, Elixir, Erlang, C++, jQuery %50, Haskell %80 Tkinker: MessageBox, Calculator, started TextEditor Before matching video will compare results and add line numbers when watching. I couldn't figure that part out using the tkinker website. Four or Five of the Python ones. Patterns Observer, Sort and General working on Factory as I type. Completed means typed in everything myself and got to compile and run. I push pause and rewind like thousands of times while watching the videos. Setups Atom, PyCharm and Eclipse already was using Brackets for JavaScript. I have also expiremeted with NodeJS, Elm, JQuery, Bacon and Haskell, before watching your videos. The server side is my weakness. I did get the Django server to start. Looking forward to PyGame. Failures fSharp and Kivy. I can't get either of those to work on linux. General comment thanks for the free PHD. Thanks a bunch.
@derekbanas
@derekbanas 7 жыл бұрын
That's awesome! I'm glad you found them useful. Have you tried this for F# fsharp.org/use/linux/
@sixbutton9
@sixbutton9 7 жыл бұрын
Derek Banas Yeah, I tried everything I could google on the subject. I can open a FILE in Visual Studio Code and the F# code format coloring works. The little F# thingy shows up. I'm using the Ionide-fsharp extension. I can fsharp my .fs file and get a .exe using the terminal, but I can't get hello world to run. It always says file not found. I tried ./file name.exe etc.... Some things work really easy in Linux some don't.
@derekbanas
@derekbanas 11 жыл бұрын
You're very welcome :) I try to keep them interesting
@derekbanas
@derekbanas 11 жыл бұрын
You're very welcome :) I wish more people would make videos so that we could provide a free education for all.
@derekbanas
@derekbanas 11 жыл бұрын
I'm always happy to help :) Sorry about the confusion
@derekbanas
@derekbanas 11 жыл бұрын
Thank you very much :) I do the best I can to make complex ideas understandable. I'm glad you like them
@spicytuna08
@spicytuna08 6 жыл бұрын
From bottom of my heart, thank you for making this video. I really struggled understanding design patterns. Thanks
@derekbanas
@derekbanas 11 жыл бұрын
You're very welcome :) A C++ tutorial is in the works and will be out very soon
@abhineetrocks
@abhineetrocks 11 жыл бұрын
Love the way you breeze through it...never been on the edge of my seat watching a tutorial before...Thank you so much!!
@hbladeh
@hbladeh 6 жыл бұрын
How you break the "if else" into new line literally hurts... Nice video :D
@SujeetShenoy
@SujeetShenoy 11 жыл бұрын
I understood factory pattern in just 10 minutes by watching this video...Thanks Derek ..You're awesome :-)
@derekbanas
@derekbanas 11 жыл бұрын
I can't think of any reason that that would hurt, but that doesn't necessarily mean you should use singleton. I have to think about that. Off of the top of my head I'd say don't do it just because it will make the code confusing
@benjaminmaclaren9548
@benjaminmaclaren9548 5 жыл бұрын
This saved my degree, my last course I just couldn't get it, until I watched these videos. thanks
@derekbanas
@derekbanas 5 жыл бұрын
That's Awesome! I'm happy I could help
@derekbanas
@derekbanas 11 жыл бұрын
Thank you :) Sorry, but I don't think I used both in one tutorial. My refactoring tutorial does have a fair share of examples on how you can use patterns together.
@thecuriousone12
@thecuriousone12 10 жыл бұрын
Thank you so much Derek for these videos ! They are very helpful, I learn much more from you than from actually going to college!
@derekbanas
@derekbanas 10 жыл бұрын
UnspokenDesirexX I'm very happy that I can help :) You're very welcome.
@Sergio_Loureiro
@Sergio_Loureiro 3 жыл бұрын
1.st time in decades someone made me actually like to look to Java code (me being more on the C#/C++ playing field).
@derekbanas
@derekbanas 11 жыл бұрын
In this tutorial I'm using a program named UmLet. It works on every OS
@darkthrongrising5470
@darkthrongrising5470 6 жыл бұрын
Mr Banas, you have explained these patterns very well, I would venture yours was the best series on this topic. Good job and thank you sir!
@derekbanas
@derekbanas 6 жыл бұрын
Thank you :) I'm happy that it helped
@yougiely
@yougiely 7 жыл бұрын
i learn from this list more than i learn at school four years.
@derekbanas
@derekbanas 7 жыл бұрын
Thank you :) I'm very happy that it helped
@Starface606
@Starface606 9 жыл бұрын
seriously, I also read the design patterns book of those great four - but only after watching these videos I seem to understand the patterns:) good job!
@derekbanas
@derekbanas 9 жыл бұрын
+Starface606 Thank you :) My goal with these tutorials was to make the GOF book easier to understand.
@derekbanas
@derekbanas 11 жыл бұрын
You can change anything that you need. The design patterns are just guides. They don't have to follow exactly what I did
@sakules
@sakules 9 жыл бұрын
Why did you create EnemyShip newShip = null; in the factory class, when you never use them?
@filipghimpeteanu2880
@filipghimpeteanu2880 9 жыл бұрын
Best explanation ever! You put the concepts very simple and straightforward! Thank you for the work you put in!
@derekbanas
@derekbanas 9 жыл бұрын
+Filip Ghimpeteanu You're very welcome :) I'm glad it helped
@derekbanas
@derekbanas 11 жыл бұрын
You're very welcome :) I'm glad I have an audience for these topics. You're english is very good by the way
@tomliuye
@tomliuye 11 жыл бұрын
although i use php, this video really helps me a lot about kowning factory design pattern, good job Derek
@bharathreddyappareddy3113
@bharathreddyappareddy3113 6 жыл бұрын
The main purpose of factory class is to hide object creation process. so in future if you want to add one more type that does not force you to alter the base code
@BobbitoDigital2007
@BobbitoDigital2007 11 жыл бұрын
Thanks for the quick reply, it turns out i had a } in the wrong place, again thanks so much for your time in these tutorials, they're great. Much appreciated.
@mrmohamedramadan6
@mrmohamedramadan6 4 жыл бұрын
best tutorial for this pattern, all the others are so confusing, got this in 2 minutes, thanks
@stevenfox9695
@stevenfox9695 8 жыл бұрын
Your tutorials are great Derek. They're great for revisiting patterns and I always recommend you for reviewing or learn design patterns.
@derekbanas
@derekbanas 8 жыл бұрын
+Steven Fox Thank you very much :)
@derekbanas
@derekbanas 11 жыл бұрын
Thank you :) I have been think about covering Ruby because I don't think it would require a ton of videos to cover like java and c#. Ill try to add them soon to mix up the android series
@derekbanas
@derekbanas 11 жыл бұрын
Thank you very much :) I'm constantly trying to improve. Thanks for the input
@MsMaklaj
@MsMaklaj 8 жыл бұрын
Very clear and informative. Really like the way you jump right to the examples, which immediately show the usefulness of the pattern. Also, it's cool that you have an entire series dedicated to design patterns. Useful stuff. Thanks :)
@derekbanas
@derekbanas 8 жыл бұрын
+MsMaklaj Thank you very much :)
@91whoiswho
@91whoiswho 11 жыл бұрын
really appreciate your effort. These videos are very clear and precise. I can start with these and then go for the detailed with a crisp and basic idea.Keep it up!
@derekbanas
@derekbanas 11 жыл бұрын
Thank you :) I do my best to make DP understandable. May God bless you and your family as well
@derekbanas
@derekbanas 11 жыл бұрын
William I don't know why I did that? I do these videos out of my head most of the time and at the time I must have been thinking about doing something with it. Feel free to delete it because it won't effect the program. Sorry about the confusion
@derekbanas
@derekbanas 11 жыл бұрын
I'm very happy that you've been able to use them with other languages! That's great
@derekbanas
@derekbanas 12 жыл бұрын
You're very welcome :) It makes me very happy to help
@masami2876
@masami2876 3 жыл бұрын
Even after 8 years still, a very good video with clear explains...Thanks!!!
@PatrickPitso
@PatrickPitso 6 жыл бұрын
You’re really good at this. It’s my first time seeing this in Java. I was taught in C++
@derekbanas
@derekbanas 6 жыл бұрын
Thank you :)
@abunism
@abunism 9 жыл бұрын
I don't find any other video explaining Design Patterns better.
@derekbanas
@derekbanas 9 жыл бұрын
+abunism Thank you :)
@F4TP
@F4TP 6 жыл бұрын
In my opinion, the factory pattern offers multiple advantages… and he put in a fundamental part of the implementation of Factory Pattern before he needed to (the Abstract Class). If he had left this out at first and created multiple classes (individual enemy ship classes) without extending the abstract class, people would have understood that adding this (the abstract class) is a fundamental part of the pattern… in order to allow for runtime object instantiation (lazy instantiation)… which is obvious polymorphism (this is the real advantage of this pattern IMO). The second benefit then, would be that all of the ‘if-statements’ then are encapsulated in their own class (following the single responsibility’ design principle), aiding cohesion and reducing coupling. Please tell me that I am wrong so I get a better understanding of this pattern?
@parisanaderi1647
@parisanaderi1647 2 жыл бұрын
Thank you so much for your different example. I was read much of websites but I learned with you.
@prateekalmighty
@prateekalmighty 11 жыл бұрын
The way you are explaining in these videos, presentation are absolutely understanding and cool..:) Thanks muck Derek!!!!
@bssandeep
@bssandeep 12 жыл бұрын
Happy holidays and merry Christmas!
Abstract Factory Design Pattern
13:20
Derek Banas
Рет қаралды 499 М.
Factory Method Pattern - Design Patterns (ep 4)
27:21
Christopher Okhravi
Рет қаралды 552 М.
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 3,3 МЛН
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 30 МЛН
Factory Design Pattern - Why and How with Code!!
15:35
Keerti Purswani
Рет қаралды 90 М.
Strategy Design Pattern
11:32
Derek Banas
Рет қаралды 751 М.
The Factory Pattern in Python // Separate Creation From Use
14:58
Deep Dive Into the Repository Design Pattern in Python
11:56
ArjanCodes
Рет қаралды 79 М.
What is the Factory Pattern? | Software Design Principles
26:48
Be A Better Dev
Рет қаралды 28 М.
8 Design Patterns | Prime Reacts
22:10
ThePrimeTime
Рет қаралды 434 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 300 М.
Design Patterns: Factories
25:26
Microsoft Visual Studio
Рет қаралды 55 М.
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 3,3 МЛН