Thanks Gui. Loved the (dynamic)this hint. It makes perfect sense and is so simple (now that I've seen it)
@gui.ferreira Жыл бұрын
Great to hear, John! Thanks for taking the time to leave a comment.
@AndersBaumann11 ай бұрын
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.
@stevancosovic4706 Жыл бұрын
Very good explanation, thanks!
@gui.ferreira Жыл бұрын
Glad you enjoyed it!
@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 Жыл бұрын
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!
@marcotroster8247Ай бұрын
The visitor pattern works great for serializing / deserializing syntax trees. That's the typical case I know.
@gui.ferreira20 күн бұрын
True! In some languages, it is the most efficient way to do it.
@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 Жыл бұрын
Glad you liked it 🙏 In fact, it's rarely used but it's good to know how it works.
@vijaybhargavg8638 Жыл бұрын
This was brilliant.
@gui.ferreira Жыл бұрын
Thank you 🙏
@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 Жыл бұрын
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.
@ilovepandaypoe6056 Жыл бұрын
real world scenario, all those permutations will be stored in the database? so need really to create many classes?
@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
@franciscoamaral9834 Жыл бұрын
Hi Gui, can you tell me what IDE are you using?
@gui.ferreira Жыл бұрын
Hey Francisco! JetBrains Rider.
@vitek0585 Жыл бұрын
As option the extension methods for the particular type can replace this pattern
@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.
@HizusHiz Жыл бұрын
Still doesn't make sense for c# because you can use pattern matching which will be faster.
@jeffg46868 ай бұрын
The problem with the visitor pattern is fundamental. It breaks readability. It lacks domain understanding. To "Visit" isn't a verb with meaning.
@ppg685 ай бұрын
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
@jeffg46865 ай бұрын
@@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_ Жыл бұрын
Its a replacement for a type switch case
@asusvenus Жыл бұрын
Great content. Although, I think its way too zoomed in
@gui.ferreira Жыл бұрын
That's great feedback! Thanks! I've been using Presentation mode lately. I will revisit it 😉