swarm-support
[Top][All Lists]
Advanced

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

Re: Big diatribe on protocols & classes (was Re: Can a Swarminstancebe


From: Paul E. Johnson
Subject: Re: Big diatribe on protocols & classes (was Re: Can a Swarminstancebe treated like a SwarmObject instance?
Date: Fri, 23 Apr 1999 09:44:54 -0500

"William S. Shu" wrote:
> 
> >"Marcus G. Daniels" wrote:
> >>
> >>  If
> >> you use a method that isn't advertised, directly or indirectly by
> >> protocol inheritance, you are relying on behavior is not specified (not
> good).
> 
> I agree.  It is very unsafe to use protocols/methods/interfaces that are not
> guaranteed, especially as subsequent upgrades could change things.
> 
> Paul indicated earlier that Swarms have all the protocols of SwarmObjects.
Not exactly, but they share a lot of common ancestors in the tree

I don't want to beat this thread all the way into the ground, but let me
be sure we understand each other. 
 
My argument was, given the current state of affairs, one might have to
look at the source code to see what methods are implemented for a
class.  From the current interface, it appears that a Swarm object
cannot be dropped.  However, from the inheritance tree I showed, the
class Swarm does respond to drop and it is "as if" it adopted those
protocols, because it inherits from classes that implement them.  

I'm not arguing that people ought to assume that any class can implement
any method.  Rather I say that, with Swarm-1.4.1 as distributed, there
is little choice but to treat Swarms as if they can respond to these
things, because they can, even though the Swarm Docs don't say so.  

Then Marcus said it was just a book keeping mistake in the source code
that made it appear that the class Swarm did not adopt those protocols,
and in the next version of the program, the protocols implemented by
Swarm types will be clarified.  I'm glad for that.  

It all comes back to William's original question, which I believe was
motivated by the belief that a Swarm class adopted no protocols.  His
question made me think that he had some Swarm objects that he believed
would not respond to certain messages, and so he wanted to get multiple
inheritance to make those objects respond as if they were SwarmObjects. 
I think what we have learned is that there is no need, because a Swarm
type will respond to the messages.  On the other hand, if you look at
the inheritance tree, a Swarm does not have all that much more stuff
than a SwarmObject, and perhaps the subunits in the model can be
subclassed from SwarmObject.  

-- 
Paul E. Johnson                         email: address@hidden
Dept. of Political Science              http://lark.cc.ukans.edu/~pauljohn
University of Kansas                    Office: (785) 864-9086
Lawrence, Kansas 66045                  FAX: (785) 864-5700

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

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