|
From: <rod...@in...> - 2003-05-23 16:15:52
|
>My question is what is the difference between Spring AOP and AspectJ? What spaces are each trying to fill? etc. Quick reply... I'll have to do an AOP FAQ at some point. 1. AspectJ is a language extension. Spring AOP uses dynamic proxies, so there's no language extensions and no special compilation steps. Spring AOP enables aspects to be used with beans in Spring bean factories. Thus use of AOP is hidden behind interfaces as an implementation detail. AspectJ is much more powerful than any other AOP solution (as it introduces new keywords and constructs) but there's a learning curve and it's arguably *too* powerful (it's possible to do things that might be problematic in large projects). 2. JBoss AOP is promising but it's linked to the container. To my mind, this is wrong. I don't want EJB to tie me to the container without good reason; I also don't want a container- only AOP solution. Also it means giving up J2EE portability. Spring AOP doesn't do anything weird with class loaders, so it works in any container. Also, JBoss AOP is more complex to use, from what I've seen. It's more powerful in that it allows you to intercept field access (as does AspectJ), but IMHO this breaks good practice anyway. (Just because we're using AOP, we don't want to throw out encapsulation.) 3. The most similar product is probably Jon Tirsen's Nanning (SF). Jon and I even worked on an interoperability API, enabling the same interceptors to run in each AOP framework, but Jon isn't going to implement it in the near future (although Spring does already). Nanning is pretty similar in what it can do, although it isn't integrated into a bigger picture as is Spring AOP. Spring AOP is about pragmatic use of AOP, right now. Declarative transaction management is already available, and a good example of what can be done. Regards, Rod |