Chapter 11. Rapid Spring Development with Spring IDE

There is no doubt that the Spring framework offers a lot of very useful and powerful features for Java development. These features should be leveraged in as noninvasive a way as possible: application code is not required to have any dependency on Spring APIs. All configuration of application and infrastructure components as well as their collaboration is done using one or several Spring bean definition files. Using Spring's external configuration files enables you to separate configuration concerns from application code.

Spring bean definitions are XML files, based on DTD or XML schemas. You have already learned about the format and syntax of Spring bean definition files in the previous chapters, and you have seen that writing these definition files is very straightforward from the beginning on. It requires only a moderate amount of XML writing and some knowledge of Spring's infrastructure XML elements and components.

But as your application grows the configuration will get more complex — most of all if you don't break your bean definitions into different logical files depending on application layering. The bean definition will get hard to read, maintain, and test. More importantly, editing complex Spring configuration files could be an error-prone operation. For example, writing fully qualified Java class names or editing Spring bean references can result in mistakes that are not discovered until the execution of unit or integration ...

Get Beginning Spring Framework 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.