Factory Design Pattern in Java

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024

Комментарии • 178

  • @rohannarkhede7479
    @rohannarkhede7479 5 лет назад +6

    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.

    • @kandisaganesh
      @kandisaganesh 5 лет назад +1

      I guess reason is being his opinion about Windows 😀

  • @tonnie7079
    @tonnie7079 2 года назад +20

    Simple and straightforward explanation, this gonna stick with me forever as a Dev. Thx Nev

  • @prakharawasthi2579
    @prakharawasthi2579 4 года назад +36

    That happy realization that its "instance" not intance :D

  • @tural.ahmatov
    @tural.ahmatov 2 года назад +8

    Thanks for very easy to grasp explanation! It was actually much easier than we think if presented right. Kudos!

  • @manasranjan7894
    @manasranjan7894 7 месяцев назад +1

    I have watch many videos for this . finally got a simple understanding explanation for factory design pattern. tysm

  • @thestarinthesky_
    @thestarinthesky_ 2 года назад +2

    Clear, simple, nice and effective way to teach Factory Design Pattern! Super helpful to me!

  • @pratimsarkar7205
    @pratimsarkar7205 4 года назад +2

    Its simpler to understand than other videos in youtube

  • @ajaybabusingineedi804
    @ajaybabusingineedi804 7 лет назад +7

    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.

  • @topoisonfungus
    @topoisonfungus 5 лет назад +6

    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.🧐

  • @mahinqureshi5809
    @mahinqureshi5809 2 года назад +3

    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 ?

  • @saichaithvik
    @saichaithvik Год назад +1

    Thanks.. excellent and simple .. way understanding .. for a layman

  • @ee-sj8qr
    @ee-sj8qr 3 года назад +1

    your video is crystal clear i got my understanding right from you thank you!

  • @risteardob2095
    @risteardob2095 6 лет назад +21

    What you have described is not the Factory Method Design Pattern. I think you're describing the Simple Factory which isn't an actual design pattern.

    • @abhisheksengupta2819
      @abhisheksengupta2819 4 года назад

      yes

    • @LargerThanCats
      @LargerThanCats 4 года назад +1

      It is the Factory Design Pattern. The Simple Factory uses the Factory Design pattern with one caveat. In this example he is simply demonstrating abstracting away the creation of a product from the client. Extending it to the Factory Design Pattern means instead of simple abstracting away the creation, you're controlling the creation and management of that newly created product. Such as Spring and bean creation. So not exactly the same thing, you're right, but it is a demonstration of one element of the Factory Design Pattern.

  • @nitinkhutemate2155
    @nitinkhutemate2155 7 лет назад +57

    People who have disliked his videos are those who are using Windows mobiles :p

    • @risteardob2095
      @risteardob2095 6 лет назад +4

      Or perhaps they disliked it because it's not accurate. What's described is not the Factory Method Design Pattern.

    • @honest_bishop5905
      @honest_bishop5905 3 года назад

      @@risteardob2095 what is it then?

    • @adithyarathnayake
      @adithyarathnayake Год назад

      😂 you mean, they gonna die

  • @amtawfiq
    @amtawfiq 2 года назад

    This is the most straightforward implementation I've seen so far. Thanks a lot.

  • @MegaRockandroll09
    @MegaRockandroll09 2 года назад

    Your sense of Humour is Amazing. Windows OS: " I'm about to die" lol

  • @limbritadaikalam1847
    @limbritadaikalam1847 4 года назад +3

    Thank you! wonderful explanation.

  • @AM-qc7gh
    @AM-qc7gh 3 года назад +1

    Absolute life saver, so much clearer than my lecture

  • @sicariussss
    @sicariussss 5 лет назад +2

    This is a really nice and simple to understand explanation, thank you so much!

    • @Tydides64
      @Tydides64 4 года назад

      Yes it is, because this isn't Factory Method :)

  • @Studyroid
    @Studyroid 5 лет назад +35

    3:44

    • @4cankursharma
      @4cankursharma 3 года назад +1

      even I also laughed so hard on that....

    • @lalithmahadev5027
      @lalithmahadev5027 3 года назад

      But it is not dying does it ? It still holds 75 pc market share today in desktop os

  • @tanertasim3637
    @tanertasim3637 6 лет назад +3

    I really liked your comments about the mobile operating systems :D btw nice explanation , keep it like that !

  • @s3649
    @s3649 5 лет назад +1

    Thankyou very much sir. Really to the point explanation.

  • @lokesh398
    @lokesh398 4 года назад

    Really a awesome video I got clear knowledge about design patterns especially factory design patterns.🙏🙏

  • @iamSSudheer
    @iamSSudheer 2 года назад +4

    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?

    • @joseph2073
      @joseph2073 Год назад +1

      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!

  • @rmn6088
    @rmn6088 5 лет назад +3

    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.

  • @Secretclaps
    @Secretclaps Год назад

    7 years later and I am still watching it.

  • @saisnehitha1043
    @saisnehitha1043 4 года назад

    What you have said in this video is a simple factory..

  • @muralidharang5664
    @muralidharang5664 Год назад

    Thank you Navin, it is clear and precise

  • @sadiqraza1658
    @sadiqraza1658 3 года назад

    Those who think Windows is not dying and still it holds >=75% market, please have a look on the package he created. Mr. Alien is talking about phones not desktops :) .

  • @RetroGames1979
    @RetroGames1979 3 года назад

    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

  • @dkstudio7828
    @dkstudio7828 7 лет назад +5

    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

    • @MrSaransh
      @MrSaransh 5 лет назад

      What if we use hashmap for that ?

    • @divyeshkumarbalar7732
      @divyeshkumarbalar7732 5 лет назад +1

      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

  • @natashayxt3458
    @natashayxt3458 2 года назад

    Thank you so much sir for explaining design patterns

  • @AshutoshKumar-kq9vh
    @AshutoshKumar-kq9vh 5 лет назад +1

    To the point. It really helped me. Thanks so much!

  • @maheshguptha9796
    @maheshguptha9796 3 месяца назад +1

    how much do you hate windows?
    Naveen Reddy : yes

  • @shaistakhalid7761
    @shaistakhalid7761 5 лет назад

    Easy and quick explanation like other java pattern examples. Thanks for your hard work you put in to make us understand.

  • @pranjalnegi9834
    @pranjalnegi9834 3 года назад

    amazing
    very easily explained

  • @kunaljain6210
    @kunaljain6210 3 года назад

    Thank You for the clear explanation.

  • @greentorainchannel386
    @greentorainchannel386 2 года назад

    Nice and simple to understand 👍👍👍👍

  • @delankoh3494
    @delankoh3494 Год назад

    Good for cross browser testing during automation testing using java

  • @dinushachathuranga7657
    @dinushachathuranga7657 Год назад

    Thanks a lot clear explanation.❤

  • @AyushVerma08
    @AyushVerma08 2 года назад

    Excellent example! Keep it up.

  • @NaveenKumarasinghe
    @NaveenKumarasinghe 8 лет назад +2

    Awaiting for more...!! Amazing... thank you!

  • @MrSaransh
    @MrSaransh 5 лет назад +1

    I like your humor as well as teaching skills :D

  • @muralidharang5664
    @muralidharang5664 Год назад

    Thank you ,It is clear, Please let me know if we have a video for abstract factory design pattern

  • @md.ruhulamin7963
    @md.ruhulamin7963 2 года назад

    Think you sir. This is very helpful.

  • @sohamdatey9035
    @sohamdatey9035 4 года назад

    @
    Everything Summed up in a nicely compact informative Session

  • @Pratapsingh-mt9cu
    @Pratapsingh-mt9cu 5 лет назад

    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

  • @umabharathyts1998
    @umabharathyts1998 Месяц назад

    Thank you for this 🙏

  • @vinothKumar-ik9lu
    @vinothKumar-ik9lu 5 лет назад +1

    Hi Navin, Can you take video for Abstract Factory design pattern ?

  • @piraviperumal2544
    @piraviperumal2544 Год назад +1

    Awesome

  • @praveennandham2933
    @praveennandham2933 4 года назад

    Really amazing explanation..

  • @nonamespls3468
    @nonamespls3468 2 года назад

    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.

  • @kreenu5035
    @kreenu5035 4 года назад

    Nice tutorial...I suggest you add abstract factory design pattern

  • @eliy5550
    @eliy5550 Год назад

    THANKS SO MUCH

  • @mohanishbirje5145
    @mohanishbirje5145 3 года назад +1

    This happens when you make a video without studying about the real pattern.

  • @parulgupta8231
    @parulgupta8231 4 года назад

    Nice Explanation

  • @ridhwaanany7480
    @ridhwaanany7480 8 лет назад +3

    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

    • @ontest5819
      @ontest5819 6 лет назад

      @ridhwaan any The client is the class using the objects of the different OS

    • @HimalayaGarg
      @HimalayaGarg 2 года назад

      Think of this code as DLL and client is consuming that DLL

  • @ritikshrivastava9442
    @ritikshrivastava9442 Год назад

    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.

  • @kosireddigangadhar7182
    @kosireddigangadhar7182 3 года назад

    Super bro👍

  • @palashkhatri7820
    @palashkhatri7820 7 лет назад

    Nice one , cleared a lot about FDP Thank you

  • @techatnyc7320
    @techatnyc7320 11 месяцев назад

    Thank You, Naveen!

  • @Jaggahero
    @Jaggahero Год назад

    Could you please explain abstract factory pattern and difference between factory and abstract

  • @_xenomorph8096
    @_xenomorph8096 Год назад

    Can you add real life video example with spring ? …switching between databases auto wiring with factory

  • @hardikahuja5645
    @hardikahuja5645 3 года назад

    Nice explanation bro!!!

  • @AHMADRAZAKHANjava
    @AHMADRAZAKHANjava 2 года назад

    I watch all your ads on all videos

  • @praneetkumar4420
    @praneetkumar4420 7 лет назад

    Very nice and simple tutorial....good job..

  • @Official-tk3nc
    @Official-tk3nc 4 года назад +1

    skip to 3:44 and thank me later :000

  • @romanterendiy5007
    @romanterendiy5007 4 года назад

    Great tutorial, thank you

  • @BeWithNarendar
    @BeWithNarendar 2 года назад

    PERFECT !!

  • @parthpatel3639
    @parthpatel3639 6 лет назад

    as the usual, clear and nice explanation

  • @javatoyou862
    @javatoyou862 5 лет назад

    great job sir

  • @piotrboczar7967
    @piotrboczar7967 2 года назад

    Thanks!

  • @puna770
    @puna770 7 лет назад

    ekdam mast samjhaya hai thank you :)

  • @michael_scarn_
    @michael_scarn_ Месяц назад

    Thank you!!!!

  • @rounakdas2633
    @rounakdas2633 Год назад

    Hi Sir, thanks for presenting this topic in such an understandable manner!

  • @umabharathyts1998
    @umabharathyts1998 Месяц назад

    This is very similar to Facade Pattern! whats the difference between them ?

  • @bishwajitsahu2100
    @bishwajitsahu2100 6 лет назад

    nice explanantion....... very helpful

  • @sagarmeena2596
    @sagarmeena2596 5 лет назад

    amazing explanation

  • @karamjitsinghsehdev3451
    @karamjitsinghsehdev3451 2 года назад

    Nice attempt Naveen. But purpose of using it is not clear?

  • @SvetoslavHristov-uh4eo
    @SvetoslavHristov-uh4eo Год назад

    Can we create this getInstance method as a static method in OS interface?

  • @PremChougale
    @PremChougale 9 месяцев назад

    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?

  • @abhijithss1244
    @abhijithss1244 Год назад

    Shouldnt we implement singleton also here for maximum optimisation

  • @akramladaf7817
    @akramladaf7817 3 года назад

    Thank bhai

  • @VipinRawat_Offcial
    @VipinRawat_Offcial 2 года назад

    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?

  • @vinays8546
    @vinays8546 3 года назад

    its good if OperatingSystemFactory is made singleton instead of using new operator in client code, isn't it?

  • @nelsonorlandovillamizarman7886
    @nelsonorlandovillamizarman7886 3 года назад

    2:35 Android does not implement OS interface. Mistake but seems you correct it later

  • @biswa12
    @biswa12 4 года назад

    Thank you

  • @Pratapsingh-mt9cu
    @Pratapsingh-mt9cu 5 лет назад

    factory design pattern is only use to the minimal modification is required but again we are not achieving the complete loosely couple

  • @dulajudayanga4050
    @dulajudayanga4050 7 лет назад

    thanks a lotttttttttttttttttttttttttttttttttttttttttttttttttttttttt
    Very good human in the planet

  • @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.

  • @kavin7285
    @kavin7285 Год назад

    Let’s say I have an optional parameter for 1 type of object.
    What do I do now ?

  • @akashchourasiya72
    @akashchourasiya72 Год назад

    Why will it not change clint class u are still passing string as input in fiture u want new object then u need another string so it changes clint … however if there is a change in contruction of object of previously existing then only it will not change clint code

  • @moniljoshi1850
    @moniljoshi1850 5 лет назад

    Can you please make videos on decorator and strategic design pattern

  • @gmmkeshav
    @gmmkeshav 10 месяцев назад

    In operating system factory why didn't we import android iOS, Windows packages?

  • @vamshikrishna298
    @vamshikrishna298 6 лет назад

    Good content and explanation buddy

  • @tinkot
    @tinkot 4 года назад

    What you call importing the package is importing the class.

  • @digiartpassion8513
    @digiartpassion8513 2 года назад

    Didn't understand from line 5 in OperatingSystemFactory.java.....We generally declare methods directly why r u creating as public Os getinstnce()......plz explain

  • @saeedjafary9340
    @saeedjafary9340 4 года назад +4

    Windows.. about to die; Lol; love it.

  • @changliu9266
    @changliu9266 5 лет назад +15

    your extra space and wrong spelling in the video just drives me crazy.

  • @AtifLightning2
    @AtifLightning2 5 лет назад

    Thanks