[Q] [PROPOSAL] Dependents / Events

Diego Gomez Deck DiegoGomezDeck at ConsultAr.com
Tue Mar 12 12:04:21 UTC 2002


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)

NOTE: with this aproach, a view can decide to use the default mechanism of the model (sending 

#addDependent:) or use explicitilly weak/strong.

- search for senders of #addDependent: and add all the missing #removeDependent: sends


- the same works for #when:perform: (and relateds) (weak/strong, weak as default, look for missings 

#removeEventsTriggeredFor:)



SystemWindow>>delete
--------------------

- replace #release with #removeDependent: in SystemWindow>>delete
- call to #release when no more dependents are available from #removeDependents:  (debuger, irc, etc will receive the #release message just like today).

NOTE: #release can be renamed as #noMoreDependents



Optional
--------

- unify Model and EventModel

- add an new Model class named SureModel to handle errors in the dependents/events notification... if a view is not accesible it can be removed from the lists of dependents / events.


Waiting for comments,

Diego Gomez Deck


PS: I'm a new smalltalker (3 years) and I can't realize when the thinks are made in this way for compatibility.  I read that #release mechanism was used befere weak-references exists... that is true?




More information about the Squeak-dev mailing list