Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ 1.x language and AspectJ 5 annotations: which style should I use

As Wes points out, there are still some questions around the exact
final release date for annotation style aspects in AspectJ 5, and the
support for those in AJDT, but those sounds like short term issues.
(my .02 - I don't buy the "not tested as much as code style"
considering how the annotation style aspects are hooked in the AJ code
base)

The choice is more likely to depend on the requirements you and your team have.

Annotation style aspect may lower the barrier to start with AOP since
you will manipulate plain Java aspect, and if your team is not relying
on Eclipse, or is using some third parties tools for which there is no
good support for code style aspect, that might be a higher
psychological barrier and change in the way development is done for
code style aspects.
Code style aspect - once adopted - will allow you to leverage on
better IDE support *for now* when running in Eclipse AJDT.
One good question is then: is it you first AOP project ? How much your
team knows about AOP ?

Aside this style choice, code style aspects can do things annotation
style aspects cannot : privileged aspects, intertype declaration
(without mixin style), declare parents ... extends (change the super
class of a class).
So another good question is then: how much will you use or need those features ?

Unfortunately we don't have shipped yet any annotation style tutorial
so that you can give a try to both by really working with and running
things. The closest user experience would be to try code style AspectJ
and annotation style AspectWerkz for now, on top of a Java 5 VM.

Alex



On Mon, 28 Feb 2005 11:24:31 +0800, Guofeng Zhang <guofeng@xxxxxxxxxxxxx> wrote:
>  
>  
> 
> Hi, 
> 
>   
> 
> If our new project is run on JVM 5 and the project might start after April
> when the AspjectJ 5 is official released, should I use Aspject 5 annotations
> or use AspectJ 1.x. styled pointcut syntax in the project?. This is our
> first project that uses AspectJ in its core component. 
> 
>   
> 
> As the developers of AspectJ 5, what do you recommend? 
> 
>   
> 
> We want to use consistent AspectJ sytanx in the future projects, your advice
> is appreciated. 
> 
>   
> 
> Thanks 
> 
>   
> 
> Guofeng 
> 
>


Back to the top