Practical Inversion Of Control Matt Hinze
Agenda What is this talk about The what and why of IOC How to do it Usage scenarios
?
EmailSender
WorkflowStepper
 
 
new
Relationship is  set at compile time.
new  isn’t always viable.
 
Inversion of Control A concept Relinquishing the responsibility of managing dependencies. Dependency Injection A pattern Constructor injection Property injection
 
 
 
 
 
 
 
There is no  new
Some Benefits Enumerated Testing Reuse Simplicity Construction velocity Fun
Don’t use the tool where you don’t need it, in most tests for example. Think of the tool as a “composer” instead of a “container”; minimize entry points. Prefer constructor injection. Try to avoid “contextual binding”; avoid magic strings; favor convention over configuration.
Useful Resources StructureMap documentation Autofac documentation Martin Fowler Jeremy Miller Tool-specific mailing lists
 
For More I teach a course in which we do this stuff for three days.  We build features in a real system using agile principles and the tools that enable them. For more information:  http://www.headspringsystems.com/training/

Practical Inversion Of Control

  • 1.
    Practical Inversion OfControl Matt Hinze
  • 2.
    Agenda What isthis talk about The what and why of IOC How to do it Usage scenarios
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
    Relationship is set at compile time.
  • 10.
    new isn’talways viable.
  • 11.
  • 12.
    Inversion of ControlA concept Relinquishing the responsibility of managing dependencies. Dependency Injection A pattern Constructor injection Property injection
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
    Some Benefits EnumeratedTesting Reuse Simplicity Construction velocity Fun
  • 22.
    Don’t use thetool where you don’t need it, in most tests for example. Think of the tool as a “composer” instead of a “container”; minimize entry points. Prefer constructor injection. Try to avoid “contextual binding”; avoid magic strings; favor convention over configuration.
  • 23.
    Useful Resources StructureMapdocumentation Autofac documentation Martin Fowler Jeremy Miller Tool-specific mailing lists
  • 24.
  • 25.
    For More Iteach a course in which we do this stuff for three days. We build features in a real system using agile principles and the tools that enable them. For more information: http://www.headspringsystems.com/training/

Editor's Notes

  • #2 SLOW DOWN BIG GUY About me mhinze.com Why I am giving this talk