[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[aspectj-dev] Request for @this()... syntax consideration
- From: Ramnivas Laddad <ramnivas@xxxxxxxxxxxxxxx>
- Date: Thu, 27 Jan 2005 11:52:29 -0800
- Delivered-to: email@example.com
- User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
Compared to the current @this(@Foo), I prefer the @this(Foo) form. Of
course, the same goes for @target(), @args(), and @annotation() forms.
Note that there is no fundamental issue here, just the aesthetics.
1. Since @this() can take only an annotation type as the parameter, @ in
front of Foo is redundant.
2. The @ form is used in Java to supply annotations instances. However,
the @ form is not used with annotation types on the consumer side
(reflection etc.). Basically, annotation types are treated no
differently than other types.
3. It makes modifying pointcut to capture context aestehtically less
pleasing. Consider the following pointcut in the current form:
pointcut thisHasFoo() : @this(@Foo);
If now I want to capture the annotation instance, I need to modify
the pointcut as follows:
pointcut thisHasFoo(Foo foo) : @this(foo);
Since Foo is a real type, I can't use "@Foo foo". This means @ is
used with Foo depending on where it is specified in the pointcut even
through it serves the same purpose in both forms.