On 2/22/07, Wesley Wannemacher <[EMAIL PROTECTED]> wrote:
I don't know much about Spring and shied away from servlet context listeners because I didn't want the external dependencies. I'm not suggesting that my way is the best way, but if you have a requirement to write unit tests for all of your code, then it's easier to stay away from the Servlet API.
That is absolutely true. Then again, static initializer blocks can bring headaches of their own. I have never been very comfortable with them. I find that using Spring steers one to design code that is eminently unit testable, to the point where one need not use Spring in testing; one can simply satisfy a few simple dependencies as Spring would, and let the tests run. This is ultimately more a factor of designing for dependency injection than a characteristic of Spring itself, but I like Spring so... One of the great strengths of Struts 2 is that it does a much better job of hiding the Servlet API, making for components which are much more plausibly unit-testable. Joe -- Joe Germuska [EMAIL PROTECTED] * http://blog.germuska.com "The truth is that we learned from João forever to be out of tune." -- Caetano Veloso