Тёмный

FINALLY, the Visitor Design Pattern makes Sense 

Gui Ferreira
Подписаться 11 тыс.
Просмотров 8 тыс.
50% 1

Let's explore the Visitor Design Pattern while we refactor C# dotnet code.
💎 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/gsferreira
Visit my blog: gsferreira.com
#dotnet #csharp

Наука

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

 

27 мар 2023

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 26   
@JohnOliverAtHome
@JohnOliverAtHome Год назад
Thanks Gui. Loved the (dynamic)this hint. It makes perfect sense and is so simple (now that I've seen it)
@gui.ferreira
@gui.ferreira Год назад
Great to hear, John! Thanks for taking the time to leave a comment.
@stevancosovic4706
@stevancosovic4706 7 месяцев назад
Very good explanation, thanks!
@gui.ferreira
@gui.ferreira 7 месяцев назад
Glad you enjoyed it!
@tristanstricker967
@tristanstricker967 Год назад
Great video. I think the strategy pattern may be a better fit for this example but visitor is still great. You are making great c# content. Keep up the good work
@gui.ferreira
@gui.ferreira Год назад
Thanks! I think the Strategy Pattern can solve the same problem but doesn't give you the same benefits as the Visitor when you have a Composite. Thanks for the kind words, Tristan!
@AndersBaumann
@AndersBaumann 6 месяцев назад
The visitor is an attempt to implement a functional pattern in an OO language. But C# is getting more functional so now the visitor pattern can elegantly be replaced by pattern-matching expressions.
@FreeMindInMotion
@FreeMindInMotion Год назад
Nice video. I have never used the pattern, but I will keep my eyes open. I like the dynamic type hint for the base class
@gui.ferreira
@gui.ferreira Год назад
Glad you liked it 🙏 In fact, it's rarely used but it's good to know how it works.
@MizenDaCat
@MizenDaCat Год назад
Hi Gui, do you have a video going through your IDE setup (themes, fonts, extensions)? If not, I think you should make one. What font are you using in this video?
@gui.ferreira
@gui.ferreira Год назад
Hi! Thanks for the suggestion. I'm not sure if I want to do a video on this channel about it, but I will try to find a way to have that information out there. Regarding the Font, on the video, I'm using JetBrains Mono.
@vijaybhargavg8638
@vijaybhargavg8638 Год назад
This was brilliant.
@gui.ferreira
@gui.ferreira Год назад
Thank you 🙏
@franciscoamaral9834
@franciscoamaral9834 Год назад
Hi Gui, can you tell me what IDE are you using?
@gui.ferreira
@gui.ferreira Год назад
Hey Francisco! JetBrains Rider.
@ilovepandaypoe6056
@ilovepandaypoe6056 10 месяцев назад
real world scenario, all those permutations will be stored in the database? so need really to create many classes?
@gui.ferreira
@gui.ferreira 10 месяцев назад
You don't need to apply the visitor design pattern to domain or DB objects. It's a useful pattern for things like parsing or formatting
@HizusHiz
@HizusHiz 8 месяцев назад
Still doesn't make sense for c# because you can use pattern matching which will be faster.
@vitek0585
@vitek0585 Год назад
As option the extension methods for the particular type can replace this pattern
@gui.ferreira
@gui.ferreira Год назад
Not that you can't do it in other ways in C#, but even then, it's not an "apples to apples" comparison.
@asusvenus
@asusvenus Год назад
Great content. Although, I think its way too zoomed in
@gui.ferreira
@gui.ferreira Год назад
That's great feedback! Thanks! I've been using Presentation mode lately. I will revisit it 😉
@jeffg4686
@jeffg4686 2 месяца назад
The problem with the visitor pattern is fundamental. It breaks readability. It lacks domain understanding. To "Visit" isn't a verb with meaning.
@ppg68
@ppg68 4 дня назад
While I agree, I find the idea of isolating the Methods into Objects quite useful, you only have to modify the code in one class without breaking anything else
@jeffg4686
@jeffg4686 4 дня назад
@@ppg68 - I'm needs based. I never really found a need for this pattern. And when I see it used, it's never relevant, reads horrible, and fails to convince me that I need it. Just like the bridge pattern. Things start getting too pattern happy after a while...
@Autumn4_love_your_
@Autumn4_love_your_ Год назад
Its a replacement for a type switch case
Далее
The Design Pattern Everyone MUST Know!
7:13
Просмотров 3,7 тыс.
Understanding The Visitor Design Pattern
32:08
Просмотров 57 тыс.
Stray Kids "Chk Chk Boom" M/V
03:26
Просмотров 30 млн
THIS stops 90% of C# Developers Learning TDD
19:40
Просмотров 13 тыс.
Visitor - Design Patterns in 5 minutes
3:20
Do NOT Use Int IDs In Your API
8:01
Просмотров 33 тыс.
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Why Use Design Patterns When Python Has Functions?
23:23
The Smart Way of Using the Decorator Pattern in C#
12:37
8 Design Patterns | Prime Reacts
22:10
Просмотров 394 тыс.
APPLE дают это нам БЕСПЛАТНО!
1:01
Просмотров 661 тыс.