Factory Design Pattern - Why and How with Code!!

  Рет қаралды 74,910

Keerti Purswani

Keerti Purswani

Күн бұрын

It’s the most common one - I have actually used it at work many times😎
I haven’t recorded the next video yet, waiting for your feedback. Please do let me know how you find the whole video- example, code - would you like me to change anything?
Always wanted to teach this, it’s finally happening 🤞😇
𝐂𝐡𝐞𝐜𝐤𝐨𝐮𝐭 𝐂𝐫𝐢𝐨 𝐚𝐧𝐝 𝐠𝐞𝐭 𝟏𝟎% 𝐝𝐢𝐬𝐜𝐨𝐮𝐧𝐭 𝐮𝐬𝐢𝐧𝐠 𝐭𝐡𝐢𝐬 𝐥𝐢𝐧𝐤-
www.crio.do/redeem/a39d540/
You can get 𝐃𝐈𝐒𝐂𝐎𝐔𝐍𝐓𝐒 using code "KEERTI" -
➡️ On 𝐂𝐨𝐝𝐢𝐧𝐠 𝐍𝐢𝐧𝐣𝐚𝐬 - bit.ly/CodingNinjas-12
➡️ On 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰𝐑𝐞𝐚𝐝𝐲 - get.interviewready.io/?_aff=K...
➡️ On 𝐄𝐝𝐮𝐜𝐚𝐭𝐢𝐯𝐞 - educative.io/keerti
➡️ On all 𝐆𝐞𝐞𝐤𝐬𝐅𝐨𝐫𝐆𝐞𝐞𝐤𝐬 paid courses - practice.geeksforgeeks.org/co...
Please 𝐬𝐮𝐛𝐬𝐜𝐫𝐢𝐛𝐞 here - / keertipurswani
You can also connect with me on-
𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 (for not so professional, chill side of my life) - keerti.purs...
𝐓𝐞𝐥𝐞𝐠𝐫𝐚𝐦 Channel - t.me/keertipurswani
𝐓𝐰𝐢𝐭𝐭𝐞𝐫 - KeertiPurswani?s=09
𝐋𝐢𝐧𝐤𝐞𝐝𝐈𝐧 - / keertipurswani
𝐂𝐡𝐞𝐜𝐤 𝐨𝐮𝐭 𝐭𝐡𝐞𝐬𝐞 𝐩𝐥𝐚𝐲𝐥𝐢𝐬𝐭𝐬-
𝐌𝐨𝐜𝐤 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰𝐬 - • Mock Coding Interview ...
𝐃𝐞𝐬𝐢𝐠𝐧 𝐏𝐚𝐭𝐭𝐞𝐫𝐧𝐬 -
• Intro to Design Patter...
𝐃𝐒𝐀 - • Median of 2 Sorted Arr...
𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐢𝐧𝐠 - • Burst Balloon Problem ...
𝐇𝐨𝐧𝐞𝐬𝐭 𝐂𝐨𝐧𝐯𝐞𝐫𝐬𝐚𝐭𝐢𝐨𝐧𝐬 -
• Meet Hiring Manager at...
𝐂++ - • VTable & VPointers - V...
𝐁𝐚𝐬𝐢𝐜𝐬 𝐨𝐟 𝐈𝐧𝐯𝐞𝐬𝐭𝐦𝐞𝐧𝐭𝐬 - • What are IPOs? How to ...
𝐋𝐢𝐟𝐞 𝐚𝐭 𝐈𝐧𝐭𝐮𝐢𝐭 - • Meet my Manager at Int...
𝐒𝐡𝐨𝐫𝐭𝐬 - • Floor, Ceil use for Pr...
𝐂++ 𝐒𝐓𝐋 - • What is C++ STL? Why d...
𝐓𝐫𝐞𝐞𝐬 & 𝐆𝐫𝐚𝐩𝐡𝐬 - • BFS, DFS|Explanation w...
𝐖𝐢𝐭𝐡 𝐏𝐚𝐩𝐚 - • Explaining OOPs concep...
𝐒𝐲𝐬𝐭𝐞𝐦 𝐃𝐞𝐬𝐢𝐠𝐧 - • Factory Design Pattern...
𝐏𝐚𝐢𝐧𝐭𝐢𝐧𝐠𝐬 - • Wall Art | SwitchBoard...
𝐕𝐥𝐨𝐠𝐬 - • Best Ladakh Bike Trip ...
The video contains following parts-
0:00-0:23 - Intro
0:23-0:53 - Crio Promotion
0:53-1:33 - Example task
1:33-4:20 - Code for example
4:20-7:34 - Code works!
7:34-9:30 - Why we need factory
9:30-13:11 - Factory Code
13:11-14:40 - Code works with factory!
14:40-15:24 - Recap!

