Builder Pattern Example in C#

  Рет қаралды 17,448

Wes Doyle

Wes Doyle

Күн бұрын

Пікірлер: 43
@rogerr4469
@rogerr4469 10 ай бұрын
Nice nice. I like the fluent builder example, it really makes it easy for developers to understand someone else's code.
@flockomotion
@flockomotion 2 жыл бұрын
"Clean code should read like prose." - your fluent builder really expresses this ideal!
@dgodiegomartins
@dgodiegomartins 3 жыл бұрын
Great content. One question. Why are you returning the FluentPOBuilder instead return the interface IPurchaseOrderBuilder ?
@inkofthedragon
@inkofthedragon Жыл бұрын
Do you think the Builder Pattern could be an effective way to build different kinds of AiControllers with different behaviours/states and abilities, say for an Orc, Goblin, Troll, etc? Thanks
@Hardtakk
@Hardtakk 5 жыл бұрын
Thank you so much! I suddenly got a Builder Pattern at me in a project without ever having seen one before and this really helped me understand the basic idea.
@bravoelliot
@bravoelliot 6 жыл бұрын
Excellent video
@mozamilahmadafghan4889
@mozamilahmadafghan4889 2 жыл бұрын
The link for the Github Code is dead.
@abhijeetsingh1939
@abhijeetsingh1939 7 жыл бұрын
Great tutorial Wes! Keep more coming! Namaste from India!
@Over9000Nine
@Over9000Nine 4 жыл бұрын
Hey man, thank you for your video, great explanation. I have one question: What if, for one bread supplies PO you do not want to add Requested By. In your current implementation the director class always calls builder.AddRequestedBy(). What is the best way to manage such a case? I know my question is kinda late but I hope you see it. Thanks!
@WesDoyle
@WesDoyle 4 жыл бұрын
Good question. This so-called "Director" class provides an additional layer of abstraction for us to define ways of constructing our order. So, if you wanted to execute a different chain of events, you could create a separate method to do that in the same class, like ConstructForX. Just an idea, haven't thought about it much!
@Over9000Nine
@Over9000Nine 4 жыл бұрын
@@WesDoyle Thank you :)
@jemmett8885
@jemmett8885 5 жыл бұрын
Is that a theme making his font colour and style that way?
@Mhblabla
@Mhblabla 6 жыл бұрын
How does this compare versus the fluent methods being on the class we are producing itself? For instance like in the accepted answer in this SO question: stackoverflow.com/questions/1794848/writing-my-first-dsl-in-c-sharp-and-getting-hung-up-on-funct-action The issue I have with the described way of doing things in this video is that you end up with duplicate code in the builder and in the class the builder is producing (for example, all of the properties are being repeated in the builder class (albeit being replaced with fields).
@mrclaytron
@mrclaytron 7 жыл бұрын
Nice one Wes!
@refreshious
@refreshious 7 жыл бұрын
You going to go through all the GoF patterns?
@WesDoyle
@WesDoyle 7 жыл бұрын
+Kinman Li perhaps eventually. That would be an interesting project.
@luistc1721
@luistc1721 7 жыл бұрын
what style do you use for visual studio ?
@WesDoyle
@WesDoyle 7 жыл бұрын
+Luis TC check out my dotfiles on my github, I've exported my vs settings. github.com/wesdoyle
@luistc1721
@luistc1721 7 жыл бұрын
Wes Doyle thanks .. excellent tutorial
@luistc1721
@luistc1721 7 жыл бұрын
Wes Doyle Greetings from Peru
@WesDoyle
@WesDoyle 7 жыл бұрын
Thanks for watching! All the best to you!
@nesekaramanler914
@nesekaramanler914 5 жыл бұрын
@@WesDoyle style ok but font is different :(
@lyalin
@lyalin 6 жыл бұрын
Great video!
@Ohlawdie
@Ohlawdie 7 жыл бұрын
Hey Wes, I couldn't help but notice the color settings for your code! How'd you get your '=" sign to be red?
@WesDoyle
@WesDoyle 7 жыл бұрын
Hey Evan, thanks for the message. Tools > Options > Fonts and Colors > Operator, I believe. My vssettings file is available on my GitHub!
@Ohlawdie
@Ohlawdie 7 жыл бұрын
Awesome, thanks!
@mrdiv8418
@mrdiv8418 7 жыл бұрын
Thank you! This 5FRI format is great. Concise and informative. I would love to see more videos regarding Gang of Four Design Patterns. May be even separate playlist or series. This topic is very confusing for newbies like I'm myself.
@WesDoyle
@WesDoyle 7 жыл бұрын
Thanks, Greg - I'll definitely have to put that together!
@augis1393
@augis1393 7 жыл бұрын
Hey Wes, what do you think how many languages does developer needs to know these days? It seems like you are familiar with quite a few. Cheers for great tutorials!!!
@WesDoyle
@WesDoyle 7 жыл бұрын
Hi Augustinas - I believe it really depends on your goal. As a default answer, in terms of coding for employment, I would say that it's 'good enough' to be proficient with a single popular language. It's perhaps more important to know how to get things done in your area of interest - and from there, learning about best practices in software development more generally. That said, I find it enjoyable to explore different languages and paradigms. One of the great things about learning one language well is that it helps you pick up concepts in subsequent languages more quickly. I think it's a great idea to pick a second or third language that works completely differently than the language you're most proficient with - for example, if you use Java regularly, explore Haskell. If you use Javascript, take Go for a spin, etc.
@augis1393
@augis1393 7 жыл бұрын
Thank you for a great answer!
@dotnet-azure
@dotnet-azure 3 жыл бұрын
github repo doesn't work
@kevinmarkandrada
@kevinmarkandrada 6 жыл бұрын
SOLID Principles + Enterprise Architecture + MVC Pattern + .NET Core + Web API + Vue.js + C# in One Project PLEASE! From Philippines! Nice Vlogs and Tutorials! God bless
@rockingdude8383
@rockingdude8383 5 жыл бұрын
github repo is broken link
@TheAceInfinity
@TheAceInfinity 6 жыл бұрын
Builder pattern and factory are both very useful.
@WesDoyle
@WesDoyle 6 жыл бұрын
Definitely!
@soccerfinatic234
@soccerfinatic234 2 жыл бұрын
github doesnt work for this :(
@hovadopekelne
@hovadopekelne 5 жыл бұрын
... silverface, good choice ...
@OghamTheBold
@OghamTheBold 5 жыл бұрын
*I.O.U* ( Implicit Operator _Useful_ )
@rahmatabadi3839
@rahmatabadi3839 5 жыл бұрын
Your example is too complicated so it will take unnecessary time to decipher your scenario. It will be better to choose a simple scenario so we don't need to decipher unnecessary parts. Reduces the number of properties as minimal as possible and use simple method names as well.
@ferreiradev
@ferreiradev 5 жыл бұрын
For easy scenarios, check out the Head First Design Patterns. It is rare to find well implemented demonstrations for complex usage of Builder patttern
Builder Design Pattern (C#)
12:05
Raw Coding
Рет қаралды 39 М.
Don't throw exceptions in C#. Do this instead
18:13
Nick Chapsas
Рет қаралды 265 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Builder Pattern - Design Patterns
10:49
Web Dev Simplified
Рет қаралды 139 М.
Factory Method Design Pattern
26:55
Wes Doyle
Рет қаралды 16 М.
How to use the Builder Pattern in Java - 035
6:01
Deege
Рет қаралды 41 М.
Builder Pattern - DESIGN PATTERNS (C#/.NET)
7:52
SingletonSean
Рет қаралды 7 М.
Top 10 C# Best Practices (plus bonuses)
57:28
IAmTimCorey
Рет қаралды 513 М.
Change your habits: Modern techniques for modern C# - Bill Wagner
55:46
NDC Conferences
Рет қаралды 252 М.
How to structure a .NET Solution (project separation & architecture)
13:55
Repository Pattern with C# and Entity Framework, Done Right | Mosh
26:24
Programming with Mosh
Рет қаралды 877 М.