Chapter 10. Castle Windsor

 

Menu

  • Introducing Castle Windsor
  • Managing lifetime
  • Working with multiple components
  • Configuring difficult APIs

In the previous nine chapters, we discussed patterns and principles that apply to DI in general, but, apart from a few examples, we have yet to take a detailed look at how to apply them using any particular DI CONTAINER. In this chapter, you’ll see how these overall patterns map to Castle Windsor; you’ll need to be familiar with the material from the previous chapters to fully benefit from this.

Castle Windsor is the second-oldest DI CONTAINER for .NET. It’s part of a larger open source project known as the Castle Project[1] that provides reusable libraries for many purposes. Windsor is the DI CONTAINER part of the Castle Project, but it can be used independently of any other Castle component. In this chapter, we’ll review it as a stand-alone component.

In addition to being one of the oldest DI CONTAINERS, Castle Windsor is one of the most mature and, if we’re to believe several totally unscientific internet polls, most popular containers. Although it’s fairly easy to get started with Windsor, it offers a rich and extensible API.

10.1. Introducing Castle Windsor

10.2. Managing lifetime

10.3. Working with multiple components

10.4. Configuring difficult APIs

10.5. Summary

sitemap