swarm-support
[Top][All Lists]
Advanced

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

method inheritance


From: Marshall James
Subject: method inheritance
Date: Wed, 10 Mar 1999 15:44:24 +0100

Hi,
  I have some classes, one of which is a super class of the others... in
the super class I've put the following code

[self dealWithCall: call];

where the dealWithCall method is implemented differently in the different
sub classes. At first I didn't declare the dealWithCall method in the super
class, and the compiler complained that it didn't respond to this message,
and on execution the method was never executed.
Next I tried declaring the method interface in the .h file of the super
class. The compiler complained of an incomplete implementation, and again
the method was never executed.
Finally I also provided an implementation of the method in the super class,
with the intention that it would be over-ridden by the implementations in
the sub-classes, however still the desired method isn't activated.
Is there any way to do what I'm trying to do? Basically the point of this
is to have a generic method common to all objects of a certain type, but to
have this trigger different behaviour in different sub-types of agents.
Hope someone can point me in the right direction, thanks,
        James
--

James Marshall - Research Assistant - COTCOS Project
  Institut de Recherche en Informatique de Toulouse
      WWW: http://www.mk.dmu.ac.uk/~jmarshall

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