Re:An Opinionated Guide to Modern Java Development, Part 1
by rymndhng on Thursday May 01, 2014 @12:20PM
(#7680728)
It depends. One thing that I thought is an interesting feature of Spring, is that it allows the framework to inject code between your dependencies like decorators. This allows them to do aspect-oriented-programming transparently. And I think there's some interesting ideas here. For example, you can mark the interface of a class as @Transactional, and all your implementations will get the behavior.
[ Parent
| on HN ]
Re:An Opinionated Guide to Modern Java Development, Part 1
by UK-AL on Thursday May 01, 2014 @01:51PM
(#7681454)
I think that's the interception way of AOP? Unity IoC in c# also does this.
The IoC container will return transparent proxy(Not the original object), which then calls the underlying method(after doing the AOP behaviour).
Re:An Opinionated Guide to Modern Java Development, Part 1
by Glide on Thursday May 01, 2014 @05:36PM
(#7682840)
Be careful of using these though.
I had an obscure bug using dynamic proxy (castle dynamic proxy2) a while ago in a WPF application. I was proxying to an interface so it created a proxy object in between that in the actual class so it was eating my C# event. Changing the proxying from an interface to a subclass fixed it.
Boy that was a fun one to figure out.