Singleton and Prototype Design Patterns | Systems Design | Object oriented Design Patterns

Поділитися
Вставка
  • Опубліковано 12 січ 2025

КОМЕНТАРІ • 23

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

    The best thing about your videos are that these are easy to follow :)

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

      Hope these are helpful. Do like and subscribe and share with others 🙂

  • @ChandraShekhar-by3cd
    @ChandraShekhar-by3cd 3 роки тому +1

    Please continue this series of design and solid principles.Also pls upload video on the LLD with coding and class diagram. Thanks a lot for your effort and hard work.

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

      Yes Sure, after i have covered the important design patterns, LLD videos will continue. Thanks for watching, do like and share with your friends!!!

    • @ChandraShekhar-by3cd
      @ChandraShekhar-by3cd 3 роки тому +1

      @@TheTechGranth Sure Thanks a lot for your informative videos.

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

    thank you for video, nice explanation
    As part of Interface-substitution principle you are segregating Vehicle into two interfaces one for Mechanic Inspection and another one for Police Inspection, however you are keeping Same name for both interfaces, Am I missing something here?

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

      Don't see this comment relevant to the video but I see your point, I said the other interface can be in some diff module of project, hence keeping same name

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

    Good videos, but didnt get the last part where instead of super.clone() you are suggesting cloning the method. Can you please elaborate?

  • @vickyanand5898
    @vickyanand5898 3 роки тому +2

    One doubt. In starting , you mentioned that a singleton class can be used for configuration file. My question is , if multiple objects are trying to use that one object of configuration, wouldn't it lead to slow read. In case there are many objects. Like 1000s of diff objs trying to access one object and then invoking the function or state inside it .

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

      2 questions
      1) does reading an object takes lock?
      2) do you modify configuration
      If you have used spring or springboot to create beans in config class by default they are singleton, do you modify it make prototype?
      And finally to answer your question about too many objects making a call, I guess that is where you bring in threadpool

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

      @@TheTechGranth 1) Suppose a scenario don’t take lock.
      2) Yes we can make use of thread pool. But when a single object would be created for config file , all will try to access only that instance. So , maybe prototype instance would be better and we can make config class immutable. So only has read access

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

      @@vickyanand5898 not sure what scenario is on your mind, what i meant was for configs related to your application like rest template, db connection bean etc. I do not see a point to make these beans as prototype, even though all connections will be routed through these because, it just defines the connection, the actual number of connections that an application will make with DB will be defined by the pool size in DB for example in oracle it is defined by parameters like processes and sessions

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

    Can you please tell what is the meaning of "beam" time:3:37. You have explained like beam of singleton object. Thanks.

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

    Nice explanation..

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

      Thanks, gald it was helpful. Do like and subscribe and share with your friends 🙂

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

      @@TheTechGranth sure

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

    please make video on abstraction and encapsulation

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

      Are you referring, specific to these oops principles or their usage in some design pattern?

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

      @@TheTechGranth usage in some design pattern

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

      @@BlankSlate5364 sure will be coming up with more design patterns as part of low level design

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

    I think there is small error in the example you gave for Prototype Pattern, instead of Department(1), it should have been Department(1, emplist) inside the main()

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

    Could you please share the python solutions as well in github/youtube?? My peers also want in python