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]
Could you compare this what we did with description builders in
basicDescription := self basicMagritteDescription.
builders := self magritteDescriptionBuilders.
builders ifNotNil: [^builders buildFrom: basicDescription target:
^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:
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?
> View this message in context:
> Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com
> Magritte, Pier and Related Tools ...
Magritte, Pier and Related Tools ...
If you reply to this email, your message will be added to the discussion below:
To unsubscribe from Visitors Underused?, click here.
View this message in context:
Sent from the Magritte, Pier and Related Tools mailing list archive at Nabble.com