Builder Design Pattern (An Introduction for .NET Developers [.NET 5 and C#])

  Рет қаралды 11,219

DotNet Core Central

DotNet Core Central

Күн бұрын

In this video, I am going to walk through the Builder Design Pattern. It is an Introduction video for .NET Developers [.NET 5 and C#].
The Builder design pattern is one of the creational design patterns. This pattern is not very common but very used in scenarios where the creation of an object can become complex.
The previous two videos in this Design Pattern series are:
1. Factory method design pattern: • Factory Method Design ...
2. Abstract factory design pattern: • Abstract Factory Desig...
00:06 - Explaining what is Builder pattern
00:45 - Traditional way for an object creating using a constructor
01:55 - Introduction of the builder class
02:35 - Defining an interface
04:08 - Implementation of the builder class
07:12 - Using builder pattern to register the object in dependency injection container
08:40 - A daily used example of the builder pattern
My blog URL: dotnetcorecentral.com/
My KZbin channel URL: / dotnetcorecentral
My GitHub repo URL: github.com/choudhurynirjhar

Пікірлер: 22
@rajneesh19852
@rajneesh19852 3 ай бұрын
It's a layman explanation. Thanks for sharing
@seyhmusozbek
@seyhmusozbek Жыл бұрын
that was the simplest and clearest explanation of the pattern. good job.
@DotNetCoreCentral
@DotNetCoreCentral Жыл бұрын
Thanks
@shivaganga9148
@shivaganga9148 3 ай бұрын
Simple explanation thanks
@DotNetCoreCentral
@DotNetCoreCentral 3 ай бұрын
You are welcome
@MrChuyelChief
@MrChuyelChief Жыл бұрын
All clear, thanks so much for you excellent explain
@DotNetCoreCentral
@DotNetCoreCentral Жыл бұрын
Thanks
@pawansarwal9507
@pawansarwal9507 8 ай бұрын
How to set address if in case Address is a separate class means address field of User is of type Address. Address class may have fields like StreetNumber, Street, City etc.
@williamliu8985
@williamliu8985 2 жыл бұрын
Thanks! That`s simple and easy to understand! One more question, can I use the "init accessor" from C#9 instead if I want the immutable properties?
@DotNetCoreCentral
@DotNetCoreCentral 2 жыл бұрын
@William Liu, I guess you can use init for creating an immutable property. I am not 100% sure how it will work in this scenario, I will have to try it out and see.
@mahendranchinnaiah7593
@mahendranchinnaiah7593 2 жыл бұрын
Thanks much. It would be helpful If you starts the session for Azure or CI/CD pipeline integration...
@DotNetCoreCentral
@DotNetCoreCentral 2 жыл бұрын
@Mahendran Chinnaiah, thanks for watching! I will definitely start on Azure in the coming week.
@zxph
@zxph 8 ай бұрын
This was a good intro, but I believe creating the user object in the builder constructor was a mistake. Better to create the user object in the build function, that way you don't have to list all the user properties twice in the builder, and you can keep private setters in the user class itself.
@paulofernandoee
@paulofernandoee 2 жыл бұрын
Nice vídeo!
@DotNetCoreCentral
@DotNetCoreCentral 2 жыл бұрын
Thanks!
@twitchdude55
@twitchdude55 Жыл бұрын
just create a interface for the builder and use register it in the ICO not the class itself, so you can use the class in the client or in the api to get the values or assign them in the api not in the registration
@AliRaza-zy1zk
@AliRaza-zy1zk 5 ай бұрын
Sometimes it look some patterns are over complex with no reason to use
@xxXAsuraXxx
@xxXAsuraXxx Жыл бұрын
Nice one, can you show how to do async builder with Task?
@DotNetCoreCentral
@DotNetCoreCentral Жыл бұрын
Thanks for watching! Sure I will do that.
@kacperk648
@kacperk648 2 жыл бұрын
"services.AddSingleton" what it is?
@DotNetCoreCentral
@DotNetCoreCentral 2 жыл бұрын
This is for adding service into dependency injection container
@user-ge2vc3rl1n
@user-ge2vc3rl1n Жыл бұрын
I think this is part of the dotnet web api start up project. Checkout dotnet web apis and checkout singleton pattern.
C# REPL (Read-Eval-Print Loop) [An Introduction for .NET Developers]
12:19
DotNet Core Central
Рет қаралды 2,4 М.
Decorator Design Pattern (An Introduction for .NET Developers [.NET 5 and C#])
12:36
SHE WANTED CHIPS, BUT SHE GOT CARROTS 🤣🥕
00:19
OKUNJATA
Рет қаралды 14 МЛН
¡Puaj! No comas piruleta sucia, usa un gadget 😱 #herramienta
00:30
JOON Spanish
Рет қаралды 22 МЛН
Reactive Extensions [An Introduction for .NET Developers]
20:13
DotNet Core Central
Рет қаралды 12 М.
Adapter Design Pattern (An Introduction for .NET Developers [.NET 5 and C#])
12:07
Builder Pattern - Design Patterns
10:49
Web Dev Simplified
Рет қаралды 133 М.
SOLID Design Principles (An Introduction for .NET Developers)
19:51
DotNet Core Central
Рет қаралды 44 М.
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,1 МЛН
Abstract Factory Pattern Made Simple in C#
25:04
campbelltech
Рет қаралды 1,9 М.
Как я сделал домашний кинотеатр
0:41
RICARDO
Рет қаралды 1,5 МЛН
🤔Почему Samsung ПОМОГАЕТ Apple?
0:48
Technodeus
Рет қаралды 458 М.
👎Главный МИНУС планшета Apple🍏
0:29
Demin's Lounge
Рет қаралды 489 М.
iphone fold ? #spongebob #spongebobsquarepants
0:15
Si pamer 😏
Рет қаралды 129 М.