Factory Design Pattern in Java
Вставка
- Опубліковано 6 лют 2025
- Learn: Properties & Implementation with example in Java of Singleton Design Pattern
Source Code: thecodingsimpl...
Do Watch video for more info
This Problem is synonym of following problems:
Factory design pattern java,
real time example for Factory design pattern in java,
when to use Factory design pattern,
Factory design pattern in java,
Factory design pattern in spring,
design patterns in java,
Factory design pattern implement
Please check video for more info:
CHECK OUT CODING SIMPLIFIED
/ codingsimplified
★☆★ VIEW THE BLOG POST: ★☆★
thecodingsimpli...
I started my UA-cam channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 200+ videos.
★☆★ SUBSCRIBE TO ME ON UA-cam: ★☆★
www.youtube.co...
★☆★ Send us mail at: ★☆★
Email: thecodingsimplified@gmail.com
Source Code: thecodingsimplified.com/factory-design-pattern/
hi sir, i am not able to see source code on the given link. Could you please have a look on it.
Hi, thanks for notifying. This was in cache, so was showing old page. I've flushed the cache, so now it should show code.
Could you please check it now.
Can you also make a video on the abstract factory pattern? Thank you.
@@prashantsomvanshi574 Thanks for your suggestion. I'll try to create on it soon.
A trick : you can watch series at flixzone. Me and my gf have been using them for watching a lot of movies recently.
Just subscribed to this channel and this guy made me fall in love with java again. Thank you for the knowledge man. 🔥❤️🙏
Thanks Dayamoy for such a nice feedback. Keep Watching & please share this channel.
simple straight forward and crystal clear explanation. Thanks alot
Thanks for your nice feedback.
Nice explanation👌
Hey, I like the explaination and the example, but I was wondering if we add if else for getting the instace of each vehicle type, isn't that a voilation of SRP and OCP of SOLID principles? Correct me if I am wrong here, because if there is a new vehicle then we'll have to modify the existing code or is this a case where we can not avoid voilating SRP and OCP?
Thank you for your design pattern series, the examples are helpful!
Thanks.
Nice explanation!! In this design pattern we are creating instance in factory class using if else depending on our requirement but what if class name of bike or car changes ? Then we need to change instance name in factory class. Can we loosely coupled it as well?
Thanks to make videos on design series :) and uploading the source code is awesome :)
Thanks for your nice feedback. Keep Watching.
Thanks a lot brother for your clear explanation.
Wonderful explanation . Straight to the point
Thanks for your nice feedback. Keep Watching.
easy and onto point
Thanks for your nice feedback. Keep Watching.
Good crisp content, easy to understand important points. Can you please tell whether for Object oriented design/Low level design interview, these topics are necessary?
Yeah, you should know some basic design patterns like Singleton, Factory, Adaptor for LLD interviews.
That's right. For Low level design Interviews, Design Pattern concepts are very helpful.
Thanks for the video. Explanation and examples really help.
Thanks Chirag for your feedback. Keep Watching.
Excellent explaination
Great explanation!
Thanks for your nice feedback. Keep Watching.
You just nailed it man❤
Thanks Amol for your feedback. Keep Watching.
instead of == you can use .equals method bro
Hi, why you not added int wheel into Vehicle class?
Plz post a video for abstract factory design pattern too
Sure. I'll add it soon. Thanks for your feedback.
Really helpful, I subscribed
Thanks. Keep watching our other videos as well.
can't we use interface and just change the values that we are passing rather than making 2 objects?
Well explained
Thanks for your feedback. Keep Watching.
thanks
Can we create object of abstract class Vehicle? I am new to Java and read "we can't create object of abstract class"
can you please explain Abstract Factory design pattern
Thanks for your suggestion. Sure I'll try to create it soon.
@@CodingSimplified yeah it would be super helpful because you're a really great teacher 👏
Can you please share some more usecases for factory design pattern?
There can be many use case of it. Wherever you've multiple subclasses or types & you need to create object, you can use it.
One way is to create object directly. Other way is to get object from Factory. Factory will also give you object with the advantage that if something changes later in subclasses, we need to just change in Factory classes & need not to change at every place where we're creating objects.
Very nice. Would it better if it was type.equals("car") instead type == car?
Agree, equals is ideal way to check String values. == checks reference. Though here it won't make any impact, but we should compare values with equals. Thanks for notifying. Will update in code as well.
great
what happens if you print invalid input ?
like truck
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.
@Vinayak More : Thanks for answering. yes, if parent class has parameterized constructor, we've to call from child class at the starting of child class constructor using super(3, 4, 5) (Say if parent has 3 arguments in constructor)
car "ishtance "
bike "ishtance"