Oct 16th, 2008, 04:00 AM
Step-Into problem with method interception
I use the AOP functionality (with Dynamic Proxies) of Spring. This functionality is very handy when implementing cross-cutting concern and saved me a lot of boilerplate coding (as the literature always promised me).
But when it comes to debugging AOP makes my life harder: when you step-into the intercepted method then you first meet the Spring AOP infrastructure. After finding the right positions where to step into, you get to the interceptors that are applied on the target. After you passed all interceports you finally get to the intercepted target (the place where you originally wanted to get to).
Of course you can set a breakpoint at the intercepted target and resume the execution to this breakpoint, but this isn't very intuitive when debugging. Furthermore, there is no need to debug through the AOP infrastructure or the interceptors most of the time. Application programmers normally are not interested in die AOP functionality (because it contains infrastructure cross-cutting concerns) or even don't know what AOP is. For these people debugging gets very cumbersome and they do not understand what's going on.
Summing up, I'm searching for a solution how to step over the AOP code easily. There should be a possibility how application programmers do not get in touch with AOP, while leveraging the power of AOP in the background.
Are there any thoughts or strategies on this issue?
Thanks a lot for any hints,
Oct 16th, 2008, 06:45 AM
There is no way to exclude aspects from debugging in accordance with debugging facilities offered by JVM. The main problem is that JVM is unaware of aspects, the whole AOP stuff is provided by external frameworks, JVM just executes byte code instructions that include AOP code as well.
Oct 16th, 2008, 08:04 AM
Thanks for the reply.
My thoughts tend to go in another direction (not at byte-code level):
One idea I had is to adapt the debugger of the development environment (I use Eclipse, so I could extend the debugger plugin) to automatically step over certain pre-defined classes. For example, the spring AOP infrastructure classes and my interceptor classes.
Oct 17th, 2008, 12:59 AM
I agree that this is a problem. If you find any good solutions, please let med know ;-)
Nov 10th, 2008, 04:35 AM
I found a possible solution to the problem: Eclipse supports so-called "Step Filters". You can exclude all Spring AOP classes/packages with these Step Filters. So these classes are automatically stepped-over when trying to step into an intercepted method.