What is the Factory Pattern? | Software Design Principles

  Рет қаралды 29,156

Be A Better Dev

Be A Better Dev

Күн бұрын

Пікірлер: 59
@ThuyNguyen-bu9ge
@ThuyNguyen-bu9ge 3 жыл бұрын
The factory pattern helps us to NOT repeat logic all over the place - there is one and only one place to create a new object. So if that new object some day needs new parameters or less parameters, then we don't need to change our code all over the place. We need to only update the Factory where the new object is created.
@IUfidi
@IUfidi 3 жыл бұрын
nice.
@dovias5665
@dovias5665 3 жыл бұрын
Why doesn't this have more views? That's premium content.
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Thank you so much for your kind words Dovias!
@2810quocviet
@2810quocviet 2 жыл бұрын
What a great video. After watching the video several times I've finally grasped the core concept.
@aaa4363
@aaa4363 2 жыл бұрын
Thanks!
@BeABetterDev
@BeABetterDev 2 жыл бұрын
Thank you so much!!!
@hafsahmr9010
@hafsahmr9010 3 жыл бұрын
The coding part really helps! Thank you so much! Would appreciate a video on Abstract Factory.
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Coming soon!
@kais.alkotamy9798
@kais.alkotamy9798 7 ай бұрын
quite an amazing course, I just want to say something that I wish it could be added which is how to approach using one of them "the use cases"
@frederickjavalera558
@frederickjavalera558 3 жыл бұрын
Great content! Did you ever get around to creating the second video on the abstract factory pattern that you mentioned at the end of this video?
@ThuyNguyen-bu9ge
@ThuyNguyen-bu9ge 3 жыл бұрын
Very crisp, clear voice. Good teaching! Would you make a video about why we need the factory pattern - what problems the factory pattern is addressing?
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Hi Thuy, I see from your recent comment you figured out the value of this pattern! You hit the nail on the head :)
@ganesh221b
@ganesh221b 3 жыл бұрын
Thanks a lot Daniel, your videos are great!
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Thanks Ganesh! Glad you enjoy them :)
@rezazaman1714
@rezazaman1714 3 жыл бұрын
Excellent, it made my understanding clear on Factory Method. Waiting for your next video on Abstract Factory Pattern.
@jedgraves8399
@jedgraves8399 2 жыл бұрын
Super helpful. Thank you!
@AmrMekkawy
@AmrMekkawy 2 жыл бұрын
Great clear explanation
@nitinakash3275
@nitinakash3275 4 жыл бұрын
Great contact.. Waiting for the second part
@kshitizkumar2793
@kshitizkumar2793 Жыл бұрын
If the branching logic is still there in the second approach, doesn't it still violate the open close principle ?
@Preotasherpa
@Preotasherpa 3 жыл бұрын
Thank you so much.
@BeABetterDev
@BeABetterDev 3 жыл бұрын
You're welcome Tahsin!
@frotes
@frotes 3 жыл бұрын
Nice video. Would be interested in seeing the composition version you mentioned. I feel composition is the way to go for most things in OOP
@avanthasiriwardana
@avanthasiriwardana 3 жыл бұрын
Good stuffs brother. Liked and Subscribed :)
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Thank you and welcome to the channel!
@smirkedShoe
@smirkedShoe 3 жыл бұрын
Great clarification 👏. Do we have a SOLID principles playlist ? I couldn't find it
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Hi Naman! Not yet but this is a great suggestion!
@lorenzoferri7876
@lorenzoferri7876 3 жыл бұрын
In the last part, when you describe the NYPizzaStore, you break the Open / Close principle anyway, right? wouldn't it be better and optimal to split It in two other classes (NYPepperoniPizzaStore and NYCheesePizzaStore)? I hope you clarify my question. Congratulations on the great video!
@alsonyang230
@alsonyang230 Жыл бұрын
Second this question. Wouldn't the NYPizzaStore still violates O/C principle if there is a NYStyleHamPizza added? Does having the factory abstract class do any better than the simple factory class?
@ayingtorres5938
@ayingtorres5938 3 жыл бұрын
This is an awesome channel!
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Thanks Aying! Really appreciate the kind words.
@ranjithaan5825
@ranjithaan5825 3 жыл бұрын
did I miss the second part of Factory design pattern you have mentioned anywhere? could you please paste the link if you have posted on second part? thanks
@GEhehloopf
@GEhehloopf 2 жыл бұрын
Could you go over the Visitor Design Pattern?
@intuitorx
@intuitorx 3 жыл бұрын
Very helpful
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Thanks!
@saedyousef
@saedyousef 3 жыл бұрын
This channel is so underrated ...
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Thanks Saed, I'm glad you think so :)
@PoojaSharma-vt9xs
@PoojaSharma-vt9xs 3 жыл бұрын
Really very clear explanation.
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Thanks Pooja!
@MrUnknowntraveller
@MrUnknowntraveller 3 жыл бұрын
What blackboard tool are you using? Nice clear explanation. Thank you.
@IUfidi
@IUfidi 3 жыл бұрын
Good. Liked. Subscribed.
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Thank you and welcome to the channel!
@parthshah438
@parthshah438 2 жыл бұрын
could you please provide link for abstract factory deisgn pattern video as you have mentioned in video?
@nehapandit1987
@nehapandit1987 2 жыл бұрын
Is the Second part of this is ready?
@johnyonardpauly5601
@johnyonardpauly5601 3 жыл бұрын
Dude, this looks like a paid udemy course. Thank you for this!
@uzayrsyed6293
@uzayrsyed6293 Жыл бұрын
Shouldn't all these methods be outside of the Pizza class pizza.prepare(), pizza.bake(), pizza.cut(), pizza.box(), createPizza() and instead maybe be in the Factory?
@misoren9645
@misoren9645 Жыл бұрын
I still didn't get it. Isn't the main problem described as "violating the Open/Close Principle"? If we were to add a new kind of Pizza Type, we still would need to modify the if/else type block anyways, so how did creating all that new logic helped to solve the problem if it's still there anyways. Great content though.
@ihabhadjerci5238
@ihabhadjerci5238 2 жыл бұрын
Great content thank you so much, I definitely subscribed, I have a question, what if we have added the ItalianStore Class and we give the user the right the store in the main class how would you know which Store will be choose and how would you handle it since we don't wanna to expose instantiation to client
@mirzaaqeel
@mirzaaqeel 3 жыл бұрын
Good material, can not see git hub link for the code you used in the example.
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Hi Muhammad, check out this link for the code repository: github.com/beabetterdevv/DesignPatterns/tree/master/patterns I still have plans to create the remainder videos, stay tuned in the next few months.
@zemusic2736
@zemusic2736 4 жыл бұрын
like your content, friend
@BeABetterDev
@BeABetterDev 4 жыл бұрын
Thank you very much!
@LoLLuL-d5m
@LoLLuL-d5m 4 ай бұрын
but now runner needs to know the concrete implementation of the factory, which is again an anti pattern, should we create factory for getting these factory?
@alex-dk2rj
@alex-dk2rj 2 жыл бұрын
I'm confused because there is thousands of variations of toppings on new york pizza, so is this method practical for this example? Wouldn't you have thousands of classes?
@jakubrysiak3612
@jakubrysiak3612 2 жыл бұрын
Why do you need the order method, since all it seems to do is call the create method?
@sagartyagi2450
@sagartyagi2450 3 жыл бұрын
Isn't it simple Inheritance?? Why are we calling it a pattern?
@GustavoRubio
@GustavoRubio 3 жыл бұрын
Midterm in 25 minutes boys. Time to set these videos to X2 speed
@BeABetterDev
@BeABetterDev 3 жыл бұрын
Hope you did well!
What is the Singleton Pattern? (Software Design Patterns)
10:16
Be A Better Dev
Рет қаралды 8 М.
What is the Decorator Pattern? (Software Design Patterns)
19:41
Be A Better Dev
Рет қаралды 27 М.
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 17 МЛН
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 173 МЛН
Design Patterns: Factories
25:26
Microsoft Visual Studio
Рет қаралды 55 М.
What is the Command Pattern? (Software Design Patterns)
19:55
Be A Better Dev
Рет қаралды 17 М.
Factory Method Pattern - Design Patterns (ep 4)
27:21
Christopher Okhravi
Рет қаралды 555 М.
The Factory Pattern in Python // Separate Creation From Use
14:58
Factory Design Pattern - Why and How with Code!!
15:35
Keerti Purswani
Рет қаралды 93 М.
What is the Observer Pattern? (Software Design Patterns)
21:49
Be A Better Dev
Рет қаралды 22 М.
8 Design Patterns | Prime Reacts
22:10
ThePrimeTime
Рет қаралды 440 М.
What is the Strategy Pattern? (Software Design Patterns)
13:18
Be A Better Dev
Рет қаралды 59 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 890 М.
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 17 МЛН