[Reprinted] Rod Johnson's text about AOP Transaction

zhaozj2021-02-16  83

[Original author] rod johnson [link] http://www.theserverside.com/news/thread.tss?thread_id=27208#129224 [Review] Rod Johnson, one of the founders, leaders and major developers, Rod Johnson, Say, naturally some components, although this paragraph is just saying that others say, but contains a lot of information, as follows:

Spring's AOP for Transaction Managing, due to the current TRANSAACTION implementation of Aspectj, Spring 1.1 will integrate AspectJ support, great! Spring 1.1 RC1 will be released soon, it is very likely that next week's weekend, it is worth looking forward to. [original]

Jacob

I recently read AspectJ in Action from Manning Press. It discusses transactions too, but through AspectJ and the resulting efforts are not container dependent. I think that Spring as an IoC container is great, but if people want Aspect Oriented features, just do yourself a .

Rod answer:

Aspectj Is a Great Language: No Argument There. I Also Like Laddad's Book. But Aspectj Is Not The Perfect Solution To All AoP Problems, And Offness, Lower-Tech, Solutions Are Compelling.

Transaction management is a case in point. For a lot of middleware aspects, which typically require only method interception, AspectJ's full power does not come into play, and it has no great advantage over Spring AOP, DynAOP or another proxy based framework. For example, Laddad's book is excellent, but the transaction examples are just that -. examples of how you might start work on transaction management in AspectJ Spring's transaction interception is way more powerful than anything I've seen implemented using AspectJ of course you can. implement whatever sophisticated of transaction interception you like with AspectJ - it's just that what really matters is how you abstract the underlying transaction infrastructure, not what AOP framework you use The performance overhead of a proxy-based approach is insigificant in such cases.So. The SUBSET OF AOP That Proxy-Based Solutions Provide. Such As Maintain Different Advice for Different Objects of The Same Class.)

Having said that, I believe that AspectJ is going to become increasingly important as we come to understand the full implications of AOP. So one of the major features in Spring 1.1 is AspectJ integration. This will allow AspectJ aspects to be configured by the Spring IoC container using Dependency Injection, which brings similar benefits to applying DI for classes. Both Adrian Colyer and I are very excited about this, and both Spring and AspectJ teams are working together. Support for the core AspectJ integration is already in Spring CVS and will be released with Spring 1.1 RC1 (probably end of next week). I'm also working on some samples, which will probably be released separately slightly later. The Spring / AspectJ integration opens up some interesting possibilities.Beyond that, we're looking at Used aspectj pointcuts to target Spring AOP Advice. This Relies ON Aspectj Changes - They Are Going to Expose An API for Spring and Other Tools To Use At Runtime.

Another interesting area is implementing Spring services as "native" AspectJ aspects. Thus we'll provide a transaction aspect, probably in the Spring 1.2 timeframe, although I might release it with the samples.

RGDS

Rod

转载请注明原文地址:https://www.9cbs.com/read-17334.html

New Post(0)