Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ajdt-dev] ASM hierarchy model

Good question.  It definitely feels wrong for them to have the plain Java
kind, because the programmer and tools should treat them as advice.  But
there will be cases where the fact that they're annotated as advice needs to
be differentiated.  Also, it is feasible that down the road we could want
the annotation to be a separate program element.  I'm curious to see how the
JDT's IJavaModel ends up handling annotations and am not aware of any
mechanism for going from a declaration to an annotation.  Matt, do you know?

For now I suggest adding an isAnnotated() method to IProgramElement to
indicate whether or not this advice/pointcut/etc. is specified as an
annotation or as code.  Then simply setting the kind to be the AOP kind not
the OOP kind.  Not that you may be tempted to put this method and field on
the IProgramElement.Kind calss, which would be fine, but that typesafe enum
pattern should be switched to a Java 5 enum at some point.  If you agree,
and would like me to make the change just let me know.

Mik

> -----Original Message-----
> From: ajdt-dev-bounces@xxxxxxxxxxx [mailto:ajdt-dev-bounces@xxxxxxxxxxx]
> On Behalf Of Alexandre Vasseur
> Sent: Thursday, June 23, 2005 7:59 AM
> To: AspectJ Development Tools developer discussions
> Subject: [ajdt-dev] ASM hierarchy model
> 
> A question for Mik I guess.
> 
> For IDE support to work correctly, should the Hierarchy and
> Relationship model output by the weaver have correct "kind" for
> @AspectJ style member ie be flagged as IProgramElement.Kind.Advice,
> Aspect, Pointcut etc. ?
> 
> f.e. with
> 
>       SingletonAspectBindingsTest  [class]
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java:30::1063
>         TestAspect  [aspect]
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java:74::2495
>           s  [field]
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java:76::2530
>           ...  [initializer]
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java:78::2555
>           TestAspect()  [constructor]
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java:82::2604
>           aaround(ProceedingJoinPoint)  [method]
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java:90::2901
>           around2(ProceedingJoinPoint, Object)  [method]
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java:101::3273
>           before(JoinPoint.StaticPart)  [advice]
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java:113::3742
> ....
> === RELATIONSHIPS REPORT ========= After a batch build
> Hid:1:(targets=1)
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java|49|0|1568
> (advised by)
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java|128|0|4563
> Hid:2:(targets=1)
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java|90|0|2935
> (advises)
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java|45|0|1509
> Hid:3:(targets=1)
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java|101|0|3317
> (advises)
> C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> java|45|0|1509
> ...
> === Properties of the model and relationships map =====
> method=13
> import reference=19
> aspect=1
> constructor=1
> class=2
> advice=2
> ...
> we can see that TestAspect.java is flagged to be an aspect.
> Same for the method before, flagged to be an advice.
> But since I am in the middle of doing some changes, you can see that
> aaround(..) are flagged as methods.
> 
> Is AJDT supposed to work only from the advised-by / advises info or
> does this things matters ? (this because it means changing some in the
> ajdt.core to check if there are the @Aspect, @Before and so on
> annotations).
> (BTW with that, AJDT does not show up the markers and the cross
> cutting structure better, despite the advised by is correct in the
> problem view (when turned on).
> 
> Alex
> _______________________________________________
> ajdt-dev mailing list
> ajdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ajdt-dev



Back to the top