[Q] What Collection should I use

Chris Burkert christian.burkert at s2000.tu-chemnitz.de
Thu Apr 3 16:48:24 UTC 2003


I have to remember some Objects. Each of them is referenced by a key. 
The Objects can be 'enabled' or 'disabled' but they shouldn't know about 
this state, nor about the key, so I didn't want to put this information 
inside of the objects. My wish is like swapping objects in and out.

First I thought of having two Collections, one with the enabled objects 
and one with the disabled.

Then I thought of putting all objects in one Dictionary and access them 
by two MappedCollections of enabled and disabled objects but AFAIK those 
MappedCollections cannot grow or shrink.

Do you have a good idea? Is there a fast way of swapping and accessing them?

            Chris Burkert
Student of applied Computer Science at Chemnitz University of Technology
      http://www.chrisburkert.de/            chris at chrisburkert.de
"I invented the term Object-Oriented, and I can tell you I did not have
  C++ in mind." - Alan Kay --> http://www.whysmalltalk.com/

More information about the Squeak-dev mailing list