[Q] What Collection should I use

Torge Husfeldt torge.husfeldt at gmx.de
Thu Apr 3 17:04:49 UTC 2003


On Thu, 03 Apr 2003 18:48:24 +0200, Chris Burkert 
<christian.burkert at s2000.tu-chemnitz.de> wrote:

Hello Chris,

What is wron with two dictionaries:

dict1:
	key -> obj
dict2:
	obj -> Boolean (enabled)

HTH,
Torge

> Hello
>
> 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?
>
> thanks
> Chris Burkert



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/



More information about the Squeak-dev mailing list