Factory Pattern - DESIGN PATTERNS (C#/.NET)

Поділитися
Вставка
  • Опубліковано 29 вер 2024

КОМЕНТАРІ • 16

  • @AvgDan
    @AvgDan Рік тому +1

    "Define an interface for creating an object, but let subclasses decide which class to instantiate. The Factory method lets a class defer instantiation it uses to subclasses." (Gang Of Four)
    Your example does defer the instantiation to sub classes but the decision of which class got instantiated was ultimately determined by changing which factory was used Program.Main. I would have liked to have seen a single factory decide which type of OnlineStore to instatiate, unless you're suggesting subclasses should not DECIDE which class to instantiate.

  • @mocococo2877
    @mocococo2877 10 місяців тому

    Thank you for your tutorial.
    That exact way of extending code without modification is mentioned by a guy who calls himself Ardelis in his SOLOD course. He claims that this is implementation of the Open Closed Principle where your main code is closed for modifications but you can easily add extensions.
    I tend to agree with that one.

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

    really glad I found this channel

  • @aminejadid2702
    @aminejadid2702 4 роки тому +3

    thank you ! excited about the remaining patterns

  • @m.preacher2829
    @m.preacher2829 Рік тому

    this is the most convenient pattern in my opinion.

  • @2005Azm
    @2005Azm 4 роки тому +2

    You sir are a Master teacher !

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

    Great content 👍

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

    Hi Sean, really appreciating your vids, especially the full stack wpf, I would like the source code to factory pattern but do not know what source code link in the description means, where is the description in the video? please.

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

      Click "Show More" in the video Description.

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

    nice explanation, but vid to too fast.

  • @FuzzyDPozzy
    @FuzzyDPozzy 4 роки тому +4

    The only thing that I learned from this tutorial is that we use methods to initialize our contructors.
    I think this tutorial could be improved.
    For example, it's good to show the class that you are referring to instead of being in that class that does not show the implementation.Even though you showing what does it do in a later point, as someone who is learning this first time it is a boomer , sorry.
    Another thing is you could try to speak a bit slower, so we have time to process what is happening.
    I love short tutorials but i would prefer if this was 25 minutes and I good understand it a bit better.
    Also please don't take me wrong , it just suggestion for you to be better in little words (constructive criticism) ;)

    • @SingletonSean
      @SingletonSean  3 роки тому +11

      Thanks Fuzzy, I'll consider your suggestions. However, I take pride in my videos being short and to the point. As developers, we're busy people and just want the answers.
      I've found too many videos where the author extends the video way longer than it needs to be and ends up talking in circles (usually just so they can throw more ads in the video!!). Instead of a 30 minute video, a developer could watch my 10 minute video and then spend 20 minutes in their IDE to solidify what they have just learned (since actually writing the code is definitely the best way to learn). Of course, the video length varies depending on the topic.
      I'm not convinced I need to show the implementation of the class in this example. The implementation is not important to understanding the factory pattern. As developers, we're used to not always seeing implementations, such as when using external libraries. Sometimes we must accept this abstraction, and if we can't (such as if there's a bug in the library), then we must dig through the source control. That said, I've linked the source control in the description :)
      These are my opinions, which aren't necessarily that important considering I'm not the viewer. I apologize for my unsatisfactory content. That said, I will definitely consider your suggestions and brainstorm solutions.

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

      @@SingletonSean thank you