Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Should I use code- or annotation-style aspects?

I started using AspectWerkz in stead of AspectJ a few years ago because it allowed me to use my favorite editor, but now with the very good Eclipse integration I use the code-style of aspectj to write my aspects and do the rest of my development in IntelliJ.
The annotation style has some drawbacks:
- not everything is supported (although I'm sure that will be ok in the future)
- you need to use FQN in your annotations: in code style you can use normal import statements, but this does not work in annotation style.
- I have no clue if the tools in Eclipse still work with annotations?
- It is probably easier for typo's to go unnotices in an annotation-style?

regards,

Wim

2006/6/28, Martin Börlin < borlin@xxxxxxxxxxx>:
All,

In startup of the project I'm currently working on we have decided to
use load-time woven AspectJ aspects. Since none of us have worked with
AspectJ before we are debating whether we should use code-style or
annotation-style aspects. I have tried both ways and they work fine in
our environment (AspectJ 1.5.1a, Eclipse AJDT 1.3.1, Java 5, Tomcat
5.5.12).
BUT which style do you reckon is better in the following cases:
a) Maintainability - once we hand the application over to the
maintenance team (which currently have no experience of AspectJ, nor
code-style nor annotation-style). I.e. is one style easier to
understand/learn and maintain than the other.
b) "Future proof" - will either code- or annotation-style be the
industry standard (your gut feeling). Or will they live in perfect
harmony?
c) Drawbacks - which are the drawbacks using annotation-style over
code-style spoken of in the AspectJ FAQ, http://www.eclipse.
org/aspectj/doc/released/faq.html#q:codeversusannotationstyles

many thanks
-Martin Börlin
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top