http://trongbang86.blogspot.com
http://twitter.com/trongbang86
Kurt Xu wrote:Hi, I think you should change greetingServiceTarget's singleton to true, or just not set the attribute ,cause it is true by default.
http://trongbang86.blogspot.com
http://twitter.com/trongbang86
Mark Spritzler wrote:I also recommend using the link to the Documentation I posted in that other thread you posted in that got me to this thread.
Those introductions uses Annotations in an Aspect class, that is much nicer loose coupling than having a class extend a Spring class. Now that class is tightly coupled to Spring. Whereas with an Aspect class and annotations on the method to add, you can still run that code as Plain Java code without having anything Spring related in your classpath at runtime.
Thanks
Mark
http://trongbang86.blogspot.com
http://twitter.com/trongbang86
Bang Nguyen wrote:
Kurt Xu wrote:Hi, I think you should change greetingServiceTarget's singleton to true, or just not set the attribute ,cause it is true by default.
Hi, it will not work. Moreover, this is not what we intended to do. Because just imagine the greetingServiceTarget is some JavaBean in our domain such as Student, Class, Course. From that, we can see that those objects must not be singleton. Otherwise, they will store dirty data from the same object type.
When we imagine this greetingServiceTarget as Student, Class Objects; we can see that sometimes we want to lock some specific services of these objects. That's the intention of this example.
Anyway, thanks for your contribution! Please give more suggestions so we can study!
Bang Nguyen wrote:
Kurt Xu wrote:Hi, I think you should change greetingServiceTarget's singleton to true, or just not set the attribute ,cause it is true by default.
Hi, it will not work. Moreover, this is not what we intended to do. Because just imagine the greetingServiceTarget is some JavaBean in our domain such as Student, Class, Course. From that, we can see that those objects must not be singleton. Otherwise, they will store dirty data from the same object type.
When we imagine this greetingServiceTarget as Student, Class Objects; we can see that sometimes we want to lock some specific services of these objects. That's the intention of this example.
Anyway, thanks for your contribution! Please give more suggestions so we can study!
Mark Spritzler wrote:
Bang Nguyen wrote:
Kurt Xu wrote:Hi, I think you should change greetingServiceTarget's singleton to true, or just not set the attribute ,cause it is true by default.
Hi, it will not work. Moreover, this is not what we intended to do. Because just imagine the greetingServiceTarget is some JavaBean in our domain such as Student, Class, Course. From that, we can see that those objects must not be singleton. Otherwise, they will store dirty data from the same object type.
When we imagine this greetingServiceTarget as Student, Class Objects; we can see that sometimes we want to lock some specific services of these objects. That's the intention of this example.
Anyway, thanks for your contribution! Please give more suggestions so we can study!
In the scenario of Domain objects, which won't be Spring beans because they hold state, that is where you can go to AspectJ and Bytecode instrumentation to get it done.
Mark
http://trongbang86.blogspot.com
http://twitter.com/trongbang86
What's brown and sticky? ... a stick. Or a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|