No video

FINALLY, the Visitor Design Pattern makes Sense

  Рет қаралды 7,980

Gui Ferreira

Gui Ferreira

Күн бұрын

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 KZfaq 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

Пікірлер: 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.
@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 7 ай бұрын
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.
@stevancosovic4706
@stevancosovic4706 8 ай бұрын
Very good explanation, thanks!
@gui.ferreira
@gui.ferreira 8 ай бұрын
Glad you enjoyed it!
@vijaybhargavg8638
@vijaybhargavg8638 Жыл бұрын
This was brilliant.
@gui.ferreira
@gui.ferreira Жыл бұрын
Thank you 🙏
@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.
@jeffg4686
@jeffg4686 4 ай бұрын
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 Ай бұрын
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 Ай бұрын
@@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
@ilovepandaypoe6056
@ilovepandaypoe6056 Жыл бұрын
real world scenario, all those permutations will be stored in the database? so need really to create many classes?
@gui.ferreira
@gui.ferreira Жыл бұрын
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
@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 😉
@franciscoamaral9834
@franciscoamaral9834 Жыл бұрын
Hi Gui, can you tell me what IDE are you using?
@gui.ferreira
@gui.ferreira Жыл бұрын
Hey Francisco! JetBrains Rider.
@HizusHiz
@HizusHiz 9 ай бұрын
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.
The Design Pattern Everyone MUST Know!
7:13
Gui Ferreira
Рет қаралды 3,7 М.
Understanding The Visitor Design Pattern
32:08
Ryan Schachte
Рет қаралды 57 М.
The Joker kisses Harley Quinn underwater!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 8 МЛН
Whoa
01:00
Justin Flom
Рет қаралды 20 МЛН
Pool Bed Prank By My Grandpa 😂 #funny
00:47
SKITS
Рет қаралды 20 МЛН
English or Spanish 🤣
00:16
GL Show
Рет қаралды 5 МЛН
THIS stops 90% of C# Developers Learning TDD
19:40
Gui Ferreira
Рет қаралды 13 М.
Revisiting Design Patterns after 20 by Edson Yanaga
48:24
The missing Project that fixes everything in .NET
15:09
Gui Ferreira
Рет қаралды 10 М.
This Will Make Everyone Understand Golang Interfaces
21:03
Anthony GG
Рет қаралды 49 М.
Why Use Design Patterns When Python Has Functions?
23:23
ArjanCodes
Рет қаралды 104 М.
8 Design Patterns | Prime Reacts
22:10
ThePrimeTime
Рет қаралды 405 М.
The State Design Pattern in Python Explained
19:14
ArjanCodes
Рет қаралды 74 М.
Proxy Pattern - Design Patterns (ep 10)
37:35
Christopher Okhravi
Рет қаралды 162 М.
The Joker kisses Harley Quinn underwater!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 8 МЛН