[Newbies] OrderedCollection if imageMorphs

Christine Wolfe cwdw01 at earthlink.net
Sun Nov 8 22:56:55 UTC 2009


Oh, I'm so so sorry - I thought it was OK to ask dumb questions on the
newbie forum (blush)  I'll try to figure out how to make an instance
variable an order collection.

-----Original Message-----
From: Randal L. Schwartz [mailto:merlyn at stonehenge.com] 
Sent: Sunday, November 08, 2009 4:06 PM
To: Christine Wolfe
Cc: beginners at lists.squeakfoundation.org
Subject: Re: [Newbies] OrderedCollection if imageMorphs

>>>>> "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