"Spring: A Developer's Notebook".
Moving a well-designed plain-ordinary-Java-object (POJO) application to Spring is straightforward. It only takes three steps:
Refactor your code to take advantage of dependency injection. Model objects are beans, and services are aspects. Usually, you'll only have beans.
Remove the code that instantiates the objects and sets dependencies.
Build a configuration file describing your beans and aspects.
Access your code through Spring.
Since our individual parts are already built to take advantage of dependency injection, moving to Spring is an easy exercise. We simply replace our assembler with a Spring version, and provide a configuration file which will go in the \war\WEB-INF folder.
Example 1-9 shows the configuration file.
(thousands of bytes of XML)
It was a few months after wading through nine circles of JAR hell that I realized a better life existed and became a rails programmer.