Multiple MorphicWrappers

Gerardo Richarte gera at core-sdi.com
Thu Nov 5 23:13:14 UTC 1998


you, MW users. What do you think?

    Is it better to allow an object to be represented as any MW, or to
be represented as one of the MW it answer to #morphicWrapperClasses, and
letting it thefault to be object morphicWrapperClasses first?

    My personal point of view is that it should be a selective list of
the MW that will properly show the object...

    Another aproach can be, for example:

RegularPolygonMorphicWrapper class methods:
canRepresent: anObject
    | objectClass |
    objectClass := anObject class.
    self neededSelectors do: [:eachSelector |
        ((objectClass canUnderstand: eachSelector) ifFalse: [^false])].
    ^ true.

neededSelectors
    ^ #( #sides #vertices #someOtherNeededSelector)


    and then the list can be constructed selecting on the MW that
#canRepresent: theObject... I don't like this option, but somebody can
improve it... may be...

   what do you think?

    Representative Bye!
    Richie++





More information about the Squeak-dev mailing list