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
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.
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!
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!
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.
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!
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!
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?
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 :)
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.
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!!
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
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!
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.
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
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
EnemyShip is an abstract class that I used to create UFOEnemyShip and RocketEnemyShip. You cannot instantiate an abstract class. It is just there to facilitate polymorphism. Does that make sense?
Here is some scanner code that should help with that stackoverflow. com/questions/722270/is-there-an-equivalent-to-the-scanner-class-in-c-sharp-for-strings
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.
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 :)
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!
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
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.
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!
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
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
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.
Thank you :) Maybe if you see another example it will make more sense. I tend to improve when I cover a topic the second time. Look for Code Refactoring pt 5 on my TH-cam channel. It is also on the Factory pattern. I hope it helps
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
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
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
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
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
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!
EnemyShip newShip = null; that statement in your factory, you can remove that since you return the values directly instead of returning the newEnemyShip :)
thank you so much Derek! I'm currently studying design patterns and i came across this great playlist that simplifies every detail. thank you again for the effort! :)
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.
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.
Learn in One Videos for Every Programming Language
Subscribe to Bookmark them: bit.ly/2FWQZTx
C++ : th-cam.com/video/Rub-JsjMhWY/w-d-xo.html
Python : th-cam.com/video/N4mEzFDjqtA/w-d-xo.html
Java : th-cam.com/video/n-xAqcBCws4/w-d-xo.html
PHP : th-cam.com/video/7TF00hJI78Y/w-d-xo.html
MySQL : th-cam.com/video/yPu6qV5byu4/w-d-xo.html
JavaScript : th-cam.com/video/fju9ii8YsGs/w-d-xo.html
C# : th-cam.com/video/lisiwUZJXqQ/w-d-xo.html
HTML5 : th-cam.com/video/kDyJN7qQETA/w-d-xo.html
CSS3 : th-cam.com/video/CUxH_rWSI1k/w-d-xo.html
JQuery : th-cam.com/video/BWXggB-T1jQ/w-d-xo.html
TypeScript : th-cam.com/video/-PR_XqW9JJU/w-d-xo.html
ECMAScript : th-cam.com/video/Jakoi0G8lBg/w-d-xo.html
Swift : th-cam.com/video/dKaojOZ-az8/w-d-xo.html
R : th-cam.com/video/s3FozVfd7q4/w-d-xo.html
Haskell : th-cam.com/video/02_H3LjqMr8/w-d-xo.html
Handlebars : th-cam.com/video/4HuAnM6b2d8/w-d-xo.html
Bootstrap : th-cam.com/video/gqOEoUR5RHg/w-d-xo.html
Rust : th-cam.com/video/U1EFgCNLDB8/w-d-xo.html
Matlab : th-cam.com/video/NSSTkkKRabI/w-d-xo.html
Arduino : th-cam.com/video/QO_Jlz1qpDw/w-d-xo.html
Crystal : th-cam.com/video/DxFP-Wjqtsc/w-d-xo.html
Emacs : th-cam.com/video/Iagbv974GlQ/w-d-xo.html
Clojure : th-cam.com/video/ciGyHkDuPAE/w-d-xo.html
Shell : th-cam.com/video/hwrnmQumtPw/w-d-xo.html
Perl : th-cam.com/video/WEghIXs8F6c/w-d-xo.html
Perl6 : th-cam.com/video/l0zPwhgWTgM/w-d-xo.html
Elixir : th-cam.com/video/pBNOavRoNL0/w-d-xo.html
D : th-cam.com/video/rwZFTnf9bDU/w-d-xo.html
Fortran : th-cam.com/video/__2UgFNYgf8/w-d-xo.html
LaTeX : th-cam.com/video/VhmkLrOjLsw/w-d-xo.html
F# : th-cam.com/video/c7eNDJN758U/w-d-xo.html
Kotlin : th-cam.com/video/H_oGi8uuDpA/w-d-xo.html
Erlang : th-cam.com/video/IEhwc2q1zG4/w-d-xo.html
Groovy : th-cam.com/video/B98jc8hdu9g/w-d-xo.html
Scala : th-cam.com/video/DzFt0YkZo8M/w-d-xo.html
Lua : th-cam.com/video/iMacxZQMPXs/w-d-xo.html
Ruby : th-cam.com/video/Dji9ALCgfpM/w-d-xo.html
Go : th-cam.com/video/CF9S4QZuV30/w-d-xo.html
Objective C : th-cam.com/video/5esQqZIJ83g/w-d-xo.html
Prolog : th-cam.com/video/SykxWpFwMGs/w-d-xo.html
LISP : th-cam.com/video/ymSq4wHrqyU/w-d-xo.html
Express : th-cam.com/video/xDCKcNBFsuI/w-d-xo.html
Jade : th-cam.com/video/l5AXcXAP4r8/w-d-xo.html
Sass : th-cam.com/video/wz3kElLbEHE/w-d-xo.html
You are amazing!
th-cam.com/video/EAOgVOZjAS4/w-d-xo.html factory pattern in .net and .net core
Here are all the design pattern videos in order, and on one page newthinktank. com/videos/design-patterns-tutorial/
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
still helping developers after 11 years
amazing video
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.
This tutorial was made so long ago but is still so perfect
what do u mean long ago???
8 years ago was 2 years ago
"long ago"... very relative
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!
Thank you for the compliment I'm happy I could help
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!
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.
You're very welcome :) A C++ tutorial is in the works and will be out very soon
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!
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.
Yes that is where the design patterns came from. They were great solutions for common problems that eventually people started writing down.
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
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!
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?
Good tutorial. No fluffing around, no waiting for someone to slow type out everything, only important information explained precisely. Nice stuff
Thank you for all the nice compliments :)
You're very welcome :) I'm glad I have an audience for these topics. You're english is very good by the way
You are very welcome :) thanks for taking the time to say you liked it
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 :)
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.
Thank you :) I'm happy you are enjoying the DP videos
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!!
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 :)
I'm really curious what are your thoughts on this implementation of the factory:
public class TeamFactory {
public Team createTeam (Class
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
I'm glad you are enjoying the videos :)
Thank you for taking the time to tell me the video helped :)
You're very welcome :) It is very nice to be able to help so many nice people
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!
Yes encapsulation and decoupling is the goal of the factory and many other patterns. I'm very happy to have helped :)
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.
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.
I’m happy I could help :)
You're very welcome :) Thank you for taking the time to say you liked it
Thank you :) I'm experimenting with new ways to teach so that information sticks in the brain. I'm glad you enjoy the videos.
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 :)
That is awesome! Congratulations! I'm very happy I was able to help. Thank you for taking the time to tell me that. It means a lot to me :)
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
Happy holidays and Merry Christmas to you and your family as well :)
You explain really well, have an easy to understand accent and your code is pretty clear. Thank you for sharing your knowledge!
Thank you very much :)
Yes this is also called the factory method. The other factory pattern I cover is the abstract factory
I'm very happy that you've been able to use them with other languages! That's great
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
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
Great video,thanks! According to headfirst, this is a simple factory pattern...
Your voice is like a auctioneer. It is quick but very clear.
Jimmy Cheng You're very welcome :) I'm glad you liked it.
Thank you so much Derek for these videos ! They are very helpful, I learn much more from you than from actually going to college!
UnspokenDesirexX I'm very happy that I can help :) You're very welcome.
I understood factory pattern in just 10 minutes by watching this video...Thanks Derek ..You're awesome :-)
EnemyShip is an abstract class that I used to create UFOEnemyShip and RocketEnemyShip. You cannot instantiate an abstract class. It is just there to facilitate polymorphism. Does that make sense?
Here is some scanner code that should help with that stackoverflow. com/questions/722270/is-there-an-equivalent-to-the-scanner-class-in-c-sharp-for-strings
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.
+Luke Slywalker Thank you very much for the compliment :) i appreciate it.
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!
Thank you :) I'm happy that it helped
Your lecture is way better than tons of professors. thank you so much
I'm always happy to help :) Sorry about the confusion
You're very welcome :) I wish more people would make videos so that we could provide a free education for all.
You're very welcome :) Thank you for taking the time to tell me you like the videos.
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
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 :)
+MsMaklaj Thank you very much :)
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!
+Starface606 Thank you :) My goal with these tutorials was to make the GOF book easier to understand.
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
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.
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!
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
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
8:50 "Show you what is so factory about this factory"! LOL Derek! Great movie.
That's funny :) I'm glad you liked it
The way you are explaining in these videos, presentation are absolutely understanding and cool..:)
Thanks muck Derek!!!!
Thank you :) It is very gratifying to be able to help people all over the world!
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.
best tutorial for this pattern, all the others are so confusing, got this in 2 minutes, thanks
You're very welcome :) yes I covered facade. It is on my TH-cam channel in the design patterns playlist
You're very welcome :) Good luck on your interview!
These videos are greatly appreciated. Youre so much better than my professor
although i use php, this video really helps me a lot about kowning factory design pattern, good job Derek
Happy holidays and merry Christmas!
Love the way you breeze through it...never been on the edge of my seat watching a tutorial before...Thank you so much!!
That is a good idea. Anything you can do to lower coupling is almost always good :)
Thank you very much :) I do the best I can to make complex ideas understandable. I'm glad you like them
Thank you :) Maybe if you see another example it will make more sense. I tend to improve when I cover a topic the second time. Look for Code Refactoring pt 5 on my TH-cam channel. It is also on the Factory pattern. I hope it helps
This saved my degree, my last course I just couldn't get it, until I watched these videos. thanks
That's Awesome! I'm happy I could help
Best explanation ever! You put the concepts very simple and straightforward! Thank you for the work you put in!
+Filip Ghimpeteanu You're very welcome :) I'm glad it helped
I'm glad you fixed it. Always feel free to ask questions :)
From bottom of my heart, thank you for making this video. I really struggled understanding design patterns. Thanks
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
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
You're very welcome :) I do my best to make the topics interesting
Your tutorials are great Derek. They're great for revisiting patterns and I always recommend you for reviewing or learn design patterns.
+Steven Fox Thank you very much :)
How you break the "if else" into new line literally hurts... Nice video :D
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
Did you compare your code to the code I have on my site. It sounds like a little typo
That's super :) Im glad I was able to help. You're very welcome
Your videos are saving me in school rn. Thank you!!!!
I'm happy to be of help :)
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
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
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!
EnemyShip newShip = null;
that statement in your factory, you can remove that since you return the values directly instead of returning the newEnemyShip :)
thank you so much Derek!
I'm currently studying design patterns and i came across this great playlist that simplifies every detail. thank you again for the effort! :)
I'm very happy to hear that it helped :)
Thank you so much for your different example. I was read much of websites but I learned with you.
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.
Even after 8 years still, a very good video with clear explains...Thanks!!!
love your videos, Derek. you explain concepts in a direct and digestible manner. thank you 🔥
Thank you for the nice compliment :)
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.
Wow, thank you very much :) It makes me very happy to know that I was able to help
i learn from this list more than i learn at school four years.
Thank you :) I'm very happy that it helped
Thank you very much :) I'm constantly trying to improve. Thanks for the input
Thanks very much for this. I had read it on paper several times and just wasn't getting it - you nailed it ;)
Kevin McCaughey You're very welcome :) I'm glad I could help.