[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Defininng and using an object as a Swarm and a SwarmObject at the
From: |
Joseph E. Villa |
Subject: |
RE: Defininng and using an object as a Swarm and a SwarmObject at the same time. |
Date: |
Mon, 22 Mar 1999 08:03:53 -0800 |
Alex,
Thanks for the correction/commentary! What is the appropriate way to
refer to the following (the part where two interfaces subclass/inherit
from two superclasses [SwarmObject & GUISwarm] within a single class
[simpleExperBug])?
Joseph Villa
================================================================
// ExperSwarm.h simpleExperBug
// The ExperSwarm is a swarm that manages multiple invocations of a
// model.
#import "ModelSwarm.h"
#import <simtoolsgui/GUISwarm.h>
#import <objectbase/SwarmObject.h>
#import <objectbase.h>
#import <analysis.h>
// First, the interface for the ParameterManager
@interface ParameterManager: SwarmObject
...
@end
// Now, the Experiment Swarm Interface
@interface ExperSwarm: GUISwarm
...
@end
================================================================
> -----Original Message-----
> From: Alex Lancaster [mailto:address@hidden
> Sent: Sunday, March 21, 1999 10:08 PM
> To: address@hidden
> Subject: Re: Defininng and using an object as a Swarm and a
> SwarmObject
> at the same time.
>
>
> >>>>> "JV" == Joseph E Villa <address@hidden> writes:
>
> JV> It seems what you've proposed is multiple inheritance. There's
> JV> certainly a lot of discussion in OO design about multiple
> JV> inheritance, and some would have you believe it is inheritantly
> JV> (*g*) problematic from a pure design perspective. (I tend to stay
> JV> away from multile inheritance, but I suspect this is one of those
> JV> religious fervor topics.)
>
> JV> You may be able to achieve multiple inheritence by including the
> JV> SwarmObject.h and Swarm.h files in your Population
> JV> files. (Cruising through some of the root Swarm classes, I think I
> JV> came across this.)
>
> Unfortunately this won't work (we don't use multiple inheritance
> anywhere in the Swarm kernel). Objective C (and therefore Swarm)
> doesn't support multiple-inheritance directly (C++ does, but Java
> doesn't). But there are several ways to achieve a similar effect.
> You can use Objective C protocols (to construct classes that conform
> to a given interface, but that doesn't necessarily allow you access to
> the *implementation*, like true multiple inheritance does).
>
> Here's an online reference from the NeXT Objective C manual (now
> hosted on the Apple website):
>
>
> http://developer.apple.com/techpubs/macosxserver/System/Docume
> ntation/Developer/YellowBox/TasksAndConcepts/ObjectiveC/moreob
> jc.htm#787
>
> The other approach is to use forwarding to mimic multiple inheritance,
> the NeXT book on Objective C discusses this approach in more detail:
>
>
> http://developer.apple.com/techpubs/macosxserver/System/Docume
> ntation/Developer/YellowBox/TasksAndConcepts/ObjectiveC/runtim
> e.htm#1005
>
> The top level for this online Objective C book is at:
>
>
> http://developer.apple.com/techpubs/macosxserver/ObjectiveC/index.html
>
>
> -- Alex
>
> --
> Alex Lancaster | e-mail: address@hidden
> Swarm Program | web: http://www.santafe.edu/~alex
> Santa Fe Institute | tel: +1-(505) 984-8800
> -------------------------------------------------------------------
>
> ==================================
> 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.
>
==================================
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.
- RE: Defininng and using an object as a Swarm and a SwarmObject at the same time.,
Joseph E. Villa <=