swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy protocol and object ravioli


From: glen e. p. ropella
Subject: Re: copy protocol and object ravioli
Date: Thu, 13 Feb 1997 18:25:14 -0700

> I may be underestimating the problem here but wouldn't the following
> simple heuristic do the trick?
> 
> If object A is asked to clone itself it makes a copy of its basic size
> (i.e. something to hold its instance variables etc.). Then, for every
> instance variable V we ask the simple question:
> 
>                  *** The 'Parmesan' Principle ***
> 
>    << http://www.epicurious.com/db/dictionary/terms/p/parmesan.html >>
> 
>    Do I own V (am I the only one who has a reference to this) or not?
>    [OMT even has special notation for this relation... I think its called
>    unique containment...]
> 
> If A is the only owner, then recursively call V's copy method and put the
> result in the clone's (A') slot. If not, then the shared object V **must**
> have some standard mechanism for observer tracking (which may be implicit
> in the case of garbage collecting systems but never mind that right now).
> In which case tell A', when it is made, that it should register itself
> with the instance variable somehow:

[...Java evangelizing deleted...]

> If an object doesn't know, at compile time, what subset of its contents
> is shared (in principle), then the programmer is not thinking things
> through - which is negligent in the old fashioned single-threaded world,
> but is downright criminal when you have threads.
> 
> ...Well, there must be some major source of complexity that I'm overlooking
> here, right? So, what am I forgetting?
> 
> Manor.
> 
> PS> I'm forgetting something in the sauce, right? :*)

What you've propped up, here, is perfectly useful from a programming
standpoint.  And with my programmer's hat on, I say "Bully!"

But, if I take off my programmer's hat and replace it with my
"abstract modeller's" cap, I still have to wonder why the 
object is responsible for cloning itself.  Nothing in the
world from which we abstract works that way....except for
living organisms...

So, it's not the mechanism of self-directed cloning that upsets
me.  It's the fact that an agent shouldn't clone itself unless
that cloning process is part of the model being simulated.

glen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]