The Castle Windsor Inversion of Control Container - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

The Castle Windsor Inversion of Control Container

Description:

... MonoRail MVC framework for ASP.NET ActiveRecord based on NHibernate Reporter with Windsor How dependencies are resolved Pros? Simpler component architecture ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 16
Provided by: mhad7
Category:

less

Transcript and Presenter's Notes

Title: The Castle Windsor Inversion of Control Container


1
The Castle Windsor Inversion of Control Container
  • Mike Hadlow
  • mikehadlow_at_yahoo.com
  • mikehadlow.blogspot.com

2
Whats wrong with this code?
3
IoC Reporter
4
We can now test Reporter
5
IoC Component Oriented Dev
  • Wikipedia says
  • Multiple use
  • Non context specific
  • Composable with other components
  • Encapsulated
  • A unit of independent deployment and versioning

6
What is an IoC container?
  • A (very) smart factory
  • Automatically resolves dependencies
  • Automatically injects concrete instances
  • All services are registered in the container
  • Single point of access for services
  • Transparent
  • Various implementations for .NET

7
Castle MicroKernel / Windsor
  • Part of the Castle Project castleproject.org
  • Started by Hamilton Verissimo
  • Also includes
  • MonoRail MVC framework for ASP.NET
  • ActiveRecord based on NHibernate

8
Reporter with Windsor
9
How dependencies are resolved
IReportBuilder
Reporter
IReportSender
10
Pros?
  • Simpler component architecture
  • Reduced cost of change
  • Easy to unit test
  • Easily move between application configurations
  • Ready made configuration (IoC containers)

11
Cons?
  • Not another thing to learn?
  • Higher level of abstraction
  • Cant do obfuscation and configuration

12
Should I use it?
  • Already familiar with OO principles and patterns?
  • Already writing unit tests?
  • If not, learn how to do these first
  • Dont impose an IoC container on a team which
    cant see its benefit

13
A Real Application
  • http//code.google.com/p/sutekishop/
  • http//sutekishop.co.uk/

14
Resources
  • Castle Project castleproject.org
  • Oren Eini ayende.com/blog
  • Alex Henderson bittercoder.com

15
Questions?
  • Mike Hadlow
  • mikehadlow_at_yahoo.com
  • mikehadlow.blogspot.com
Write a Comment
User Comments (0)
About PowerShow.com