[aspectc-user] "Reverse Inheritance"

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Wed Oct 9 12:55:33 CEST 2002


On Wednesday 09 October 2002 12:13, you wrote:
> Dear All!
> I try to give some classes a new Base-Class through ac++
> (aka "Reverse Inheritance") as it can be seen in examples/IconCache.ah.
> I like to let Objects fullfill "Roles" in a "Role-Model" (aka
> "Collaboration Based Design"),
> as it is introduced by Osterby et al., specified and implemented in
> [Kend99a] and
> in [SmarEtAl02]. To fullfill this, i have to weave "extrinsic behaviour"
> ([Kend99a], Chapter 1.3)
> into the "business-classes". Many authors (e.g. [CzarEtAl00]) see in this a
> major issue which
> can be achieved easily through AOP. This is a key-issue for my work, too.
> This can only be achieved  through "public inheritance".
> All my ac++ tests only generated "private inheritance",
> which represents _not_ an "Is a"-relationship,
> but a "Contains a"-relationship ([Stro98], P.798f).
> So this is only a kind of "member-introduction" and not of "reverse
> inheritance".
> Is it possible to generate "real (public) reverse inheritance" -code with
> ac++?
> (I havenĀ“t found any comments on this in your publications!)
> If not:
> - for which reason you decided to generate only private inheritance?
>   None of the above mentioned concepts can be acomplished through this;
>   i (and Stroustrup in [Stro98], P.819 as well ;-) would prefer
>   aggregation over private inheritance.
> - Are there plans to integrate "public inheritance" into the grammar?
>   e.g.
>   advice classes("BusinessClass") : public baseclass(Role_X); ?
>   advice classes("BusinessClass") : baseclass(public Role_X); ?

Adding public base classes is already possible (althought we should think the 
syntax over someday). It is categorized as an introduction and the protection 
level of introductions in the target class is derived from the protection 
level in the aspect definition. You can simply to what you want like this:

aspect RollAssignment
   advice ...

      advice classes("BusinessClass") : baseclass (Role_X);



More information about the aspectc-user mailing list