In the time it takes to read this message you could have voted twice. Login and vote now.
By veerasundark
via veerasundar.com
Published: Jan 13 2010 / 16:21
Article explains about the Spring Aspect Oriented Programming (AOP) with the use of a simple example of profiling method execution time.



Comments
MCII replied ago:
Vraa replied ago:
it doesn't have to be - security and transaction management are some other AOP use cases that I can think of.
William Louth replied ago:
And everyone of them implemented extremely poorly by developers who clearly do not understand either domain.
Vasil Remeniuk replied ago:
If profiling and logging are the only [horizontal] aspects of your applications - true... But did you consider caching, validation, transaction management? You can find more info here: http://vasilrem.com/blog/software-development/the-second-life-of-aop/
William Louth replied ago:
AOP is just glue - a thin one at that if you know what you are doing. You still need to know what you are doing in terms of designing the underlying caching, monitoring, tx mgmt framework which should be completely divorced from AOP itself.
Vasil Remeniuk replied ago:
Well, I'm not saying you don't need to design cache or monitoring :)
AOP helps keeping your business logic decoupled from purely technical aspects (components). With AOP you can design your caching, etc. in a reusable way. Say, if one day you decide, you don't need monitoring, the aspect can simply be turned off without any damage to your code. Secondly, AOP makes your code more maintainable, and decreases quantity or repeated code.
William Louth replied ago:
I don't think you need to tell me that but if you look at all the examples (even though in production) you see the AOP itself bloated with such concern that you cannot separate the concern itself from the AOP technology which should always be possible. We first design an Open API then we build various AOP SDK extensions on top of it using AspectJ, JBoss AOP, Spring AOP, Custom BCI,..... How many can truly say that this is the case within their aspect/advices? I see AOP as glue and nothing else.
William Louth replied ago:
No one is knocking AOP but for the most part it is just another excuse for a developer create yet another logging framework or stopwatch class.
Vasil Remeniuk replied ago:
A agree that the most developers use AOP in a very straightforward manner.
>> How many can truly say that this is the case within their aspect/advices?
Only those can do who tend to make their assets reusable, and care about good design :)
Voters For This Link (10)
Voters Against This Link (2)