Factory Design Pattern in Java
Vložit
- čas přidán 27. 07. 2024
- Check out our courses:
Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : bit.ly/java-spring-cloud
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
Instagram : / navinreddyofficial
Linkedin : / navinreddy20
TELUSKO Android App : bit.ly/TeluskoApp
Discord : / discord
What is Design Pattern? #factory
Recommended Book :
Head First Design Pattern : amzn.to/2pY5xbR
Factory Design pattern in java
Factory design pattern belongs to Creational design pattern which belongs to Design Patterns in java.
This video has practical sesssion on factory design pattern.
Factory Design Method Pattern defines an interface or abstract class for creating an object but let the subclasses decide which class to instantiate
Factory Method Pattern is also known as Virtual Constructor.
Java and Spring Framework For beginners with Spring Boot : - bit.ly/3LDMj8D
Java Tutorial for Beginners (2023) :- bit.ly/3yARVbN
Trainer: Navin Reddy
Subscribe to our other channel:
Navin Reddy : / @navinreddy
Telusko Hindi :
/ @teluskohindi
Subscribe to the channel and learn Programming in easy way.
Java Tutorial for Beginners : goo.gl/p10QfB
Scala Tutorials for Java Developers : goo.gl/8H1aE5
C Tutorial Playlist : goo.gl/8v92pu
Android Tutorial for Beginners Playlist : goo.gl/MzlIUJ
XML Tutorial : goo.gl/Eo79do
Design Patterns in Java : goo.gl/Kd2MWE
Java Servlet : goo.gl/R5nHp8
Hibernate Tutorial :goo.gl/N5ONYg
Spring MVC Tutorial : goo.gl/9ubbG2
OpenShift Tutorial for Beginners : goo.gl/s58BQH
Spring Framework with Maven : goo.gl/MaEluO
Sql Tutorial for Beginners : goo.gl/x3PrTg
String Handling in Java : goo.gl/zUdPwa
Array in Java : goo.gl/uXTaUy
Socket Programming in Java : goo.gl/jlMEbg
Exception Handling in Java : goo.gl/N4NbAW
Regards,
Navin Reddy
Simple and straightforward explanation, this gonna stick with me forever as a Dev. Thx Nev
Thanks for very easy to grasp explanation! It was actually much easier than we think if presented right. Kudos!
Really nice and worth for gaining knowledge.Thanks for that. Humble request you to make videos on the other missed Design Patterns as well. Many Thanks.
Clear, simple, nice and effective way to teach Factory Design Pattern! Super helpful to me!
I have watch many videos for this . finally got a simple understanding explanation for factory design pattern. tysm
Awaiting for more...!! Amazing... thank you!
I really liked your comments about the mobile operating systems :D btw nice explanation , keep it like that !
Absolute life saver, so much clearer than my lecture
Easy and quick explanation like other java pattern examples. Thanks for your hard work you put in to make us understand.
This is the most straightforward implementation I've seen so far. Thanks a lot.
Thank you! wonderful explanation.
To the point. It really helped me. Thanks so much!
Its simpler to understand than other videos in youtube
your video is crystal clear i got my understanding right from you thank you!
Hi Naveen,I am preparing a introductory video set for freshers in my team and I have selected many of your basic online lessons. Thank you for the videos..real time saver for me.👏
One question: what's the background behind the hello aliens greetings and object names in your video? Nation wants to know.🧐
I like your humor as well as teaching skills :D
Really a awesome video I got clear knowledge about design patterns especially factory design patterns.🙏🙏
That happy realization that its "instance" not intance :D
🤣🤣
as the usual, clear and nice explanation
Thankyou very much sir. Really to the point explanation.
Thanks.. excellent and simple .. way understanding .. for a layman
Nice one , cleared a lot about FDP Thank you
This is a really nice and simple to understand explanation, thank you so much!
Yes it is, because this isn't Factory Method :)
Thank You for the clear explanation.
Very nice and simple tutorial....good job..
Great tutorial, thank you
Superlike. Thank you Sir. :)
@
Everything Summed up in a nicely compact informative Session
Thank you Navin, it is clear and precise
Thanks a lot clear explanation.❤
ekdam mast samjhaya hai thank you :)
Thank you so much sir for explaining design patterns
nice explanantion....... very helpful
amazing
very easily explained
Excellent example! Keep it up.
amazing explanation
Thank u so much!
1lakh views and not even 1k+ likes... Guys don't just watch the video and go... At least show some respect to this guy and his work.
I guess reason is being his opinion about Windows 😀
Good content and explanation buddy
Really amazing explanation..
Think you sir. This is very helpful.
Awesome
great job sir
Please upload more videos,Thank You.....
Thank you for this 🙏
Your sense of Humour is Amazing. Windows OS: " I'm about to die" lol
Good one.
Nice and simple to understand 👍👍👍👍
THANKS SO MUCH
Nice explanation bro!!!
Thank You, Naveen!
Nice Explanation
thank you
PERFECT !!
very nice
Nice tutorial...I suggest you add abstract factory design pattern
love it
Please make a video on Observer design pattern as well :)
Can you please also tell how can we use it with @Autowire
I want to be able to switch between the two databases using factory pattern.
Hi Navin, Can you take video for Abstract Factory design pattern ?
Thank you
Thanks!
The only thing you are missing, is why? as in, you could use the args[] to pass the OS type at run time, depending on what OS you are running, therefore having a dynamic application based on what is passed to it by the caller
thanks
thanks a lotttttttttttttttttttttttttttttttttttttttttttttttttttttttt
Very good human in the planet
Super bro👍
Thank you!!!!
Thank you ,It is clear, Please let me know if we have a video for abstract factory design pattern
Good for cross browser testing during automation testing using java
Hey .. i m new in this learning journey of Design Pattern . This video was really helpful but i m confused in this one thing , who is this "client" ? I m sure its not the end user .. is it someone who's gonna use that result to work further? A fellow programmer ?
Thanks
In ur explain u can take also template design pattern need to modification required just create one super template class and here declare all the abstract method and override it but in future any thing modification required then only go to the super class and modified without any ur os and android class
looking for more design patterns..
Can you please make videos on decorator and strategic design pattern
Thank bhai
Hi Naveen, when we are adding OS obj = osf.getInstance("something"), it means we are modifying the client class and we need to compile it. How is this different from directly creating object of IOS class?
When you'll create a full project ... Then this string will be taken from the user from the frontend and based on that we r creating object and returning it.
So user doesn't need to create object , he only needs to type the string and thus object creation stays hidden!
What you have said in this video is a simple factory..
make videos on all design patterns.
Could you please explain abstract factory pattern and difference between factory and abstract
7 years later and I am still watching it.
which s/w you using for coding
3:44
even I also laughed so hard on that....
But it is not dying does it ? It still holds 75 pc market share today in desktop os
It very nice, but do you think your OperatingSystemFactory class is violation of "Open Closed Principle"? I think we should use other way instead if-else
What if we use hashmap for that ?
i think its better to package all 3 OS with interface and make those classes default rather public and then make a public factory there in the same package without if/else. that would be more secure
Hi Sir, thanks for presenting this topic in such an understandable manner!
Nice video...
I have a question about inheritance and polymorphism. I am creating a static method in child class which have private constructor. And the parent class have same private constructor and stayic method. Parent class extends GrandParent class which have public constructor with 3 arguments.
My problem is the error shown in child class for making its own constructor.
Can you please show me any direction.
People who have disliked his videos are those who are using Windows mobiles :p
Or perhaps they disliked it because it's not accurate. What's described is not the Factory Method Design Pattern.
@@risteardob2095 what is it then?
😂 you mean, they gonna die
factory design pattern is only use to the minimal modification is required but again we are not achieving the complete loosely couple
which version of IOS you are using >??
Can we create this getInstance method as a static method in OS interface?
Why is getInstance() method is returning OS type (6:30) in OperatingSystemFactory class. Can someone explain the reason behind it.
Can you add real life video example with spring ? …switching between databases auto wiring with factory
This guy has a lot of great videos, learned a lot from his videos. Although for this one, and some of his videos he doesn't really explain the purpose clearly, why would you do that? why bother? also factory classes for most implementations I saw , then getInstance method is static, makes sense, you don't need to create new factory every time you want some object. Also some best practices would help, like some implementations I see enum as the param type of getInstance.
its good if OperatingSystemFactory is made singleton instead of using new operator in client code, isn't it?
I was watching kudvenkat video and there this factory method was explained as Simple Factory and there was different code for Factory Method, so is this true that it's Simple Factory Method?
Didn't understand from line 5 in OperatingSystemFactory.java.....We generally declare methods directly why r u creating as public Os getinstnce()......plz explain
What if we want to add more Operating systems but don't want to make changes in OperatingSystemFactory. Is there any way to do this?
What you call importing the package is importing the class.
Shouldnt we implement singleton also here for maximum optimisation
When you say that your exposing to the client the implementation () e.g when you do new Windows(); or new Android():, what does that mean? Who is the client? How does the client see the code? Isn't that the user who is using your application? Please clarify
@ridhwaan any The client is the class using the objects of the different OS
Think of this code as DLL and client is consuming that DLL
Factory design pattern = if you are creating object on the basis of some condition(here based on the parameter that is passed) then it is known as factory design pattern.