[Q] DependentsArray has weakreferences

Andreas Raab Andreas.Raab at gmx.de
Sat Mar 9 17:53:39 UTC 2002


Diego,

Views need models. Models do _not_ need views (at least that's the
theory). Thus if the last reference to a view goes away that view should
go away without bothering the programmer to manually deregister. It
appears to me that if the model needs your "views" then these no views
but something different.  And you may not expect the mechanism which was
designed for views to work with it.

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org 
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
> Behalf Of Diego Gomez Deck
> Sent: Saturday, March 09, 2002 5:40 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: [Q] DependentsArray has weakreferences
> 
> 
> Hello...
> 
> Testing rST, I made an IM (instant messenger)... the "nice" 
> feature of ISU 
> (I Squeak You) (ok... not good name, but no name is worst :) 
> is that knows 
> nothing about the network.... the objects use #addDependent: 
> mechanism to 
> send / receive messages, etc..
> 
> The bad news is: When I tried to use a view in one Squeak 
> with a remote 
> model, the model receive an remote-reference to the (from 
> this point of 
> view) remote view.... After days looking for an extraneous 
> bug, I realize 
> (with the help of aleReimondo) that DependentsArray holds 
> weak-references 
> to the objects.... this work so bad for rST, because the 
> remote-reference 
> object get collected by the gc, but the "real" view is still 
> alive (in the 
> other squeak)...
> 
> The question is: Why dependents are weak-references? In my 
> point of view, 
> this make no sense.... I want that views are alive meanwhile 
> the model is 
> alive.... if I don't want this, I can use #removeDependent:
> 
> I found that this functionality was changed in the changeset 
> 3701WeakObjectFields-ar dated 11 February 2001.
> 
> Depending on your answer/s I'll decide to make a workaround 
> in rST or other 
> thing....
> 
> Cheers,
> 
> Diego Gomez Deck
> 
> 
> 





More information about the Squeak-dev mailing list