Это видео недоступно.
Сожалеем об этом.
JavaScript Design Patterns #10 - Builder Pattern
HTML-код
- Опубликовано: 7 июн 2022
- The builder design pattern is a creational pattern that enables you to construct complex objects simply and more declaratively.
📚 Materials/References:
"Design Patterns Explained Simply" Ebook: payhip.com/b/MLtJ
🌎 Find Me Here:
Twitter: / realdevsage
Ebooks: payhip.com/devsage
Discord: / discord
Merch: cottonbureau.com/people/devsage
📕 "Design Patterns Explained Simply" Ebook: payhip.com/b/MLtJ
💙 Twitter: twitter.com/realDevSage
📙 Ebooks: payhip.com/devsage
💥 Discord: discord.gg/BP8wPv6raA
Very very awesome demonstration, straight to the point.thank you so much.
I'm learning so much from your channel. I love the clear direct way you teach. I studied design patterns for awhile, and it never really clicked. You give a good clear use case that is easily understandable.
Glad you're able to find value!
Thanks Patrick,
This is the easiest ever explanation
so clearly ,thanks!
could we have done all the getter and build methods directly on the Person function itself?
📑Homework Challenge: See if you can implement this builder pattern using classes!
I am watching this Under 51°c (123.8F) my brain almost boiled, I got this lesson very well and yes I understood all of it 🥵
Thanks
No problem
Another excellent vid! Thanks so much! Do you have any content on Udemy?
Thank you Kerry. I don't have any courses specifically on Udemy. But I do have one course out there about how to recreate React.js from scratch:
buildreactjs.io
Is there a reason why you can't just pass an object into your Person constructor like so?: let devsage = new Person({ name: "devsage", gender: "male" , height: 100, weight: 20 })?
And then inside Person(option) this.weight = option.weight etc.
I wonder what's like a very good reason not to do this since I do this often in my own code.
what theme are you using?
I think it's Synthwave '84
Is design pattern a must to implement?
No you don't *have* to use a design pattern in your code if it doesn't make sense. But they are helpful tools to help you get around common problems.
If you would have to go out of your way to use a design pattern in your code, you probably shouldn't use one. Patterns should make your job easier, not harder