Тёмный

Mediator Design Pattern In Action! - C# Design Pattern Tutorial 

Dev Leader
Подписаться 8 тыс.
Просмотров 3,3 тыс.
50% 1

In this video, we'll be exploring the mediator design pattern. This design pattern is used to manage communication between different objects. We'll navigate a small sample application using the mediator design pattern and C#.
If you're interested in learning more about design patterns or want to learn how to use C# to create powerful applications, this video is for you! By the end of this video, you'll have learned everything you need to know about the mediator design pattern and how to use it in your own projects.
Have you subscribed to my weekly newsletter yet? A 5-minute read every weekend, right to your inbox, so you can start your weekend learning off strong:
subscribe.devl...
Check out all of my courses:
devleader.ca/c...
Check out more Dev Leader content (including full in-depth articles with source code examples) here:
linktr.ee/devl...
Social Media:
Blog: www.devleader.ca/
Newsletter: www.devleader....
TikTok: / devleader
LinkedIn: / nickcosentino
Threads: threads.net/@dev.leader
Twitter: / devleaderca
Facebook: / devleaderca
Instagram: / dev.leader
GitHub: github.com/nco...
Twitch: / ncosentino
RU-vid: / @devleader
Affiliations & Products/Services That I Love:
VPS hosting from RackNerd: my.racknerd.co...
VPS hosting from Contabo: www.jdoqocy.co...
My newsletter platform ConverKit: convertkit.com...
My newsletter referral system SparkLoop: dash.sparkloop...
My AI shorts helper Opus Clip: opus.pro/?via=...
I try to help answer questions at Quora: www.quora.com/...
My favorite computer parts store Newegg: click.linksyne...
My favorite supplement store Bulk Supplements: glnk.io/63qn/d...
#softwareengineering #softwaredeveloper #designpattern #designpatterns

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 11   
@DevLeader
@DevLeader 10 месяцев назад
😲😲 My new course has launched! You can check out Refactoring for C# Devs on Dometrain: dometrain.com/course/from-zero-to-hero-refactoring-for-csharp-developers 📌 Remember to subscribe to my free weekly software engineering newsletter: subscribe.devleader.ca
@liangbinyu7620
@liangbinyu7620 Месяц назад
It would be perfect if you had tutorials regarding all design patterns,really look forward to watching all the high quality educational videos!
@DevLeader
@DevLeader Месяц назад
@@liangbinyu7620 I started off in that direction 😅 it's even on my whiteboard to get through more of them. Thanks for the feedback!
@bloggrammer
@bloggrammer 10 месяцев назад
Great content, Nick. I would first normalize the user Name property at 9:31
@DevLeader
@DevLeader 10 месяцев назад
Thanks so much! And you're right - the user name thing was a bit of a gotcha moment when I was recording this thinking I might not have planned to cover that well enough. Poor planning on my part 😕
@EminoMeneko
@EminoMeneko 8 месяцев назад
Thanks. That was interesting.
@DevLeader
@DevLeader 8 месяцев назад
Glad that you enjoyed it!
@VishnuPriya-ng6wk
@VishnuPriya-ng6wk 10 месяцев назад
Why should ChatUser have an instance of mediator? why cant it be a static class?
@DevLeader
@DevLeader 10 месяцев назад
This is a great question. In fact, it absolutely could be static. However - You'll find in nearly all of the content I produce that I don't show usage of static classes. Some exceptions are utility or extension methods, or in mostly edge cases where composition doesn't work. The reason I avoid them, in general, is to help support testability. In this simple example we could certainly get away with it. I don't have a strong argument here. However, if our classes were slightly more complex and you wanted to start writing tests on them, static classes make this a total pain in the butt. They're shared across the entire runtime of the app/tests, and if they have state that can be mutated it's game over. If they interact with external systems, you have no choice but to interact with those systems (no mocking or otherwise intercepting in tests). I hope that helps explain why I generally won't do that (but you're certainly correct that it would be functional).
@VishnuPriya-ng6wk
@VishnuPriya-ng6wk 10 месяцев назад
@@DevLeader , thanks for the reply. Why are static classes hard to test? In other words, how making them non static helps with mocking?
@DevLeader
@DevLeader 10 месяцев назад
@@VishnuPriya-ng6wk when they are normal classes with interfaces we can use mocking frameworks. The mock only needs to meet the interface and not the concrete class, and since static classes cannot have interfaces you don't get this luxury. Static classes make things more challenging to test based on how complex they are. If you have simple methods, truly it's not very difficult. But if you are executing a lot of code in a static method, consider that anyone trying to write a unit test will not have *any* control over that static method. They need to have everything set up properly for the static code to execute properly It can get so complex that it makes writing unit tests difficult, or brittle/flakey when running in parallel. It's not to say they cannot be used, but I've seen too many instances where they cause a ton of headaches. I design to not use them, and when I do, they're very lightweight 🙂
Далее
Women’s Celebrations + Men’s 😮‍💨
00:20
C# Proxy Заместитель | Design Patterns
28:51
The State Design Pattern in Python Explained
19:14
Просмотров 76 тыс.
Mediator Pattern - Reduce Chaotic Dependencies
15:47
Getting Started with Event Sourcing in .NET
37:07
Просмотров 56 тыс.
Intro to MediatR - Implementing CQRS and Mediator Patterns
1:21:50
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Forget Controllers and Minimal APIs in .NET!
14:07
Просмотров 70 тыс.
Premature Optimization
12:39
Просмотров 815 тыс.
The params Keyword is Finally Fixed in C# 13!
11:15
Просмотров 50 тыс.