swarm-support
[Top][All Lists]
Advanced

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

Re: static or dynamic, that is the question.


From: Marcus G. Daniels
Subject: Re: static or dynamic, that is the question.
Date: 26 Oct 1999 17:06:55 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "MM" == Matthew M Murphy <address@hidden> writes:

MM> Am I right in assuming that there are some objects (like space
MM> objects) that might as well (and are (usually?)) be statically
MM> typed, since there is (typically) only one of them and there isn't
MM> any reason to utilize dynamic binding/typing in messages sent to
MM> the object?

Yep.

MM> Am I right in assuming that each bug is going to be statically typed?

Technically, yes.  But there isn't any real performance advantage
to do that in Objective C, and you'll get the same level of checking 
if you use protocol qualification. 

Static variable typing in Objective C is really only good for when
(for performance) it is desirable to dereferencing into an object for
an instance variable.  (We avoid static typing entirely in the Swarm
interfaces so that it other languages can talk to Swarm.)

MM> I want to be able to sent the same kind of message to all agents, but I
MM> want agents to do different things depending on which subclass they belong
MM> to. 

Just subclass in the usual way and have different implementations
of the method in the subclasses.  You might introduce a protocol to 
complement the the abstract class and have the abstract class declared
like this: "@interface AbstractClass: CreateDrop <MyProtocol>".. Then
refer to the instances as "id <MyProtocol>".


                  ==================================
   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]