help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Dictionary and Association


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Dictionary and Association
Date: Wed, 06 Apr 2011 18:42:16 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 04/06/2011 03:25 PM, Wolfgang Dann wrote:
I wanted to subclass Association to store a Bookmark.
If i understand you right, then i have to
always send new when the key changes.

Sets and Dictionaries are not able to store objects or keys (respectively for Sets and Dictionary) that change. When you have a change you need to take out the object (association for Dictionary), change it and put it back.

Usually Associations are considered an implementation detail and you put the Bookmark as the value. You can then define a BookmarkList that includes a Dictionary or LookupTable and automatically manages the key->bookmark association so that the collection stays consistent.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]