Home

Castle Stronghold

Getting Started

Castle MicroKernel and Castle Windsor might look like complex beasts at first, and for newcomers it might add more complexity to a system design than simplification.

That is because to use them properly you need to learn to develop loosely coupled system architecture. While this might sound simple or even obvious, in practice it is not. First of all you have to learn to give classes just one concern, one goal, one task (or family of related tasks) and preferably expose services contracts.

Nothing new so far, this is -- unarguably -- an OOP goal. But look at your application: are they really not tight coupled? Is there any code that request a service directly and configure it before using it? Aren't you using a Service Locator and a singleton and doing hacks to allow the classes to be testable?

Inversion of Control containers allow you to achieve loosely coupled designs and they handle dependency and configuration management when you, or a class in your system, request a service to say, send e-mails, you will get an instance ready to be used. If this sounds vague, keep reading and you will see what we are talking about.

This Getting Started tries to expose you kindly to the world of inversion of control using Castle Windsor. It is divided in three parts and we hope it covers all points newcomers have difficult learning.

Part 1 - Windsor/MicroKernel: The basics

Get acquainted with the container operations and its wiring capabilities.

Proceed with the Getting started - Part 1: The basics

Part 2 - Creating an application

Let's create a desktop application and see how Windsor Container makes some things different and simpler.

Proceed with the Getting started - Part 2: Creating an application

Part 3 - Using a Facility

Why not offer database persistence for the application we have developed? Using the NHibernate Facility might make this a simple task.

Proceed with the Getting started - Part 3: Using a Facility

Google
Search WWW Search castleproject.org