Sure, I'm not yet sold on what I did. I feel like there's something I'm missing but don't know yet what it is.

One thing is that it seems like MADescriptionMorph and friends should themselves be the visitors, but currently they inherit from Model (I wonder if they have to).

Also, the visitor pattern should be able to handle both Seaside and Morphic, where right now these are handled totally separately.

OTOH, I went back to Design Patterns, which says that Visitor is appropriate when the set of operated-on classes is stable, but here anyone that wants to have a custom rendered view (i.e. MyPianoMorph instead of a checkbox) would have to hunt around adding #visitPianoDescription: methods to all the builders.

On Mar 28, 2015, at 5:17 AM, Stephan Eggermont [via Smalltalk] <[hidden email]> wrote:

Could you compare this what we did with description builders in QCMagritte?

QCObject>>magritteDescription
     |basicDescription builders|
     basicDescription := self basicMagritteDescription.
     builders := self magritteDescriptionBuilders.
     builders ifNotNil: [^builders buildFrom: basicDescription target:
self].
     ^basicDescription

QCContainerComponent>>magritteDescription
     ^magritteDescription ifNil: [
         | model builder |
         builder := description descriptionBuilder.
         builder ifNil: [ ^description].
         model := self model.
         magritteDescription := builder buildFrom: description target:
model model: self model model.
         self setMemento: (model mementoClass model: model description:
magritteDescription).
         magritteDescription ]

Stephan

On 26/03/15 14:25, Sean P. DeNigris wrote:

> Should or could the MADescriptionMorph hierarchy use/inherit-fro MAVisitor?
>
> "Magritte Meta-Described Web Application Development" says "Custom
> Rendering... Sometimes other layouts are more convenient, for example the
> widgets should be laid out from left to right with the labels on top...
> Magritte allows one to define one’s own builder by subclassing a Visitor and
> overriding some of the methods used to place the user interface elements".
>
> With the current implementation, it seems one would have to hack the
> MADescriptionMorph classes themselves for that kind of change, but if a
> visitor was used, they could just supply a custom visitor class, no?
>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Visitors-Underused-tp4815294.html
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.
>
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki


If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Visitors-Underused-tp4815294p4815727.html
To unsubscribe from Visitors Underused?, click here.
NAML

Cheers,
Sean


View this message in context: Re: Visitors Underused?
Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com.