Chapter 12. Spring.NET

 

Menu

  • Introducing Spring.NET
  • Managing lifetime
  • Working with multiple components
  • Configuring difficult APIs

In the previous chapters, you saw how to map the principles and patterns from parts 13 to Castle Windsor and StructureMap. In this chapter, we’ll do the same with the Spring.NET DI CONTAINER.

Together with Castle Windsor and StructureMap, Spring.NET belongs to the set of “first generation” DI CONTAINERS on .NET. It appeared in 2006, and even today it still offers basic support for .NET 1.1. It’s a port of the Java version of the Spring Framework, which is a big and comprehensive application framework that addresses many different aspects of software—not only OBJECT COMPOSITION. The DI CONTAINER is one of the many components available in the framework, but it can perfectly well be used as a stand-alone component without the need to reference any of the other Spring.NET components.

In this chapter, we’ll focus on the Spring.NET DI CONTAINER while ignoring the rest of the application framework. As in the previous chapters and in those to follow, we’ll examine how Spring.NET can be used to apply the principles and patterns set out in parts 13. Figure 12.1 shows the structure of the chapter.

Figure 12.1. This chapter is divided into four sections. The first section introduces the Spring.NET container API and should be considered a prerequisite for the next three sections. Each of these can be read independently of each other.

12.1. Introducing Spring.NET

12.2. Managing lifetime

12.3. Working with multiple components

12.4. Configuring difficult APIs

12.5. Summary