you can improve it a bit by returning the instance in each build function. this way it's possible to chain calls: desktopBuilder->buildX->buildY->buildZ->getDesktop()
Actually thats an essential part of builder pattern in functional programming. That way we can create a “chain” for object generation through deserialisation.
@@anubhavanand2432I suppose without a builder pattern we have to call Object.setProperty1() Object.setProperty2() But with a builder pattern we can do that in chaining, like one after the other. I think it's more readable like this, not sure if I'm right though.
Great Video. One improvement we can make here is to encourage immutability by avoiding setters on the actual object. The intent is to allow an object to be modified during its creation phase, but avoid modifying it once created!
Inplace of just directly explain what is builder class u can explain what would be the problem we face if we don't use it. Then it ll give better understanding of it. Over all it is a good video 👍
Hi ,can't we use factory pattern in this? since we need to create two different object i.e dell desktop and hp desktop? This is like creating object on the basis of some condition.Means if user passes dell we will create dell desktop ,if he passes hp so create hp desktop?
Doesn't this pattern solve a similar problem for which we used the factory pattern? For every new type of desktop we have to create new files and separate methods for building components. Do people actually use this? I feel it must be used in combination with the factory design pattern to handle the creation of different parts.
Why can we not create 2 derived class directly from desktop (HP and Dell)? That would allow us to customise the building process. What is the rationale behind creating a builder class separately?
help me out for this question. Assume you are developing an API for a blogging platform using Node.js, Nestjs and GraphQL. The API has features like creating a new blog post, fetching all posts by a user, fetching single post details etc. One of the challenging requirements is to implement full text search functionality on blog posts i.e.. users should be able to search for specific keywords in the entire content of all blog posts. Given that MongoDB is your primary database, provide a detailed solution on how would you implement this requirement. Your answer should include steps from indexing data in MongoDB for text-based search to querying it using GraphQL.
While building the object, can we have the DB calls to save the object parts into multiple tables? Because if we write the DB insertion code in the main code where director gives the final object, we may have to iterate object again
Wondering why we need additional BuildDirector class?We can use only Builder and ConcreteBuilder class right..Because the core interface definition and implementation is present in these 2..
I've been doing coding for 30 years, and can't understand the use of design patterns. I am lone developer. Only a few times I had to put pen to paper to help visual then code complex ideas, but I mostly start coding after hearing a concept.
Thanks for doing this in C++ . I am crawling the internet for LLD course with C++ so that I can prepare for system design round . Do you know any learning path for system design High level ( I have bought grokking the system design interview from educative.io ) and for low level design. Your videos are surely helping a lot 🌼🌱💚
While I understood the design pattern , I am having a bit of hard time in grasping where this should be used , as we could have used multiple constructors , and also even while using this pattern if the individual parts like cpu, monitor etc requires any arguments that anyway we'll need to pass , only thing is that the order of the arguments might not matter.
Hey, can you plz make one video on walmart codehers? Last year also I had applied but couldn't make it . Need ur proper guidance for this as walmart is my dream company😍 Plz help me get this job🙏🏻
Please provide 4-5 good resume template for freshers to apply for tech giant's like Microsoft linkedin level companies etc🙏🏻🙏🏻,i requested 2-3times but hasn't been uploaded 😅 just a request keerti 😇
I see this as tomato TOMAATO....nothing more than a facade for client...similar things when used in different context have different name...I don't understand why have people made so many "different" DPs
The main function should look like this. If you don't want to delete, just create your objects on stack like, LenovoDesktopBuilder objLenovoDesktopBuilder; then call DesktopDirector Director1(&objLenovoDesktopBuilder). int main() { HpDesktopBuilder* pHpDesktopBuilder = new HpDesktopBuilder; DesktopDirector* pDirector1 = new DesktopDirector(pHpDesktopBuilder); Desktop* pDesktop1 = pDirector1->BuildDesktop(); pDesktop1->showSpecs(); delete pHpDesktopBuilder; delete pDirector1; DellDesktopBuilder* pDellDesktopBuilder = new DellDesktopBuilder; DesktopDirector* pDirector2 = new DesktopDirector(pDellDesktopBuilder); Desktop* pDesktop2 = pDirector2->BuildDesktop(); pDesktop2->showSpecs(); delete pDellDesktopBuilder; delete pDirector2; return 0; }
you can improve it a bit by returning the instance in each build function. this way it's possible to chain calls: desktopBuilder->buildX->buildY->buildZ->getDesktop()
Actually thats an essential part of builder pattern in functional programming. That way we can create a “chain” for object generation through deserialisation.
I have one question, why do we need builder if we have setters for all attributes in java class?
@@anubhavanand2432I suppose without a builder pattern we have to call
Object.setProperty1()
Object.setProperty2()
But with a builder pattern we can do that in chaining, like one after the other.
I think it's more readable like this, not sure if I'm right though.
Great Video. One improvement we can make here is to encourage immutability by avoiding setters on the actual object. The intent is to allow an object to be modified during its creation phase, but avoid modifying it once created!
Inplace of just directly explain what is builder class u can explain what would be the problem we face if we don't use it. Then it ll give better understanding of it. Over all it is a good video 👍
Hi ,can't we use factory pattern in this? since we need to create two different object i.e dell desktop and hp desktop?
This is like creating object on the basis of some condition.Means if user passes dell we will create dell desktop ,if he passes hp so create hp desktop?
Hi, Please expand your series with other design pattern, there is a more than 7 design pattern. It would be grate if you do this for us.
Really helpful, please continue the series!
Really Helpful video, Please keep posting series for patterns.
Doesn't this pattern solve a similar problem for which we used the factory pattern? For every new type of desktop we have to create new files and separate methods for building components. Do people actually use this? I feel it must be used in combination with the factory design pattern to handle the creation of different parts.
Builder pattern definition:
Taking a simple task, making it complex, so that you as a developer can become obsolete quickly.
Why can we not create 2 derived class directly from desktop (HP and Dell)? That would allow us to customise the building process. What is the rationale behind creating a builder class separately?
Thank you for the videos. Can you please upload your codes in GIT and provide the accesss to play around the code for better understanding.
Great video Please continue the Series.It was very helpful
Thanks Keerti , A very good video on Builder pattern .
These vids i am ready to pay for !!!
can you please share the code path of all of your coding.
help me out for this question.
Assume you are developing an API for a blogging platform using Node.js, Nestjs and GraphQL. The API has features like creating a new blog post, fetching all posts by a user, fetching single post details etc.
One of the challenging requirements is to implement full text search functionality on blog posts i.e.. users should be able to search for specific keywords in the entire content of all blog posts.
Given that MongoDB is your primary database, provide a detailed solution on how would you implement this requirement. Your answer should include steps from indexing data in MongoDB for text-based search to querying it using GraphQL.
Thank You Keerti for this video, it is really helpful
Thanks. It was very helpful
While building the object, can we have the DB calls to save the object parts into multiple tables? Because if we write the DB insertion code in the main code where director gives the final object, we may have to iterate object again
Wondering why we need additional BuildDirector class?We can use only Builder and ConcreteBuilder class right..Because the core interface definition and implementation is present in these 2..
Same here.
Very good presentation madam thanks
One request, if you can kindly add equivalent code for JAVA too, especially for design pattern videos. It will help a lot. As usual, great video.
Thank You!
I've been doing coding for 30 years, and can't understand the use of design patterns. I am lone developer. Only a few times I had to put pen to paper to help visual then code complex ideas, but I mostly start coding after hearing a concept.
Nice Explaination🔥🔥
Awesome explanation
Hi, Thanks for this nice video, May I know, which tool do you use used for video editing, recording or PPT design?
Hi Keerti , please upload structural and behavioral patterns also
Thanks for doing this in C++ . I am crawling the internet for LLD course with C++ so that I can prepare for system design round . Do you know any learning path for system design High level ( I have bought grokking the system design interview from educative.io ) and for low level design. Your videos are surely helping a lot 🌼🌱💚
Thanks a lot! Please increase video frequency.
Nice, Can give an example of a real case scenario at the end.
Bit coomplicated to understand during 19:10 time frame because of different actors having different data.
Your voice is very attractive
Put the code in a repo and please share it as well. Helps. Thanks..
While I understood the design pattern , I am having a bit of hard time in grasping where this should be used , as we could have used multiple constructors , and also even while using this pattern if the individual parts like cpu, monitor etc requires any arguments that anyway we'll need to pass , only thing is that the order of the arguments might not matter.
Hey why do you left intuit ???
When that happened?
@@kx01 check her linkedin
you forgot to tell about creating singleton object using enum and inner class
Hey, can you plz make one video on walmart codehers?
Last year also I had applied but couldn't make it . Need ur proper guidance for this as walmart is my dream company😍
Plz help me get this job🙏🏻
Ye sab toh College may nhi padate hai , pakka didi ne course se sikha hoga , lekin batayegi nhi konse course se sikha hy , direct padayenge 😕
Please provide 4-5 good resume template for freshers to apply for tech giant's like Microsoft linkedin level companies etc🙏🏻🙏🏻,i requested 2-3times but hasn't been uploaded 😅 just a request keerti 😇
I am sorry for the delay, will do this soon for sure!
I see this as tomato TOMAATO....nothing more than a facade for client...similar things when used in different context have different name...I don't understand why have people made so many "different" DPs
The main function should look like this. If you don't want to delete, just create your objects on stack like, LenovoDesktopBuilder objLenovoDesktopBuilder; then call DesktopDirector Director1(&objLenovoDesktopBuilder).
int main() {
HpDesktopBuilder* pHpDesktopBuilder = new HpDesktopBuilder;
DesktopDirector* pDirector1 = new DesktopDirector(pHpDesktopBuilder);
Desktop* pDesktop1 = pDirector1->BuildDesktop();
pDesktop1->showSpecs();
delete pHpDesktopBuilder;
delete pDirector1;
DellDesktopBuilder* pDellDesktopBuilder = new DellDesktopBuilder;
DesktopDirector* pDirector2 = new DesktopDirector(pDellDesktopBuilder);
Desktop* pDesktop2 = pDirector2->BuildDesktop();
pDesktop2->showSpecs();
delete pDellDesktopBuilder;
delete pDirector2;
return 0;
}