Пікірлер: 193
@premanshdewangan8695
@premanshdewangan8695 2 жыл бұрын
Loved the way you explained the concept by taking an example and Step by step writing the code, talking about its disadvantages, and then coming to a solution by demonstrating the importance of Factory Method. Waiting for your upcoming videos.
@tusharjn
@tusharjn 2 жыл бұрын
kzbin.info/aero/PLuO_Xyt86T60SIBUCHCEof_1ggJWH6QsQ
@RaunakShrivastava
@RaunakShrivastava 2 жыл бұрын
There are plenty of resources for Design patterns in java and python on the internet but very few good resources for C++. This Design pattern series is like an oasis in desert for C++ developers. Thank you so much Keerti.
@Shourya_performs
@Shourya_performs Жыл бұрын
You have to provide the pre requites to start this series. These things might not be known to everyone, considering myself to be an average student who has studied OOPs in C++. 1. Code in header file. (How to write like #ifndef, etc). 2. Less clarity of how many files already created and why? 3. Everything was overwhelming. Should be slow and creation of files should be shown so that one can follow along. 4. commands needs to be explained of the terminal. Idk about the rest but these are my honest opinions.
@amanasati5198
@amanasati5198 23 күн бұрын
Go first learn and practice OOPs again. All the things were really basics of OOPs
@yogeshbaid6455
@yogeshbaid6455 19 күн бұрын
I agree, I think C++ knowledge is pre-requisite here, it'd have been better if this was explained in Python
@mahtube735
@mahtube735 2 жыл бұрын
I use this in most of my projects. I didn't know it was called factory method. Thank you for teaching.
@akhilsharma1778
@akhilsharma1778 2 жыл бұрын
Start of much needed series. My interviews are coming up so I don't know how much it will benefit me but this is a great start.
@arjungupta250
@arjungupta250 2 жыл бұрын
A great series to start really since there is so less quality content available on design patterns. Looking forward for next videos! One feedback, I feel many of the beginners must be struggling with the C++ commands to create excutable cpp files and archives or libraries. A brief explanation on those commands in the beginning of the next video or a separate video would really help.
@abhiroopsingh9320
@abhiroopsingh9320 10 ай бұрын
Yes this is highly required as all the commands here are going above my head.
@kartikeyvishnoi2978
@kartikeyvishnoi2978 2 жыл бұрын
Do continue this series! I really appreciate your effort 🙏🙏
@sunitajoshi902
@sunitajoshi902 Жыл бұрын
I really love the way you explained....thanks for sharing play list.
@abdulshahid7173
@abdulshahid7173 2 жыл бұрын
I'm a c++ developer and was struggling to know the concept, believe me this is the best explanation I could find on KZbin. Thanks for the video
@KeertiPurswani
@KeertiPurswani Жыл бұрын
Thank you so much! Means a lot! ❤️
@swaathimeiyappan1819
@swaathimeiyappan1819 2 жыл бұрын
Serious ly u have explained the concepts very clear.. till date I was using all this in my code without knowing why.. superb..
@cousinskitchentamil596
@cousinskitchentamil596 2 жыл бұрын
Really well explained i have seen multiple videos couldn't grasp the concept but u nailed it thanks a lot please do more video like this
@souvikbanerjee1396
@souvikbanerjee1396 2 жыл бұрын
Awesome simplified explanation Keerti! 🙂Please continue the series covering major design patterns using c++ code examples. Please give a thought about making a video series on C++ multithreading as well. Many thanks! Keep up the good work. 🙂
@rishabhkalra9505
@rishabhkalra9505 2 жыл бұрын
i really like the way you explained. The example was not at all complex, simple vehicle objects work like charm. Would love to see a dedicated Design Pattern series which could help someone prep for OOD. Great Content.
@shankarBinnar-xl8en
@shankarBinnar-xl8en Жыл бұрын
thanks..!! your way of presention is awsome...getting desigin patterns in new and detailed wayy!!😊
@AnshulSharma-gq2vn
@AnshulSharma-gq2vn 10 ай бұрын
Kudos Keerti! This was really good!!
@tulikasnehil8733
@tulikasnehil8733 2 жыл бұрын
Please make more of such videos explaining all design patterns with examples. This was very helpful
@gouthamzz
@gouthamzz 6 ай бұрын
Thank you so much. I have been searching for many tutorials to know about design patterns in c++. I’m lucky that I came across this Vedio. Your explanation is simply superb
@LaveshGarg
@LaveshGarg 5 ай бұрын
short crisp and to the point explanation
@srikanthchivukula4555
@srikanthchivukula4555 2 жыл бұрын
Nice explanation. Now i got cleared what factory pattern does.
@snlagr
@snlagr 2 жыл бұрын
This is very underrated, please make more videos in the series. I am sure it will garner more views in the long term! :D
@mithunram4324
@mithunram4324 2 жыл бұрын
Hey Keerti just saw this video today and your explanation is pretty neat and understandable. Waiting for other design patterns and lld content
@archanashetty5250
@archanashetty5250 Жыл бұрын
Thank you so much, i was struggling to understand this honestly
@sunilthind3257
@sunilthind3257 Жыл бұрын
this is a wonderful video on factory design pattern. loved it
@anmolsoni2704
@anmolsoni2704 Жыл бұрын
Hey Keerti, I just watched the video and I was able to get the concepts and advantages that you talked about in the video but I struggled with the implementation part cuz most of the things were completely new for me. So, could you please suggest any resources for learning the implementation of libraries and header files in c++?
@mohammedbiaskhan8092
@mohammedbiaskhan8092 2 жыл бұрын
It was Really a good one to start with Design Patterns. Really Looking forward to this series. It would be even more good if you add descriptive things to remember at the middle or end to make a note of it for future reference and also adding interview perspective to this. Thanks Keerti.
@divyagoyal455
@divyagoyal455 2 жыл бұрын
Thanks for such amazing content
@nageshpoojary271
@nageshpoojary271 2 жыл бұрын
Nice explanation.. the way you explained the concepts of factory pattern is different than others (through library creation)..hoping for more videos.. for remaining patterns advantages and drawback of using that pattern can also be discussed
@santhoshreddy1284
@santhoshreddy1284 2 жыл бұрын
thank you.. it helps us a lot. where can I find the code? did you upload in the git hub? can you please share the code paths?
@tanmaythaker2905
@tanmaythaker2905 Жыл бұрын
Thanks for this amazing video!
@varunguptapy7176
@varunguptapy7176 2 ай бұрын
in first place you have not included vehicle oblect file vehicle.o in the vehicle liberary, you only added car & bike object file to library. Please explain
@hrishikesh328
@hrishikesh328 2 жыл бұрын
Awesome explanation and one of the most simple explanation I have found on the Internet. Please include more videos
@KeertiPurswani
@KeertiPurswani 2 жыл бұрын
Thank you so much! ❤️😇
@SauravKumar-vj7ks
@SauravKumar-vj7ks 2 жыл бұрын
This was an amazing lecture. Superbly explained, all doubts cleared. Please ma'am explain all the possible design patterns. Really looking forward to this series. 👍
@KeertiPurswani
@KeertiPurswani 2 жыл бұрын
Thank you so much Saurav, means a lot! Please do share the videos with your friends 😇😇
@SauravKumar-vj7ks
@SauravKumar-vj7ks 2 жыл бұрын
@@KeertiPurswani Sure ma'am. Shared the video with all my friends and now you've got a bunch of folks ready to be taught design patterns using C++. Keep up the good work.👍😊
@mr.curious1329
@mr.curious1329 2 жыл бұрын
Di you are doing a great job, pls make more videos .Greatly eager to learn 😊😊👍. Will share these videos too.!!
@keerthi1070
@keerthi1070 Жыл бұрын
clarity at peaks :)
@abhisheksaurabh2007
@abhisheksaurabh2007 2 жыл бұрын
Simple and Nice Explanation , Waiting for New Lectures ,Thanku
@rein29233
@rein29233 4 ай бұрын
Very easy to understand. Thank you.
@roushanraj8530
@roushanraj8530 Жыл бұрын
Just waao Di, got it very easily, i have been reading the online vlogs and tutorials and always i was getting confused and not clear to me....., but this video made everything super easy ♥️💯 One request, please complete this Playlist as soon as possible please 🙏 💜
@KeertiPurswani
@KeertiPurswani Жыл бұрын
I am sorry for being so late but I hope the quality pf explanation will make it upto you. Hoping you like the new videos! ❤️
@teluguanimetoon2811
@teluguanimetoon2811 20 күн бұрын
How to delete the object which dynamically created in im confused about deletion, we are having vehicle pointer and object created is different
@rohitsingh-cn4fg
@rohitsingh-cn4fg 2 жыл бұрын
I have one doubt of this kind of implementation of factory design pattern , I.e this code violate the open and closed principle of SOLID . Because whenever you will be adding new condition in the factory method you will be modifying , but principle says you code should be open for extension and closed for modification. So how could you handle please explain.
@vasukhungar2517
@vasukhungar2517 2 жыл бұрын
Great explanation. Thankyou :)
@mapradnardev
@mapradnardev Жыл бұрын
If in future there is a need to add new vehicle type then developer needs to change in existing library.Doesnt it violates the Open/closed principle?
@balasubramanyam92
@balasubramanyam92 2 жыл бұрын
Great Explanation ! Keep doing the videos.
@karishmasukhwani5270
@karishmasukhwani5270 2 ай бұрын
Hi Keerti, Great explanation. I see some of createFactory classes include around 7-10 constructor arguments and pass the exact same or 1-2 more arguments to create the underlined class. It is little tightly coupled because does not give flexibility to accept new type of class in factory method, is this correct approach? To refactor, I think I can use ClassName as parameter in createFactory, and there will be additional 7-10 constructor arguments passed along.
@shubhamtech89
@shubhamtech89 2 жыл бұрын
With this if else you are polluting the Factory class as well. Imagine adding 10 more type of vehicles tomorrow. You have to maintain a registry of vehicle types added in a kind of hashmap. The key being the vehicle type, the value is the vehicle object.
@aaaaz424
@aaaaz424 10 ай бұрын
The bike and car are stored in a vehicle reference. What if there are functions which are not present in vehicle class but are present in bike or car class (not talking about overridden functions)?
@Pupperoni938
@Pupperoni938 8 ай бұрын
Good explanation, thanks.
@milindmore1977
@milindmore1977 2 жыл бұрын
Really Nice Explanation !
@mehtalovish76
@mehtalovish76 2 жыл бұрын
Really great content. I will just request you to release other lectures soon, so that the continuity doesn't breaks. Thank you for sharing your knowledge..
@ravneetsingh190
@ravneetsingh190 2 жыл бұрын
which code editor tool are you using in video ..
@raj_soni4007
@raj_soni4007 10 ай бұрын
Thanks for this great explaination
@chevvanthie3422
@chevvanthie3422 2 жыл бұрын
Thanks keerti for sharing .. I'm eagerly waiting for all the videos in lld.
@swatiacharya9073
@swatiacharya9073 6 ай бұрын
Nice explanation and thank you fir using c++
@kshitizkumar2793
@kshitizkumar2793 Жыл бұрын
Nice explanation. But don't you think the if-else branching in your factory method will violate the Open Closed principle ?
@prathamsinghal5261
@prathamsinghal5261 11 ай бұрын
I can tell you where Recently I have used this Pattern: I have designed three classes: 1. GkeAgent 2. EksAgent 3. AksAgent Interface: IKubernetesService Implemeted Factory KubernetesServiceFactory. Based on the Properlty file value of the cloud type i am returning the suitable object.
@harshrajput3547
@harshrajput3547 Жыл бұрын
What have you included in Vehicle.cpp 4:33?
@kesarshrivastava1221
@kesarshrivastava1221 Жыл бұрын
Hi Keerti! Thanks for creating the playlist. If you could show the code in Java too, it would be more helpful.
@ravitejaag
@ravitejaag 7 ай бұрын
Very well explained 👍
@krishnamurali5933
@krishnamurali5933 Жыл бұрын
Can you help understand what code went inside vehicle.cpp?
@ashokyamsani
@ashokyamsani Жыл бұрын
Hi Keerthi, rather than going with the bookish / standard definition you have explained in in simple terms so that even novice programmer can understand. but I have a query here , you said that whenever there is a change in the requirement from the client we need to change the library and give it back to the client, I mean when client needs TEMPO vechile, we need to change the library and give it to him right ??
@ajaymanagaon
@ajaymanagaon 8 ай бұрын
Used it in an Web Application where the application had to handle multiple database or different types. I needed to create the database object depending on the connection string passed.
@sarkarsh5537
@sarkarsh5537 2 жыл бұрын
hooollyyy molly this is so well explained! cannot wait for the the rest of the series be up. Please keep upload such awesome content. Much needed video.
@ss-md4qn
@ss-md4qn 2 жыл бұрын
Amazing lecture .
@srilakshmiuvpakala3267
@srilakshmiuvpakala3267 Жыл бұрын
Thank you very much for all your C++vedios. The videos are of great value. But, I still have question on factory design pattern. With the VehicleFactory class introduced , we are making smartclient independent as the code for any new vehicle needs to be implemented in VehicleFactory. However, dependent library for smart client is changing and that needs to be delivered to client everytime a change is made right........ Where as without vehicleFactory client.exe should be rebuild by changing all the dependent libraries. My question is in anycase client gets a new deliverable right....
@amitkrishna5004
@amitkrishna5004 2 жыл бұрын
Great Lecture
@palaktosh2256
@palaktosh2256 2 жыл бұрын
@keerti can you please create videos explaining all design patterns as i don't find many design patterns easy to learn and adapt content. btw great job, you nailed the content on your channel. I am software engineer and currently pursuing masters from ASU and preparing for interviews for SDE2 roles.
@palaktosh2256
@palaktosh2256 2 жыл бұрын
@keerti thank you for responding back and today I hold SD3 offer from Oracle and have started job previous week. Thank you for motivating and influencing Relevant content. Much love 😍
@arjundixit298
@arjundixit298 2 жыл бұрын
Amazing stuff!
@DurgaShiva7574
@DurgaShiva7574 2 жыл бұрын
thanks for this video. but.. whenever we make any changes in our factory class (say we add bus class), then we do need to recompile the whole factory class, as well as ask client to update the factory jar which they are using.. so is there any way to overcome this as well in this design pattern ??
@mrutunjaysingh4363
@mrutunjaysingh4363 2 жыл бұрын
You can use dynamic library (dll/.so files), I think that should work.
@nooneknows3287
@nooneknows3287 Жыл бұрын
I haven't found a link which point to code what we covered int this video, plz share code as well.
@amitgupta-or5nm
@amitgupta-or5nm 2 жыл бұрын
Awesome video keep making 🔥.
@kolakalapudinarasimhareddy5260
@kolakalapudinarasimhareddy5260 2 жыл бұрын
Thanks mam until I worked on cpp 98 version.now I started giving interviews.i faced questions on design patterns I don't how they work,how I want use in project ur videos help lot to understand concept and practical Thank u mam a lot please do videos mam
@himanshumathur9291
@himanshumathur9291 7 ай бұрын
a very beginner friendly video. Nice explanation. One question - why we are not using the vehicle.o in creating the library ? Thanks in advance.
@prasadmutnale773
@prasadmutnale773 2 жыл бұрын
Excellent explanation keep growing...
@whynesspower
@whynesspower 8 ай бұрын
Atleast 20 different concepts was discussed. Took me 2 hours to complete this tutorial
@subhashishsen6157
@subhashishsen6157 2 жыл бұрын
What Can I say...Just the one which I wanted..Simple..Crisp..Clear.A Big Thumps UP
@KeertiPurswani
@KeertiPurswani Жыл бұрын
Thank you so much! ❤️😇
@art4eigen93
@art4eigen93 Жыл бұрын
Which IDE you are using?
@rajendranm2204
@rajendranm2204 11 ай бұрын
Thanks for the videos
@enter.netinfinity6136
@enter.netinfinity6136 Жыл бұрын
i don't think it is the suitable ex for factory pattern otherwise what is state pattern ?
@suryamoymondal754
@suryamoymondal754 10 ай бұрын
Nicely explained .
@pratikshar1662
@pratikshar1662 16 күн бұрын
Why haven't we used vehicle.o while compiling the library?
@mayankrai7938
@mayankrai7938 2 жыл бұрын
Such a nice explanation 😌😌 Thank you
@KeertiPurswani
@KeertiPurswani 2 жыл бұрын
Yaaaay! Thank you so much❤️😇
@rosansenapati-pl5hr
@rosansenapati-pl5hr 10 ай бұрын
For your upcoming video please zoom into your code so that we can get a clear view of it .... Lots of love ❤️❤️ love your teaching and love your contents
@santoshs4393
@santoshs4393 Жыл бұрын
Thanks for the nice explaination. One query: In this pattern, whose responsibility is it to destroy the created vehicle object ?
@jivanmainali1742
@jivanmainali1742 10 ай бұрын
just a doubt ,is it not a violation of open closed principle ?
@user-ov6hn7qy1l
@user-ov6hn7qy1l 8 ай бұрын
Hi keerti, I seen this factory design pattern video in that you create factory for separation of vehicle type. We can do that in stored procedure pass car, bike,truck, bus and get only those record and get faster execution can you give one more real time example
@cphash
@cphash 2 жыл бұрын
I'm familiar with some design patterns like this, and hence, could follow everything properly. But thinking from a beginner's perspective, it could have been better :) Few observations: 1. The explanation was tightly coupled to C++. A person learning design patterns shouldn't have to start with the library creation approach, that too involving C++ commands. Those are extra details that can be picked up later, if needed. I feel like you could have gone with a more generic and simpler approach, especially since this is the "Simple Factory Pattern". 2. The video was kinda short. An in-depth explanation spanning half an hour would have been better. For instance, a comprehensive explanation could have been provided regarding the object creation approach, i.e., the reason behind doing Base B = new Child() instead of Child C = new Child() and its impacts since this acts as a prerequisite to understanding the factory approach.
@codegame6689
@codegame6689 2 жыл бұрын
Very nice observation and feedback 👍
@harshitsingh4767
@harshitsingh4767 2 жыл бұрын
I've used Factory design pattern once. I was wondering why we move the same if else logic into another class. Isn't it same.. But now it makes complete sense. We need to abstract the logic from the client code. Thanks !
@KeertiPurswani
@KeertiPurswani 2 жыл бұрын
Yaaaaay!! Thank you! 😇😇 Any constructive feedback? Rest of the tutorials should be like this only?
@harshitsingh4767
@harshitsingh4767 2 жыл бұрын
@@KeertiPurswani Sure, I liked that it does not have any complicated code examples. The intention was just to understand what problem it overcomes and makes our life easier as a developer. And yeah, rest of the tutorials can be like this !
@sandeepsihoria5230
@sandeepsihoria5230 Жыл бұрын
good explanation mam😊
@mugdhah7478
@mugdhah7478 Жыл бұрын
Best one !!
@nirmalyamisra
@nirmalyamisra Жыл бұрын
Thanks🙂
@MohitkumarBansal-hd6nx
@MohitkumarBansal-hd6nx Жыл бұрын
good Explanation
@tech_wizard9315
@tech_wizard9315 2 жыл бұрын
Please make a detailed video on how to make linkedin profile so strong that recruiters of tech giant's approach freshers (2020passouts) for job openings.
@shubhampokhriyal8491
@shubhampokhriyal8491 2 жыл бұрын
How many total videos will be there in this series??
@varunguptapy7176
@varunguptapy7176 2 ай бұрын
Please also made video for rest patterns mainly behavioral once like strategy pattern..
@rishabhgupta734
@rishabhgupta734 4 ай бұрын
I believe in the last code example the vehicle objects are actually getting created in the factory method getVehicle method. The name of the funtion in bike and car classes should be changed from create vehicle to something else.
@avinashboddu387
@avinashboddu387 2 жыл бұрын
Well explained!!! Looking forward for more videos on design patterns. It will be good if you improve the video quality more.
@ichbinshiv
@ichbinshiv Жыл бұрын
This is The Simple Factory pattern, not The Factory Design pattern. "The Simple Factory isn’t actually a Design Pattern; it’s more of a programming idiom." according to Head First Design Patterns. In addition, the use cases for the Simple Factory and Factory methods are not the same. The Factory method uses inheritance to provide a common framework; it does more than merely create objects.
@ravneetsingh2448
@ravneetsingh2448 2 жыл бұрын
Thanks
@poorvajas6600
@poorvajas6600 Жыл бұрын
Great explanation and a great series. Thanks for all the efforts. Why did you stop this series though :(
@KeertiPurswani
@KeertiPurswani Жыл бұрын
I know I am super late but never stopped, had a lot going on in personal life. Uploaded the new video today and hoping to finish the series super soon. Hope you like the video!
@Sachin-qn1wf
@Sachin-qn1wf 11 ай бұрын
But isn't it still breaking the OpenClose Principle of Design Pattern. because we still need to make change in factory code whenever new vehicle is added!!!
@MasumAhmed-fg8bc
@MasumAhmed-fg8bc 2 жыл бұрын
Few points needs to make clear. 1. Why that factory class is made static if not then what would happen? In real world scenrio is it done like this? 2. More examples related to real work. The content length is good. Keep that but make it more advanced with focusing on low level design. 👍
@TakamiWoodshop
@TakamiWoodshop 2 жыл бұрын
The factory class is _not_ static - that was clarified several times in the video. Only the getVehicle() method is static. If it was not, you would have to create an instance of the factory before you could use the getVehicle() method.
Singleton Design Pattern | Implementation with details & code ✌🏻
21:09
КАХА и Джин 2
00:36
К-Media
Рет қаралды 4,2 МЛН
New Gadgets! Bycycle 4.0 🚲 #shorts
00:14
BongBee Family
Рет қаралды 12 МЛН
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 122 МЛН
What is the Factory Pattern? | Software Design Principles
26:48
Be A Better Dev
Рет қаралды 27 М.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 175 М.
The Factory Pattern in Python // Separate Creation From Use
14:58
8 Design Patterns EVERY Developer Should Know
9:47
NeetCode
Рет қаралды 998 М.
the TRUTH about C++ (is it worth your time?)
3:17
Low Level Learning
Рет қаралды 596 М.
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,1 МЛН