Raistlen Majere wrote:I think you may be right on target but I will have to do some more research.
If I have 100 apps, and everyone of their execute methods needs to log "I'm Executing!" (just an example), do all 100 apps need proxies set up in spring?
Thanks for your reply and I will look into annotations.
Still a bit confused 100 apps each of them Spring apps?
I don't understand "do all 100 apps need proxies set up in spring?"
Do you mean all different .war files each starts up their own Spring container, each with their own configuration
of
Do you mean one Spring application with over 100 beans in it.
In any case, if you want AOP there are three mechanisms to get that code to log. 1) Dynamic Proxies at runtime based on bean's interface. 2) CGLIB jar in your classpath, create proxies at runtime by extending your class. 3) AspectJ running ajc after compiling will add the code through byte code instrumentation, meaning the code is injected into you .class as if you had coded it there.
Now about proxies, I am sensing you think that proxies are a bad thing. Maybe that you think it slows things down. I can guarantee you, by experience and by actually timing things, proxies will not make a difference to your application, especially one that just logs a message. And that many servers out there use these Dynamic Proxy
pattern themselves, like all the app servers. If it was a bad idea, all of them wouldn't be using it.
Hope that helps.
Mark