Im works with Spring Framework 3.0.5 and Spring Security 3.0.5, and Ive have questions about aspect-oriented programming. Im currently trying to figure out the disadvantages and advantages of aspect oriented programming. Of course, I know them theoretically: I can avoid redundant code, I only need to make changes to the aspect, and not everywhere in the code and so on. But I still have questions:
The disadvantage I discovered is:
I wrote a sample application using aspects with Spring AOP. I set up the aspect with annotations (@Pointcut, @Before, @Aspect, etc.). The methods that triggered the aspect (which, of course, was part of Pointcut, of course) were, of course, part of another class, and not annotated by anything.
=> I really think that one big drawback is that when looking at these methods of another class, it was not clear that they caused the aspect. They do not need any annotations or anything else, they were just mentioned in the pointcut aspect. (I really hope you understand what I mean). So I think AOP makes the code less clear!
a) Is there a solution to this problem? (Maybe this can be solved when I put the whole configuration in an XML file? I don’t think so.)
b) Will this problem exist when I use AspectJ instead of Spring AOP?
Springs features with Spring AOP: don't they have this flaw?
How Spring AOP is part of many Spring features (just like declarative transaction management or (possibly) Spring Security (?)). I carefully reviewed these features. I could not find any flaw.
c) : (@transactional), , . , . ( @transactional ) , - , , AOP ? , , , ? !
, !: -)
EDIT: a) b) ( IDE, ), c) : -)