[aspectc-user] changing the inheritance tree: adding parents to an already existing class

Peter Vandersteegen Peter.Vandersteegen at intec.Ugent.be
Mon Jan 24 11:32:50 CET 2005


Hello,

Recently I came into contact with aspectJ and its C++ counterpart: aspectC.
In some projects I'm involved with, it can be useful to change the 
'inheritance tree.'
For example I mean you can add parents to an already existing 
class.  (while using aspects of course)

Now I wonder how this can be done in aspectC.

I've found a java example to illustrate this behavior.
In aspectJ you use " declare parents"  to change the 'inheritance tree'

public aspect FooRunnable{
         declare parents: Foo implements Runnable;

         public void Foo.run(){
                 System.out.prinln("added a method to an already defined 
class");
         }
}

This example can also be found on: 
http://www-106.ibm.com/developerworks/java/library/j-aopsc/

Can you please tell me if this example is done in aspectC?
If not, can you please tell me if there are plans to include this behavior 
in aspectC?

kind regards

Peter

ps. greet work building the aspectC language and its compiler.




Peter Vandersteegen
Ghent University, Dept. of Information Technology
Sint-Pietersnieuwstraat 41, B-9000 Gent, Belgium
WWW: http://photonics.intec.UGent.be





More information about the aspectc-user mailing list