[Q] DependentsArray has weakreferences
Diego Gomez Deck
DiegoGomezDeck at ConsultAr.com
Sat Mar 9 19:54:30 UTC 2002
Hi...
>> I think that you assume that view means gui-view....
>
>Even more specifically, MVC views. After all, that's the semantics Model
>implements.
Dependents mechanism is not only for gui-mvc-views...
[snip]
>> if an object is not observed
>> by anyone the object will die...
>
>But this applies only if the observer requires the object to be around.
>In various places this is not the case and the observer can use weak
>references itself - so even if the object is observed it might die. This
>happens for example in all the registries which in fact observe the life
>time of an object by viewing it weakly.
I agree, then we need 2 mechanism... weak observing and 'strong' observing...
[snip]
>> My problem appears because the dependents mechanism assume
>> that you must have other strong-reference to a view to work....
>> in most of the cases this extra strong reference is the World...
>> in my case this extra strong-reference is in other image.
>
>So the "view here" is really a remote representation of the "view there"
>right? So how do you represent a message that is sent to the "view
>there" in the "view here" without having a strong link to the "view
>here" somewhere?
The "view here" is an Proxy that knows how to send a message to the other side. The framework doesn't have strong references to the proxies (only weak references to use the same instance for the same remote object, so you have a type of identity in the local image)
>> From my point of view, one object can observe other object
>> without the needing of a third one.
>
>Absolutely. However, (besides just not being the semantics of Model) you
>need to ask yourself what that means. If an object views another one
>passively (e.g., the viewee does not know about its view) and the view
>is not referenced anywhere then the only services it can provide are
>side effects. This is because no object can ask anything from the view
>(since there is no reference to it) and the only thing that object can
>affect is the environment.
Yes... affect the environment (nothing more, nothing less)...
[snip]
>Cheers,
> - Andreas
Diego Gomez Deck
PS: Will you come to SqueakNic?
More information about the Squeak-dev
mailing list
|