Article: Dynamic Routing Using Spring and AOP
Read Dynamic Routing Using Spring framework and AOP.
Re: XML sample not showing correctly
by
William Louth
regards,
William
Re: XML sample not showing correctly
by
Vigil Bose
We fixed the XML sample code as far as I could see. You know how things get messier when it gets to convert XML tags into HTML. Thanks Alef for posting the article in your blog about using Hibernate Session API directly in the data access code.
Regards
Vigil
Re: XML sample not showing correctly
by
Vigil Bose
You could also apply the classic decorator pattern implementation to add custom behavior before and after the actual business service method invocation without using AOP in the examples shown in the article. AOP is more powerful and has got a variety of advices you can choose from, depending upon the need. The framework offers the choice and you have the freedom to make an informed decision as to which option best suits your particular use case or scenario.
Regards,
Vigil
Re: XML sample not showing correctly
by
Cristian Herling
I agree with you saying that the component doing the work of the advice should actually reside outside of the advice, this way this component can be used outside AOP. I think AOP should be used mostly for binding a component to another component transparently.
Re: XML sample not showing correctly
by
Alef Arendsen
The architectural problem: What is the best use of AOP?
by
samuele pretini
So, during my studies I had always read that AOP is usefull when is necessary to model a cross-concern, to alleviate (as say William Louth), and evitate to write some boilerplate code in all the class that we intended to proxy. Example of this concept is the logging problem or the exception managing problem. But really I had read wath sustain Vigil Bose: the potential of AOP is significant, and it potential is not be relegate only to managing of logging, exception, etc..but it must be used also in al the situation to improve the quality of the software, regarding the readability, elegance, and obviously to separate the concerns.
William say also that is important first to write the code without the AOP advice action in field, and than apply this action of the code already working, to apply other functionality.
So in conclusion, is better for you, write (or thinking) the code from start with or without the help of AOP concept?
Thank at all.
Samuele Pretini
Re: The architectural problem: What is the best use of AOP?
by
Jason Carreira
Spring ApplicationEvents instead?
by
M. DeFazio
Re: Spring ApplicationEvents instead?
by
Jason Carreira
Of course, maybe they've fixed all of this stuff?
Re: Spring ApplicationEvents instead?
by
M. DeFazio
to your comments:
Basically every event is passed to every listener to decide if it should handle it
True, I'd suggest having a single "EventDispatcher" bean as an app listener that can filter/dispatch events to the appropriate places...make event listeners run asynchronously...
Spring 2.0 allows the SimpleApplicationEventMulticaster to pass in a TaskExecutor (i.e. AsynchTaskExecutor to run things asynchronously... then you wont be blocking on each execution)
...I agree that a centralized event system is a big value add in an app(Especially for trying to hook things up to support "operations"). Currently we are using the existing Spring Event infrastructure for cache refreshing, additional exception support (providing discrete "files" for critical app exceptions) and some other tooling, I've been impressed and it's worked exceptionally thus far.
It'd be cool if we had a good, standard way of doing this...
Re: The architectural problem: What is the best use of AOP?
by
William Louth
I did not advocate placing the transaction management code in every service method just like EJB does not force you to do this today. But if you wanted too you could still do it.
CH' post above did a much better job at explaining my viewpoint.
"AOP should be used mostly for binding a component to another component transparently."
And it should not be all or nothing at least for most systems and applications.
Educational Content
Concurrency in Clojure
Stuart Halloway May 17, 2013
Confessions of an Agile Addict
Ole Friis Østergaard May 16, 2013
Web Development: You're Doing It Wrong
Stefan Tilkov May 16, 2013
Programming The Feynman Way
Ben Evans May 15, 2013





Hello stranger!
You need to Register an InfoQ account or Login to post comments. But there's so much more behind being registered.Get the most out of the InfoQ experience.
Tell us what you think