Aspects applications

Hi EAP-members!

A lot of votes have been given to the AspectJ support feature:
http://www.intellij.net/tracker/idea/viewSCR?publicId=2424

Could you share we us your thoughts about Aspect applications you may think
about?
Why would you like to use / not to use aspects in your code?
Any comments are welcome.

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


0
Avatar
Chernyshenko Dmitry

Completely agree.

0

Guillaume Laforge wrote:

I definetely agree with you.
As it's soon Xmas, it makes me think that AspectJ is a kind of new toy that
all children'd love to have, but wouldn't really play with.
Whereas, on the other hand, Generics is what they'd really use in their day
to day job.


I don't know enough about aspects to know whether it would be useful to
me or not, but it seems to me that generics are a more basic feature
that should definitely be supported (and I've voted for it at
http://www.intellij.net/tracker/idea/viewSCR?publicId=7090).

The extensions in JSR 201 are also very interesting, but they don't seem
to be as close to being finished so I guess implementing them will have
to wait. For those of you who haven't read that JSR, it has to do with:

Typesafe enumerations:
public enum Color { red, green, blue }
Color c; switch (c) { case red: ... }

Autoboxing:
Automatically converting to/from Integer, Double, etc.

Enhanced for loop:
Collection]]> c; for (String s : c) { ... }
int[] arr; for (int e : arr) { ... }

Importing static members:
import static Math.abs;
System.out.println(abs(-2));

0

Thomas Singer wrote:

Sorry, but I would not count the votes too much, because one can
create a dozen accounts and vote with hundret points for an issue.

The problem with AspectJ seems to be (at least for me), that nobody
showed a useful, explained example. In the opposite, all developers
use collections and definitely would benefit from type-safe
collections (aka "Generics").

Maybe I'm just missing the key-point of AspectJ...


Explaining the benefits of AOP (aspect-oriented programming), of which
AspectJ is the most successful manifestation so far, is akin to
explaining the benefits of object oriented programming to a life long
procedural programmer: huge resistance. You'll need to experiment with
AOP some yourself-- you are the only person who'll be able to convince
yourself.

Although I work fulltime, I happen to be finishing a graduate course in
Object-Oriented Systems and Languages (with a final Monday!). We
examined a number of proposed programming extension that are designed at
extending or at least enhancing the OO paradigm including AOP, Adaptive
Programming, and Subject-oriented Programming. Of these and others, AOP
is the one that is getting traction in the academic, research, and
industrial worlds. AspectJ is an imperfect and incomplete
manifestation of AOP (although getting better), but it is a start that
some in the industry are finding useful. Again, to do AspectJ justice
and not shortchange yourself, you need to spend some time with it to
decide for yourself.

Jon

P.S. Generics support is clearly important too.

0

Here's a decent article that gives a few simple examples.

http://www-106.ibm.com/developerworks/java/library/j-aspectj2/?open&l=007,t=gr

I use it in a similar way in my code. I can remove all test and diagnostic "pollution" from my production code. For example, I have code that does some validation and filtering that's pretty sensitive to what you input. Aspects allow me to shortcut this validation and always return true during testing (of other parts of the application). Sure, I could turn it off and on with a system property or flag, but I think it's much cleaner this way.

I really think you should give their programming guide a thorough read. It's well written and has several examples.

http://aspectj.org/doc/dist/progguide/index.html

As for the votes, yes, you could sign up several accounts. That applies to all features (including generics ;o), so there's a cancelling effect to some extent. But you're correct, the system can be gamed. Maybe the intellij guys should tie accounts to keys, or if they still have free accounts, give the keyed account votes more weight.

0

请先登录再写评论。