Master the Builder Pattern: The King of Creational Design Patterns in C# | ASP.NET Core Tutorial

preview_player
Показать описание
Ever wondered how to handle the complex rules that govern the creation of a large object in your C# code? This detailed tutorial on the Builder Pattern in C# is here to guide you! Unlock the power of design patterns in software engineering as we delve deep into a realistic ASP.NET Core application scenario.
We explore the encapsulation of complex object creation processes and learn to achieve immutable objects through fluent interfaces. Understand the differences between Builder and Factory patterns as we walk through examples of the Builder Pattern, including how to implement a Builder Interface.
In this tutorial, we also touch upon the nuances of parameterized constructors and the construction process in the context of object creation. By the end, you'll be well-equipped to unleash the Builder, the king of Creational Design Patterns!

⌚ 00:00 Introduction to the Builder pattern
⌚ 00:56 About the demo ASP.NET Core application
⌚ 04:14 Defining the customer's requirements
⌚ 05:47 Designing the Builder's public interface
⌚ 09:53 Implementing the entire Builder
⌚ 14:52 Demonstrating the Builder in action
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

⭐ Learn more from video courses:

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⚡️ Have a look at our other Videos :

#zoranhorvat
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⭐ CONNECT WITH ME 📱👨

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

👨 About Me 👨
Hi, I’m Zoran, I have over 20 years of experience as a software developer, architect, team lead, and more. I have been programming in C# since its inception in the early 2000s. Since 2017 I have started publishing professional video courses at Pluralsight and Udemy and by this point, there are over 100 hours of the highest-quality videos you can watch on those platforms. On my YouTube channel, you can find shorter video forms focused on clarifying practical issues in coding, design, and architecture of .NET applications.❤️
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⚡️RIGHT NOTICE:
The United States Copyright Laws recognize a “fair use” of copyrighted content. Section 107 of the U.S. Copyright Act states: “Notwithstanding the provisions of sections 106 and 106A, the fair use of a copyrighted work, including such use by reproduction in copies or phono records or by any other means specified by that section, for purposes such as criticism, comment, news reporting, teaching (including multiple copies for classroom use), scholarship, or research, is not an infringement of copyright." This video and our youtube channel, in general, may contain certain copyrighted works that were not specifically authorized to be used by the copyright holder(s), but which we believe in good faith are protected by federal law and the Fair use doctrine for one or more of the reasons noted above.

#csharp #designpatterns #dotnet
Рекомендации по теме
Комментарии
Автор

Programming magic is one of the reasons I LOVE this field. It's a beautiful thing when a library or piece of software works in a magical way and makes the other developers think about how it was achieved. Puzzles everywhere!

thehuggz-ik
Автор

I have to say this pattern was one of the most complex for me to understand and I'm still struggling in knowing when and how to develop it in my own in the correct way. This a good example, complex though.. thanks for sharing

paultumbaco
Автор

It is amazing how, by using the right patterns and techniques, we can hide the complexity of the domain and show only the "intention revealing expression" (I loved this sentence) to the consumer. Thanks for sharing!

kristianaranda
Автор

Great Lesson! I always learn something new with all your video sir. Thanks.

danielnababan
Автор

Thank you Zoran for such good, real-world example

thegaribovv
Автор

Keep up the good work. Very nice explanation with real world example.

payman
Автор

Excellent video! And yes, this is a very complex example. It fits really great for scenarios like this one.

vamvdotnet
Автор

Excellent I would like to see how you do your strategy pattern and adapter pattern

sunnypatel
Автор

This is great content. Can we have the link to the full course showing how all the implemetations of the BOOK STORE app.

abdullahishuru
Автор

Thank you for the great video! What if we need to guide the users of the builder on which method they can use next? For instance if builder has mandatory steps or one steps can be called only after others? I guess we can introduce different interfaces and return them after each operation. Maybe you can share what could be the better way of implementing such complex builder?

seriyezh
Автор

Hi Zoran, I've noticed that Pluralsight have marked some of your Tactical Design Patterns courses and your "Making Your C# 6 Code More Object-oriented" course as retired. Would you still recommend watching these courses to somebody who have not gone through these before?

superpcstation
Автор

I am learning from your fluidity with LINQ and your skill in highlighting best use of design patterns. I started writing software in the 80-90's in pursuit of scientific knowledge. That is my only turn-off about your presentations - they represent capitalism, with "customer's requirements" and the need to profit. I may be idealistic, but I would love to see examples from the scientific domain, where the code more often needs to discern patterns, not apply policies.

kenbrady
Автор

Seems the builder is capturing domain concepts that belong to the invoice. The invoice itself is anaemic. How about capturing rules in the model itself and then a printer decoration object knows how to produce the output. Thoughts?

vatreni
Автор

This is a great example for encapsulating the extremely complex logic to make life easier for a caller. I have a question for this solution though. How would you unit test this? For example, AppendFee, AppendInterest and GetInterest for are complex enough on their own to have unit tests for each of them separately. But since they're private, you can't reach them from the tests (unless you make them internal and make internals visible in test project or public, but that brings up some red flags in design, so I don't think it's a good approach). You can test the builder as a whole, but since you call in Build method, it would not really be trivial to know why some test failed - is it the fee calculation that's wrong or interest calculation? Or maybe both? Or maybe neither? Thanks in advance.

ms
Автор

I've used the builder method a couple times in the past, but instead of returning "this" I would return an Interface with the appropriate "next" steps exposed.

DevMeloy
Автор

@zoran-horvat Isn't this just a "Fluent Interface" implementation and not actual Builder pattern?

nalinsharma
Автор

Are you spying on me? I just used this pattern today.

Pasukaru
visit shbcf.ru