[Q] [PROPOSAL] Dependents / Events
Doug Way
dway at riskmetrics.com
Wed Mar 13 22:49:01 UTC 2002
Diego Gomez Deck wrote:
>
> Hello...
>
> I'd like to refactor dependent/event mechanism, but I'd like to know your impression before.
>
> This is my proposal:
>
> Strong/Weak
> -----------
>
> - add #addStrongReference: and #addWeakReference: (and related methods) to Object and Model.
>
> - modify #addRefence: (and relateds) to call #addWeakReference: (note: I'm not sure that weak is a good
> default, but in this way all will works as today)
My only comment here is that I strongly feel that weak references are the appropriate default for dependents. I was very glad when they were made weak (sometime early in 3.1alpha, I think), so that I didn't have to worry about cleaning things up all the time. :-)
Normally I think dependents are supposed to be a purely one-way relationship, as others have argued here.
However, I suppose if there were a valid reason to have strong references for these in some cases (which I'm not sure about), it wouldn't hurt to add #addStrongReference: methods on Object and Model.
(I haven't looked into the issue with SystemWindow>>delete... it may be true that it could do something different now that dependents are weak.)
- Doug Way
dway at riskmetrics.com
More information about the Squeak-dev
mailing list
|