Тёмный

The Design Pattern Everyone MUST Know! 

Gui Ferreira
Подписаться 13 тыс.
Просмотров 3,9 тыс.
50% 1

How to refactor C# .NET Code using the Strategy Design Pattern.
💎 Be a Patreon to get the source code: / gsferreira
🚨 KEY LINKS
🤝 Support me on Patreon (and get access to source code) here: / gsferreira
👋 HEY FRIEND
If you're new to my Channel, my name is Guilherme, but you can call me Gui if Portuguese pronunciation is not your thing.
I see myself as a Minimalist Software Craftsman. That says a lot of what I talk about here.
So, why this RU-vid channel? To share with you to simplify your life as a Developer through knowledge, technology, and practices.
If you are into those things as I do, don't forget to subscribe for new videos.
🔗 GET IN TOUCH
LinkedIn: / gferreira
Twitter: / gsferreira
GitHub: github.com/gsf...
Visit my blog: gsferreira.com
#dotnet #csharp

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

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 19   
@TayyabMughalDIK
@TayyabMughalDIK 11 месяцев назад
Excellent. I often prefer this design pattern because with the help of DI, you can have multiple background running hander with one interface deciding relevant handler to be executed on runtime.
@RawCoding
@RawCoding Год назад
1st! Strategy Pattern is the best! Really good video 🎉
@gui.ferreira
@gui.ferreira Год назад
Thanks, Anton! Indeed, it's a handy tool.
@draqula004
@draqula004 Год назад
I was really looking forward to seeing the other method you described. Could you do a part 2 of this and include how that should work?
@gui.ferreira
@gui.ferreira Год назад
Michael, can you point me to the video minute where I mention that? I'm not sure which method you are mentioning.
@nunofilipecosta
@nunofilipecosta Год назад
Hi 👋, I think it's worth mentioning that it's a great way to adhere to the open-closed principle (open for extension but closed for modification). Adding more strategies without changing too much code.
@nunofilipecosta
@nunofilipecosta Год назад
Great video! Thanks for sharing!
@gui.ferreira
@gui.ferreira Год назад
Thanks, Nuno! Glad you liked it. And thanks for adding that. You are absolutely correct.
@shoooozzzz
@shoooozzzz Год назад
Good start to the refactor, but you still have a nasty `switch` statement. Every time you add a new way to traverse a route, you have to add to the switch. To take the refactor one more step, you could use the mediator pattern with MediaR and have handlers for each type.
@gui.ferreira
@gui.ferreira Год назад
That's a good point. However, we can avoid the use of MediatR and dynamically discover the type. I have done it sometimes with DI and hash tables (as an example).
@AboutCleanCode
@AboutCleanCode Год назад
Good video on the topic 👍but if you zoom that close to the code it gets harder to read from my perspective
@gui.ferreira
@gui.ferreira Год назад
Thank you! That's useful feedback. May I ask you if you watch it on a laptop/desktop or mobile?
@enverusta7811
@enverusta7811 Год назад
​@@gui.ferreira I am watching on the phone and totally aggree wtih the comment
@gui.ferreira
@gui.ferreira Год назад
​@@enverusta7811 Thanks 🙏 I will change that. It was an experiment that didn't improve anything. Now I'm sad that the following two are already recorded 😅
@enverusta7811
@enverusta7811 Год назад
​@@gui.ferreira don't worry your content is still awesome
@AboutCleanCode
@AboutCleanCode Год назад
@@gui.ferreira i watched on laptop ...
@Tymonello
@Tymonello 9 месяцев назад
Could the interface be a generic one? And then I just get IRouteTimeStrategy and DI gives me the one registered for this class?
@Pixalynx
@Pixalynx 7 месяцев назад
What theme are you using for rider?
@gui.ferreira
@gui.ferreira 7 месяцев назад
Hey! You can find the setup here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-wQG_LntcAQQ.htmlsi=Z3vubI3Xk402zNCd
Далее
The Magical Pattern to Organize .NET Minimal APIs
9:06
Building Complex Objects in a Simple Way with C#
12:19
Cool Parenting Gadget Against Mosquitos! 🦟👶
00:21
Chain of Responsibility to the Rescue!
9:15
Просмотров 12 тыс.
Goodbye Exceptions! Hello Result Pattern!
9:16
Просмотров 9 тыс.
10 Design Patterns Explained in 10 Minutes
11:04
Просмотров 2,3 млн
5x Your Cursor AI Coding Quality With These Pro Tips
16:34
Jonathan Blow on Refactoring
7:10
Просмотров 133 тыс.
How to Organize Your ASP.NET Program.cs File
15:40
Просмотров 4,8 тыс.
Revisiting Design Patterns after 20 by Edson Yanaga
48:24
Building better DTOs in C#
11:57
Просмотров 6 тыс.
Builder Design Pattern Explained in 10 Minutes
10:45
Просмотров 30 тыс.