Am 15.07.2008 um 13:23 schrieb nicolas cellier:

Bert Freudenberg a écrit :
Am 15.07.2008 um 08:26 schrieb Herbert König:
Hello Randal,

RLS> dictionary. This is how the classic "dependents" system works as well: the RLS> dependencies are in a WeakDictionary so that when the watched object goes
RLS> away, the dependencies are also cleaned.

thanks for some free education (no smiley, I mean it), now I'll do
some homework and look up dependency.

I use it in some places without knowing of it's "weakness".
The dependents are weak only for "regular" objects. Proper Models handle their own dependents collection in a non-weak manner.
- Bert -

Hmm, not really

"Warning: this example is stupid!"
| tmp |
tmp := Model new.
tmp addDependent: #x.
tmp addDependent: #y.
tmp dependents class. "=> DependentsArray"

DependentsArray is a class that holds weakly to its elements...

The difference is that the DependentsArray itself don't have to pollute the global WeakIdentityKeyDictionary (Object classPool at: #DependentsFields).

You are right, I was mislead by Object>>dependents ...

But maybe we have just quit the beginners rails...


... and you are right again.

- Bert -


_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to