[Newbies] Collection subclasses
Randal L. Schwartz
merlyn at stonehenge.com
Thu Apr 3 02:48:14 UTC 2008
>>>>> "Rob" == Rob Rothwell <r.j.rothwell at gmail.com> writes:
Rob> Is one not supposed to make subclasses of these classes, and if so, why not?
Generally, your object "has a" collection, but doesn't qualify to be "is a"
collection. If you really want to subclass collection classes, you need
to peer deeply inside the existing classes, and do the right thing.
It's much easier to implement your object, throw a collection inside, then
implement the parts of the collection protocol that you end up using, starting
with #do:, by delegating those to your inside collection.
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
More information about the Beginners