Bug 103646 - [ataspectj] @AJ declare annotation
Summary: [ataspectj] @AJ declare annotation
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-13 09:16 EDT by Alexandre Vasseur CLA
Modified: 2007-10-23 08:20 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Vasseur CLA 2005-07-13 09:16:10 EDT
to be implemented

note: some key difference with code style where a fake metod is used as:
ajc_declare_<n>, one per declare @xxx, no matter x

for @style, we can't have the user do that, so the user need to use explicit
fake structure: field, method, ctor(<n Fake arg !? empty ctor.. BAD), type (<n>
nested Fake type not so bad (we can say it must be an inner interface f.e.)

hence diff. in binary form with code style, + troubles witht the lang.reflect API

...
Comment 1 Alexandre Vasseur CLA 2005-07-13 09:16:43 EDT
M4 due to the language choice not that clean yet
Comment 2 Alexandre Vasseur CLA 2005-09-30 06:15:39 EDT
detailling some more


class A {}

say we have @Service for class and @Trace for method and ctor.

@Aspect
class MyAspect {

 @DeclareAnnotation(typePattern)//checks need to make sure this is a type
pattern and not a pointcut in that case
 @Service
 class Fake {}//ugly

 @DeclareAnnotation(method pattern)//checks..
 @Trace
 void fakeMethod() {};

// etc for ctor and field - very very ugly all those fakeXXX especially ctor
// we need to find a better way for that feature

}


}
Comment 3 Alexandre Vasseur CLA 2005-09-30 08:43:45 EDT
some other sample:

say @Trace has target on ctor only..

@Aspect
class MyAspect {

 @DeclareAnnotation(ctor pattern)//checks..
 @Trace
 MyAspect() {}
 // really odd don't you think ?
 // we usually don't code the aspect ctor

}
Comment 4 Adrian Colyer CLA 2005-09-30 13:52:04 EDT
Alex also posted this example of multiple declare @constructors in the same aspect:

@Aspect
class MyAspect {

  @DeclareAnnotation(ctor pattern)
  @AnnoA
  MyAspect() { } //dumb but acceptable

  @DeclareAnnotation(ctor pattern)
  @AnnoB
  MyAspect(int fake) {} // BAD - will never be call, and is even error prone

}

which is even more horrible.

I can't see an immediate nice way of doing this, and I'd prefer to do nothing than do something we 
regret and have to support going forwards. I propose that we don't implement support for declare 
annotation in the @AJ style for 1.5.0. That gives us the chance to see how strongly users request it, and 
to think about a better strategy for implementation in a 1.5.1 release.

If you agree, let's move this bug to "RESOLVED LATER" and take off the  M4 flag. 
Andy, I've put you on cc for this too....
Comment 5 Alexandre Vasseur CLA 2005-10-21 09:11:09 EDT
we all agreed to defer post 1.5
for now there is no post 1.5 so assign to 1.5
Comment 6 Adrian Colyer CLA 2005-10-28 06:44:01 EDT
moving to 1.5.1 as per Alex's last comment....