1 / 18

Using an Inversion of Control Container in a real world application

Using an Inversion of Control Container in a real world application. Certified Mort. Mike Hadlow mikehadlow@yahoo.com http://mikehadlow.blogspot.com. What’s am I going to talk about?. Architecture with IoC IoC and the MVC Framework Entities and Services Generic Repository Facilities

kelda
Download Presentation

Using an Inversion of Control Container in a real world application

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using an Inversion of Control Container in a real world application Certified Mort Mike Hadlow mikehadlow@yahoo.com http://mikehadlow.blogspot.com

  2. What’s am I going to talk about? • Architecture with IoC • IoC and the MVC Framework • Entities and Services • Generic Repository • Facilities • Multitenancy

  3. Suteki Shop • A simple eCommerce application • Built for Jump the Gun in Brighton • Open Source

  4. Lego Software

  5. Dependency Injection • Do not directly instantiate concrete instances • Inject dependencies as constructor arguments • Let the IoC container supply dependencies

  6. Onion Architecture UserInterface Tests

  7. Every application is an object graph

  8. IoC and the MVC Framework • MvcContrib supplies a WindsorControllerFactory

  9. Entities and Services • Entities are not supplied by the IoC container • Entities have no dependencies on any other part of the application • Entities supply the schema and rules of the business • Services are supplied by the IoC container • Services tie Entities to infrastructure

  10. Generic Repository • Supplies a generic abstraction over the underlying data access technology • Works nicely with ORMs

  11. Extension method specifications

  12. Mixins • The first rule of Mixins: we have no Mixins

  13. Moving on from Repository • We can leverage the generic repository to write other generic services • IOrderable • Scafolding

  14. Facilities • Facilities allow us to package and reuse container configuration • Many off the shelf facilities • Logging • WCF integration • Nhibernate integration

  15. WCF Facility • Allows us to publish components as WCF services • Can also host WCF proxies as services

  16. Multitenancy • How do we provide client customisations? • Single/multiple code base? • Single/multiple application instance? • Single/multiple database?

  17. Where are we now? • Write your application as many small components • Use an IoC container to host components • Onion architecture • Use a generic repository • Use facilities • Customise deployment/runtime with the container

  18. Questions?

More Related