discuss-gnustep
[Top][All Lists]
Advanced

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

Re: "multiple inheritence" / behavior


From: Alexander Malmberg
Subject: Re: "multiple inheritence" / behavior
Date: Fri, 15 Nov 2002 17:52:10 +0100

Manuel Guesdon wrote:
> 
> Hi,
> 
> I'dl like to have a common set of methods used by
> different objects but without letting them inherit
> from the same class
> and without adding a category to one of the common
> inherited class.
> I've seen behavior methods which seems to be what I
> need but there are warnings in behavior.h.

Behaviors sounds very much like what you want. It's dangerous in the
sense that it's easy to mess it up, but when used correctly, there
shouldn't be any problems.

> So, is there another method to make this ? If not, is
> behaviour will be supported for a long time ?

IMO, behaviors is (yet another :) useful and neat feature objective-c
gives us. It is perhaps a bit too advanced for us to plug extensively,
but the header should be installed (or moved to libobjc and installed by
it instead?), although I think the warnings should remain there.

> Is there
> any problem if I add methods by this way in classes
> which don't have exactly the same ivars (or ivars order)
> if I don't use these ivars directly ?

As long as you don't touch them directly ("self->foo", or plain "foo" in
a method), it should work.

> Thank you .
> 
> Manuel

- Alexander Malmberg




reply via email to

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