swarm-support
[Top][All Lists]
Advanced

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

Re: copy method


From: glen e. p. ropella
Subject: Re: copy method
Date: Thu, 13 Feb 1997 13:28:19 -0700

Hey Scott,

> So in your case, no, a protocol by itself is not going to do this kind of
> mapping; so you need to do the work that you mention at the end of the
> paragraph.  You may want to create two protocols
> 
> @protocol (Copying)
> - copy;
> @end
> 
> @protocol (DelegateCopying)
> - copyObject:(id)anObj;
> @end

This is a cool thought.  We could have protocols that are
matched by objects who are capable of copying other objects
and objects that are only capable of copying themselves.  At
the very least, this separates the *kind* of copying being
done between a programming-type copy and a modelling-type
copy.  Then I could say that an object should only be able
to delegateCopying to itself IF it is a model-specific feature
of the agent that it be able to reproduce.  This may make for
a nice compromise.

> I prefer the first technique better because then each individual "bug"
> doesn't need to know that it must inform a delegate; somebody may implement
> a "bug" and forgot to add that code.  Better that you always call the
> "universe" to do the copying so that it make sure the objects are setup
> properly.

I agree.  The first way is what I'd had in mind (with the 
exception of using the protocol).  So, in the context of 
Swarm, Any Swarm should adhere to the DelegateCopying 
protocol and any SwarmObject should adhere to the Copying
protocol.  Then a SwarmObject may or may not also adhere
to the DelegateCopying protocol, depending on the model.

I think I might change the names of the protocols, say,
from Copying to Copyable and DelegateCopying to Copying.
This might allow sentences like "Swarms are both copyable
and copying entities" and "bugs are only copyable entities."

> I hope I've explained this clearly enough.

like an azure sky of deepest summer.

Thanks!
glen


reply via email to

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