See how using "Prism" and it's friend Unity (an implementation of IoC) from the Patterns and Practices team can help in building Silverlight applications in a way that lends itself to testability and modularity.
3. Prism Composite Application Guidance Patterns and Practices Group Targets Silverlight and WPF Can be used for other kind off applications Documentation Libraries Source Code Default IoC - Dependency injection mechanism Can use others Windsor Castle etc. 12/21/2009 3
4. Unity IoC Inversion of Control “Container” Register Implementations Lookup based on Interfaces Dependency Injection 12/21/2009 4
6. Using Unity Pros Loosely coupled software Cons Independent libraries Deployment Have to put the libraries in the right folder at the right time. Fusion resolution What if I want to Load types from disk, web site, etc What if I want to Load types on Demand Assemblies’ dependencies Registration ordering matters have to know the registration order. What happens for hundreds of assemblies? 12/21/2009 6
7. Prism to the rescue Modularity List / Catalog / Set Modules Dependencies on other modules Flexibly loaded File System, Web, XAP Delay Loaded (i.e. only load on demand) Module self - initialization 12/21/2009 7
9. Using Prism Quite a bit of Code IServiceLocator UnityContainer IModuleInitilizer IModuleCatalog IModuleManager Bootstrappersolves all that! 12/21/2009 9
11. Prism in Silverlight Coming Next Most elaborate Hello World application Shells, Regions, Views Commands Event Aggregation Region Context 12/21/2009 11
12. Demo 4 Most elaborate Hello World! application 12/21/2009 12