swarm-support
[Top][All Lists]
Advanced

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

Subclassing from collections objects


From: Kerimcan Ozcan
Subject: Subclassing from collections objects
Date: Fri, 25 Sep 1998 20:39:45 -0400 (EDT)

Hi folks,

I am just trying to find out where the bug might be for the following
error message and program segments. I am using Swarm-1.3 (Win95).
--------------------------------------------------------------------------
bash error message:

ListManager.h:10: Cannot find interface declaration for `List', superclass
of `ListManager'
--------------------------------------------------------------------------
ListManager.h file:

#import <collections/List.h>

@interface ListManager: List

- addObject: (id)o;
- dropObject: (id)o;
- (id)getObject: (int)oi;

@end
--------------------------------------------------------------------------
from my Makefile:

SWARMHOME=/Swarm-1.3/packages/swarm
--------------------------------------------------------------------------
I can't imagine that the program doesn't know where to look for List.h
since other objects which are subclassed from objectbase/SwarmObject.h
compiled very well. Also, I am %100 sure that I do have the collections
library and the corresponding files! 
One thing that I suspect might be a reason is related to the quite
inconspicuous remark that was made in Appendix C.2.6 of the documentation
which says that " if you want to create your own versions of the
collections, don't do it by subclassing the collections themselves.
Instead, create a different class of object which contains inside it, an
instance of the appropriate class (this is called delegation in the OOP
community). You should do this because the actual subclassing of objects
which actively use the createPhase stuff (by actively I mean ones that
don't return self on a createEnd), is not well supported."
I don't quite see how this "delegation" stuff works. If it comes down to
defining all the methods that go with the actual List object then I don't
see how this OOP thing makes life easier. I thought I could extend an
existing collections object by subclassing from it and defining three more
methods but now it seems like I have to come up with some delicate hacking
which somewhat takes all the fun out of OOP. 
I would appreciate if someone can provide a quick and dirty way of doing
this "delegation" thing without messing the program too much. If, on 
the other hand, you think that the bug is due to a much more stupid
mistake that I might have missed, please bring this to my attention.
Thanks a lot for any leads on this.

Kerimcan Ozcan                                  
Doctoral Pre-Candidate in Marketing
University of Michigan Business School
Ann Arbor, Michigan, USA
http://www-personal.umich.edu/~kozcan/ozcan.html


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