This chapter has given you a good feel for what the terms Inversion of Control and Dependency Injection really mean, and how they are embodied in Spring's bean factories and application contexts. We've examined and used most of Spring's fundamental container functionality. It's upon the IoC container as a foundation that the rest of Spring builds, and good knowledge of how it works and is configured, along with all of its capabilities, is the key to effectively utilizing all of Spring.

You have seen how:

  • Using the container allows the use of one consistent, predictable mechanism to access, configure, and wire together objects, instead of using programmatic or ad hoc mechanisms that couple classes to each other and make testing harder. Generally, application or class-specific custom factories and singletons can be completely avoided.

  • The container encourages and makes easy the generally desirable practice of separating interface and implementation in application code.

  • Post-processors add the ability to customize bean and container behavior in a flexible, externalized fashion.

  • IoC principles, combined with the factory bean, afford a powerful means to abstract the act of obtaining or accessing services and resources.

  • IoC and the container provide a powerful base upon which Spring and application code can build higher value-adding functionality, without generally being tied to the container.

The next chapter looks at some more advanced capabilities of the application context, and will offer some advanced usage scenarios of the container in general.

Professional Java Development with the Spring Framework
Professional Java Development with the Spring Framework
ISBN: 0764574833
EAN: 2147483647
Year: 2003
Pages: 188 © 2008-2017.
If you may any questions please contact us: