Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] using introduction at runtime

> but I want to know if 1) AspectJ can introduce an advice or 2) add
> a parent to a pojo instance ?

1) I'm not sure what you mean by "introduce an advice".  Do you mean
that you want to dynamically create advice at runtime?  Or do you mean
that not all advice will be known at compile time because aspects can
be added later?

If you mean the first, then that is not possible with AspectJ, but I
believe that dynamically creating advice would create a maintenance
nightmare and that most of the time you can get the same effect by
clever use of AspectJ.


2) You cannot add an intertype declaration* to a single instance.
ITDs must apply to all instances of a class.  ITDs affect classes and
types, not objects.


* Intertype declaration or ITD is the preferred term instead of introduction.

--a


Back to the top