Accessing the children of a MAContainer by name ?
renggli at gmail.com
Sun Sep 18 14:52:01 MEST 2011
I think the accessor is an ideal object to identify descriptions,
because it uniquely identifies a description.
Instead of duplicating the accessor you could ask the description for
accessor := MBBooking descriptionEventStatus accessor.
MBBooking description detect: [ :each | each accessor = accessor ]
If you do not depend on the extension mechanisms of descriptions, you
could also direct call
to get the description. A bit ugly I agree, we should refactor the
creation of descriptions so that also individual descriptions can be
On 18 September 2011 14:05, Jan van de Sandt <jvdsandt at gmail.com> wrote:
> In Magritte a MAContainer has a collection of MAElementDescription objects
> called children. Often I would like to access a child using it's name.
> Currently a MADescription doesn't have a name property. Most of the times it
> does have a label and an accessor so I can find a child like this:
> | accessor |
> accessor := #eventStatus asAccessor.
> MBBooking description detect: [ :each | each accessor = accessor ]
> MBBooking description detect: [ :each | each label = 'Event status' ]
> I don't like these options for identifying a child description because they
> depend on properties that are used for other things. I am thinking about
> adding an some kind of 'name' property to the description hierarchy. I am
> curious how others have handled this issue.
> Magritte, Pier and Related Tools ...
More information about the smallwiki