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

  Рет қаралды 14,882

SingletonSean

SingletonSean

Күн бұрын

Learn about the factory design pattern, which is a creational pattern that relies on methods, rather than constructors, to instantiate objects. This is one of my FAVORITE design patterns. Although this demonstration certainly incorporates all SOLID principles, the Single Responsibility and Dependency Inversion principles are highlighted.
Design patterns are important for implementing object-oriented designs and adhering to SOLID principles. Understanding these fundamental patterns helps software developers build clean and maintainable applications.
Timestamps:
0:00 - Pattern Introduction
1:04 - Demo Introduction
3:12 - Implementation
SOURCE CODE: github.com/SingletonSean/desi...

Пікірлер: 16
@mocococo2877
@mocococo2877 6 ай бұрын
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 жыл бұрын
really glad I found this channel
@SingletonSean
@SingletonSean 3 жыл бұрын
I'm glad you found it too, Isaac!
@aminejadid2702
@aminejadid2702 3 жыл бұрын
thank you ! excited about the remaining patterns
@SingletonSean
@SingletonSean 3 жыл бұрын
Thanks amine, I'm excited too!
@arunvishnuk3947
@arunvishnuk3947 3 жыл бұрын
Great content 👍
@m.preacher2829
@m.preacher2829 Жыл бұрын
this is the most convenient pattern in my opinion.
@2005Azm
@2005Azm 3 жыл бұрын
You sir are a Master teacher !
@SingletonSean
@SingletonSean 3 жыл бұрын
Thanks Azim, more on the way!
@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.
@AvgDan
@AvgDan 9 ай бұрын
"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.
@FuzzyDPozzy
@FuzzyDPozzy 3 жыл бұрын
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 жыл бұрын
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
@haizzengunn9350
@haizzengunn9350 3 жыл бұрын
nice explanation, but vid to too fast.
Command Pattern - DESIGN PATTERNS (C#/.NET)
18:11
SingletonSean
Рет қаралды 4 М.
ПАРАЗИТОВ МНОГО, НО ОН ОДИН!❤❤❤
01:00
Chapitosiki
Рет қаралды 2,6 МЛН
Decorator Pattern - DESIGN PATTERNS (C#/.NET)
14:51
SingletonSean
Рет қаралды 6 М.
Factory Method Pattern - Design Patterns (ep 4)
27:21
Christopher Okhravi
Рет қаралды 532 М.
Abstract Factory Pattern - DESIGN PATTERNS (C#/.NET)
11:19
SingletonSean
Рет қаралды 6 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 177 М.
Factory Method Design Pattern
26:55
Wes Doyle
Рет қаралды 15 М.
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,1 МЛН
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 3,1 МЛН
How charged your battery?
0:14
V.A. show / Магика
Рет қаралды 3,3 МЛН
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 3,5 МЛН