Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Modifying only least-derived class

Thanks for the response. It looks like that way isn't going to work for me
anyway.

As I mentioned, I'm trying to write aspects for an open source JDO
implementation. The problem is that it seems there is very little
flexibility regarding where you can introduce methods/fields (inter-type
declarations). The reference says:

Modifiers ReturnType OnType . Id(Formals) { Body }

Which means that you have to specify the OnType explicitly--you can't even
do a TypeMapping for it.

My next step will be to try to see about selective application of the
enhancement aspect at class loading time. I'm probably going to need that
anyway. I saw something in the FAQ about there being an example either
already out or forthcoming, so I'll try to take a look at that.

Joel Shellman



----- Original Message -----
From: "Macneil Shonle" <Macneil.Shonle@xxxxxxx>
To: <aspectj-users@xxxxxxxxxxx>
Sent: Saturday, April 26, 2003 10:54 AM
Subject: Re: [aspectj-users] Modifying only least-derived class


> This sounds like a good pointcut to include in AspectJ. By least derived I
> assume you mean only those classed directly derived from Object? It would
> be nice to identify classes based on what they are derived from.
>
> In the meantime, you can have only A and D implement "LeastDerived".
>
> -Macneil
>
> >I'm working on Aspects for JDO enhancement. Is there a way that I could
have
> >an aspect only change the least derived class? So:
> >
> >package everything;
> >
> >class A {
> >}
> >
> >class B extends A {
> >}
> >
> >class C extends B {
> >}
> >
> >class D {
> >}
> >
> >I currently have:
> >
> >declare parents: everything.* implements LeastDerived;
> >
> >However, what I want is for only class A and D to have that applied to
it.
> >
> >Thanks,
> >
> >-joel
> >
> >_______________________________________________
> >aspectj-users mailing list
> >aspectj-users@xxxxxxxxxxx
> >http://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top