« Return to Thread: Instance based description in Magritte

Re: Instance based description in Magritte

by Lukas Renggli-2 :: Rate this Message:

Reply to Author | View in Thread

> The description of the objects in class B needs to be instance  
> based. All the objects in one collection have the same description,  
> however class B is not able to provide a description.
>
You can override #description on the instance side to either build  
your descriptions on the fly or to modify the ones returned by the  
class. For example:

    B>>description
       ^ super description collect: [ :each |
          (each isKindOf: MAToManyDescription)
             ifTrue: [ each copy classes: self dynamicClasses ]
             ifFalse: [ each ] ]

You find many other possible solutions in the mailing-list archive and  
some additional information in the FAQ:

    http://www.lukas-renggli.ch/smalltalk/magritte/faq

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

 « Return to Thread: Instance based description in Magritte