4. Unity “The Unity Application Block (Unity) is a lightweight extensible dependency injection container with support for constructor, property, and method call injection.” http://unity.codeplex.com/
5. Definiamo un contratto public interface IOperazioneMatematica { int Esegui(int a, int b); }
8. Utilizzo del container // Richiesta del servizio di calcolo var operazione = container.Resolve<IOperazioneMatematica>(); // Utilizzo del servizio int risultato = operazione.Esegui(1, 2);
9. Injection [InjectionConstructor] Per marcare un costruttore da utilizzare esplicitamente. In assenza viene usato il costruttore con il maggior numero di parametri. [Dependency] Marca il setter della property [InjectionMethod] Marca un metodo di inizializzazione
11. Castle Windsor “The Castle MicroKernel is an inversion of control container that was designed towards extensibility. It combines facilities to grow orthogonally.” Castle Windsor aggregates the MicroKernel and exposes a powerful configuration support. It is suitable for common enterprise application needs. It is able to register facilities and components based on the configuration and adds support for interceptors http://www.castleproject.org/container/index.html