That eliminates some of the boilerplate, but now add the line noise of having to code up a class or anonymous inner class that implements the interface. But Java is a verbose language, you just have to learn to love it. :roll: [ November 28, 2008: Message edited by: Garrett Rowe ]
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Note that the signature of the method "example" is changed to accept a Session object.
Joined: Nov 28, 2008
Thanks for the many suggestions!
Is there a way around the session method parameter in the AspectJ solution?
If I have a method without session and change my implementation so that suddenly I do need a session, then I would have to change my interface because of the additional session parameter. Furthermore, the calling class now needs to make the call to getSession(), which adds overhead somewhere else. In most cases, the SessionPool is injected by Spring configuration.