I have a problem making method calls between methods in same class and having transaction advice apply.
Spring Framework .NET documentation states that it supports compositional and inheritance based proxies and that you can force spring to create inheritance based proxies (proxies without target) to be instantiated.
However, it turns out that even 'inheritance based proxies' are not what they claim. They do inherit target class rather than it's interface(s), but they still use target object. This leads to the fact that on calls between methods in same class advices are not applied.
Admittedly, Spring makes it available to do this with some effort using InheritanceBasedAopConfigurer
but you still have to list objects you want to apply this to and advice you want to apply to them.
Why is Spring jumping through hoops to avoid real inheritance based proxies? What anti-pattern am I missing?
I can see multiple reasons:
1) Implementation more complicated. IoC container manages instance, and to apply pure inheritance based proxies, you need to work on the type. That's what 'InheritanceBasedAopConfigurer' does: it changes the type before container initialization.
2) You need to mark your method as virtual if you want AOP to work. It's not intuitive.
3) Composition based proxies forces design by interface which is a good practice.