Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] pointcut on termination of java program

> Wes Isberg wrote:
> > You can register to be called on VM shutdown:
> >
> >   Runtime.getRuntime().addShutdownHook(..)
> Thanks, I didn't know that. It does perfectly what I want it to do ;)
> Jan Van Besien

This sounds like the beginning of some anti-aspect patterns. By which I
mean solutions that could be done in an aspect-oriented manner that are
better done in OO or even procedural styles. In general I think when an
AOP and non-AOP solution can solve the same problem then the non-AOP
solutions should be used.

I'm thinking that examples where aspects can but shouldn't be used could
also be a useful tool for teaching aspects. It would be further
instruction of the semantics, but also a better style guide. And already
I'm maintaining an AspectJ program that has some spaghetti aspects that
I've been removing. (Another anti-pattern I've seen in the overuse of
abstract aspects, much like the overuse of inheritence when composition
would be better in an OO program.)

What do you guys think?
-Macneil



Back to the top