Re: When and where to use Visitor Pattern?
- From: "Daniel Parker" <danielaparker@spam?nothanks.windupbird.com>
- Date: Wed, 27 Apr 2005 00:51:29 -0400
"Rich MacDonald" <rich@@clevercaboose.com> wrote in message
news:Xns9644C928CC626richclevercaboosecom@xxxxxxxxxxxxxxx
> "Ilja Preuß" <it@xxxxxxxxxxxxx> wrote in
> news:426ba2dc@xxxxxxxxxxxxxxxxxxxxxxx:
>
> Or the fact that that original class(es) needs to "do a hundred things".
> Rather than add all that stuff into the class and create a mess, you keep
> it lean and delegate off to a hundred visitors.
>
> Done well, I consider it the most useful and powerful pattern I know.
I think it's fair to point out, though, that this sentiment is not
universal, see for example http://nice.sourceforge.net/visitor.html. To the
extent that the vistor pattern is just a poor man's substitute for
multimethods, wouldn't "instanceof" do just as well? And be a little
clearer? With less clutter in the core class (no visit method)?
Regards,
Daniel Parker
.
- Follow-Ups:
- Re: When and where to use Visitor Pattern?
- From: Robert C . Martin
- Re: When and where to use Visitor Pattern?
- From: Rich MacDonald
- Re: When and where to use Visitor Pattern?
- From: Roger L. Cauvin
- Re: When and where to use Visitor Pattern?
- From: Nicholls . Mark
- Re: When and where to use Visitor Pattern?
- References:
- When and where to use Visitor Pattern?
- From: Sam Hwang
- Re: When and where to use Visitor Pattern?
- From: Ilja Preuß
- Re: When and where to use Visitor Pattern?
- From: Rich MacDonald
- When and where to use Visitor Pattern?
- Prev by Date: Re: When and where to use Visitor Pattern?
- Next by Date: Re: author of this article?
- Previous by thread: Re: When and where to use Visitor Pattern?
- Next by thread: Re: When and where to use Visitor Pattern?
- Index(es):