[Newbies] OrderedCollection if imageMorphs

Randal L. Schwartz merlyn at stonehenge.com
Sun Nov 8 21:06:18 UTC 2009

>>>>> "Christine" == Christine Wolfe <cwdw01 at earthlink.net> writes:

Christine> I created a class, SymbolArray, that is a subclass of
Christine> OrderedCollection with the following initialize method. Each of the
Christine> items I'm adding (SymbolBlank, SymbolGet, etc) is an imageMorph.

Ahh, there's the mistake... missed it before.

You really really really do *not* want to create a subclass
of OrderedCollection.

Your object will *have* an OrderedCollection, but should not *be* one.

If you want to respond to all of the protocol of OrderedCollection,
feel free to delegate it to your actual instance variable.

Yes, it's a bright shiny object to want to subclass that, but just like
subclassing SmallInteger, it's both legal and dumb. :)

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

More information about the Beginners mailing list