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

КОМЕНТАРІ • 56

  • @CodingSimplified
    @CodingSimplified  5 років тому +3

    Source Code: thecodingsimplified.com/factory-design-pattern/

    • @mr.pathaka5132
      @mr.pathaka5132 5 років тому

      hi sir, i am not able to see source code on the given link. Could you please have a look on it.

    • @CodingSimplified
      @CodingSimplified  5 років тому

      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.

    • @prashantsomvanshi574
      @prashantsomvanshi574 4 роки тому +1

      Can you also make a video on the abstract factory pattern? Thank you.

    • @CodingSimplified
      @CodingSimplified  4 роки тому

      @@prashantsomvanshi574 Thanks for your suggestion. I'll try to create on it soon.

    • @kingstonmatias1979
      @kingstonmatias1979 3 роки тому

      A trick : you can watch series at flixzone. Me and my gf have been using them for watching a lot of movies recently.

  • @damercy
    @damercy 4 роки тому +8

    Just subscribed to this channel and this guy made me fall in love with java again. Thank you for the knowledge man. 🔥❤️🙏

    • @CodingSimplified
      @CodingSimplified  4 роки тому +1

      Thanks Dayamoy for such a nice feedback. Keep Watching & please share this channel.

  • @ankitmishra-dp9tx
    @ankitmishra-dp9tx 3 роки тому +3

    simple straight forward and crystal clear explanation. Thanks alot

  • @saiprasanthmattupalli4611
    @saiprasanthmattupalli4611 4 місяці тому

    Nice explanation👌

  • @yashrajsrivastav
    @yashrajsrivastav 11 місяців тому +1

    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?

  • @jesseallaway1149
    @jesseallaway1149 5 років тому +3

    Thank you for your design pattern series, the examples are helpful!

  • @sagarkolhe988
    @sagarkolhe988 7 місяців тому

    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?

  • @rakeshkumargupta4260
    @rakeshkumargupta4260 3 роки тому +3

    Thanks to make videos on design series :) and uploading the source code is awesome :)

  • @rachamallidorasrivignesh4499
    @rachamallidorasrivignesh4499 9 місяців тому

    Thanks a lot brother for your clear explanation.

  • @akash6586760
    @akash6586760 3 роки тому +1

    Wonderful explanation . Straight to the point

  • @ankitachavan5929
    @ankitachavan5929 2 роки тому +1

    easy and onto point

  • @reshmah1497
    @reshmah1497 2 роки тому +2

    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?

    • @Ann-so9yp
      @Ann-so9yp 2 роки тому +2

      Yeah, you should know some basic design patterns like Singleton, Factory, Adaptor for LLD interviews.

    • @CodingSimplified
      @CodingSimplified  2 роки тому

      That's right. For Low level design Interviews, Design Pattern concepts are very helpful.

  • @villa7chirag
    @villa7chirag 4 роки тому +1

    Thanks for the video. Explanation and examples really help.

  • @surajmahato2557
    @surajmahato2557 2 роки тому

    Excellent explaination

  • @anuragsoni1840
    @anuragsoni1840 4 роки тому +1

    Great explanation!

  • @MrAmol1010
    @MrAmol1010 4 роки тому +1

    You just nailed it man❤

  • @MirzaTalks36
    @MirzaTalks36 Рік тому

    instead of == you can use .equals method bro

  • @BharatSonawane23
    @BharatSonawane23 4 роки тому

    Hi, why you not added int wheel into Vehicle class?

  • @shubhamsisodia6710
    @shubhamsisodia6710 3 роки тому +1

    Plz post a video for abstract factory design pattern too

    • @CodingSimplified
      @CodingSimplified  3 роки тому +1

      Sure. I'll add it soon. Thanks for your feedback.

  • @VinayKumar-gu2qz
    @VinayKumar-gu2qz 5 років тому +1

    Really helpful, I subscribed

  • @lordgreat6051
    @lordgreat6051 2 роки тому

    can't we use interface and just change the values that we are passing rather than making 2 objects?

  • @ping4110
    @ping4110 4 роки тому +1

    Well explained

  • @vedant6460
    @vedant6460 Рік тому

    thanks

  • @surajsidar2294
    @surajsidar2294 2 роки тому

    Can we create object of abstract class Vehicle? I am new to Java and read "we can't create object of abstract class"

  • @spnarayanrao
    @spnarayanrao 4 роки тому +1

    can you please explain Abstract Factory design pattern

    • @CodingSimplified
      @CodingSimplified  4 роки тому +1

      Thanks for your suggestion. Sure I'll try to create it soon.

    • @federicoriva7928
      @federicoriva7928 4 роки тому

      @@CodingSimplified yeah it would be super helpful because you're a really great teacher 👏

  • @saketsinha3107
    @saketsinha3107 4 роки тому

    Can you please share some more usecases for factory design pattern?

    • @CodingSimplified
      @CodingSimplified  2 роки тому

      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.

  • @prashantsomvanshi574
    @prashantsomvanshi574 4 роки тому

    Very nice. Would it better if it was type.equals("car") instead type == car?

    • @CodingSimplified
      @CodingSimplified  4 роки тому

      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.

  • @davinder95
    @davinder95 Рік тому

    great

  • @thanos9704
    @thanos9704 3 роки тому

    what happens if you print invalid input ?
    like truck

  • @jemschaudhary5922
    @jemschaudhary5922 4 роки тому

    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.

    • @CodingSimplified
      @CodingSimplified  2 роки тому

      @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)

  • @syedasaduallah4337
    @syedasaduallah4337 4 роки тому

    car "ishtance "
    bike "ishtance"