O'Reilly logo

Professional Java™ Development with the Spring Framework by Colin Sampaleanu, Thomas Risberg, Alef Arendsen, Juergen Hoeller, Rod Johnson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Advanced Container Concepts

In the previous chapter, we focused on the core functionality of the Spring bean factory and application context, as well as the concepts of Inversion of Control and Dependency Injection that they are based on. You now know how to configure, initialize, and use a Spring container well enough to handle a number of development use cases and scenarios.

In this chapter we are going to examine some additional, more advanced container capabilities. We are also going to discuss a number of advanced container configuration and usage strategies. A good understanding of most of the content of this chapter is a key to using the Spring container in the most efficient and effective way possible.

This chapter examines:

  • Spring's Resource abstraction for accessing low-level resources

  • How the application context can act as a source for localized messages

  • The simple eventing mechanism supported by the application context

  • A number of tips and strategies for creating and managing the container

  • Some handy factory beans that make it much easier to handle some configuration requirements

  • Strategies for handling testing concerns

  • Alternatives to XML as the definition format for container configurations, including definitions in Properties format and programmatic definitions

Abstractions for Low-Level Resources

Spring contains a useful abstraction for describing various types of simple resources, as found on the filesystem or classpath, or accessed via a URL. This is the Resource ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required