Eng. Giorgetti Alessandro Software Artisan SID s.r.l.
Graduated Engineer Owner/co-founder of SID s.r.l. Blog:
To be able to use an IoC/DI framework effectively you need to structure your application the right way! Your first problem is an Architectural problem: How to partition an application? How to structure each module? What are the interactions? Dependencies? …
Only When you’ve answered those questions, you can think of how to implement the solution! Only at this stage you can start thinking of which ‘tool’ to use and which ‘best practice’ you can follow to solve your problems!
When you think of an application architecture, usually this is the first thing it come into your mind: DAL Business Logic User Interface Securty Logging Infrastructure
When using a IoC/DI container your application sounds more like this: Security Service IService1 Module1 Logging Service IService2 Module2 Infrastructure Shell Application Framework IService3 Messaging Service
When implementing a module/service Module1 Module2 Infrastructure Shell Application Framework DAL Business Logic User Interface Securty Logging Infrastructure
Keep things simple! Use a top-down approach while defining and designing the application Break the application in modules / features and decouple the more you can: reusability, easy implementation Think using ‘interfaces’ (do not try to implement anything at this stage)…but avoid over- engineering
Design Interfaces Component configuration, creation, lifecycle IoC/DI/ServiceLocator, etc… Managing interactions data storage, shared data, message brokering, etc…
You have plenty of ‘tools’ and ‘patterns’ that helps you implementing your solution: Layered applications Implementation patterns (MVC, MVVM, …) Reuse services
Eng. Giorgetti Alessandro
Inspired by this workshop I’ve started a series of articles on my blog you can check to dig into some of the arguments I proposed here: Silverlight, MVVM … and IoC Silverlight Navigation Framework … and IoC resolve-pages-ioc-container More to come…
Eng. Giorgetti Alessandro