<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Erwin van der Valk's blog: Practicing patterns : Design Patterns</title><link>http://blogs.msdn.com/erwinvandervalk/archive/tags/Design+Patterns/default.aspx</link><description>Tags: Design Patterns</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Prism V2 – Drop 4</title><link>http://blogs.msdn.com/erwinvandervalk/archive/2008/10/24/prism-v2-drop-4.aspx</link><pubDate>Sat, 25 Oct 2008 01:54:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9015367</guid><dc:creator>erwinvandervalk</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/erwinvandervalk/comments/9015367.aspx</comments><wfw:commentRss>http://blogs.msdn.com/erwinvandervalk/commentrss.aspx?PostID=9015367</wfw:commentRss><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt; Today, We have put an other drop of Prism V2 (Composite application guidance for WPF and Silverlight) online. You can download it from here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.codeplex.com/CompositeWPF/Release/ProjectReleases.aspx?ReleaseId=18750" href="http://www.codeplex.com/CompositeWPF/Release/ProjectReleases.aspx?ReleaseId=18750"&gt;http://www.codeplex.com/CompositeWPF/Release/ProjectReleases.aspx?ReleaseId=18750&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1&gt;New in Prism V2 - Drop 4&lt;/h1&gt;  &lt;p&gt;This sprint was mainly focused around UI Composition. We have ported the Region functionality from Prism V1 over so it also works in Silverlight. Then we also addressed a different style of visual composition, we’re calling Top Down composition. I’m going to drill into those composition styles later in this post. &lt;/p&gt;  &lt;h1&gt;&amp;#160;&lt;/h1&gt;  &lt;h1&gt;Top down vs. Bottom up composition&lt;/h1&gt;  &lt;p&gt;In the last couple of weeks, we’ve had a lot of discussions around Visual Composition patterns. &lt;/p&gt;  &lt;h2&gt;Bottom up composition&lt;/h2&gt;  &lt;p&gt;Prism V1 used a regions to support Bottom Up composition. As a developer, you can define and name regions on your screen. When developing modules, you can use the names of these regions to push views into the regions. At first, we called this “push” based composition, because modules push their views into named regions. The diagram below shows an example of push based composition. We’re also calling this bottom up composition, because lower level modules push their views into the regions of higher level views. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/erwinvandervalk/WindowsLiveWriter/PrismV2Drop4_DFBC/image_20.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/erwinvandervalk/WindowsLiveWriter/PrismV2Drop4_DFBC/image_thumb_9.png" width="521" height="360" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Although this composition model allows for a highly decoupled and modular approach to UI development, we received some feedback that in some scenario’s it can be a bit to complex. &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h2&gt;Top down composition&lt;/h2&gt;  &lt;p&gt;With top down composition we took a different approach. Usually, developers are very comfortable with the usage of UserControls. It’s quite common for developers to split up a view into several UserControls to reduce complexity (divide and conquer) and to improve reuse of visual elements. Now it’s quite easy to create controls and place them in different assemblies. However, in order to use those assemblies, the shell has to have a reference to the assemblies that hold the user controls. This goes against the principles of modular development where modules can be versioned, and deployed seperately. &lt;/p&gt;  &lt;p&gt;We wanted to allow a model where you can visually compose your application in the same way as using UserControls, but without sacrificing modularity. To do this, we introduced a Top Down composition model:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/erwinvandervalk/WindowsLiveWriter/PrismV2Drop4_DFBC/image_22.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/erwinvandervalk/WindowsLiveWriter/PrismV2Drop4_DFBC/image_thumb_10.png" width="512" height="362" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So instead of the shell having a hard reference to the CustomerModule and putting a CustomerView directly on the ShellView, you put a ContentControl in the place where you want the user control. Then you use an attached property ViewType to specify what kind of View you want to display here, by specifying the interface of the view to display. The view interfaces can be defined in a seperate (Interface) module or in the shell. &lt;/p&gt;  &lt;p&gt;When a module get’s initialized, it typically registers it’s views to the &lt;a href="http://msdn.microsoft.com/en-us/library/cc707845.aspx"&gt;DI container&lt;/a&gt;. For example, the CustomerModule will tell the container that it can provide an implementation of the ICustomerView, because it registers the CustomerView type with the ICustomerView interface. Now after module initialization, the ShellView will ask the DI container for an implementation of ICustomerView. This will of course return the CustomerView, so it can then be shown in the ContentControl. Essentially, the ContentControl on the ShellView is pulling the CustomerView in from the CustomerModule, without having a direct reference to that module. We are calling this “Top Down” composition, because the Higher level modules define which views are displayed where. &lt;/p&gt;  &lt;p&gt;This is an example (from the TopDownCompositionQuickstart) on how you specify a view that’s pulled into the shell in XAML:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ContentControl&lt;/span&gt; 
    &lt;span style="color: #ff0000"&gt;Regions:ContentController&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;ViewType&lt;/span&gt;=
         &lt;span style="color: #0000ff"&gt;&amp;quot;TopDownComposition.Modules.Employee.IEmployeesListView, EmployeeModule.Silverlight, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You might notice 2 things:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;The viewtype is a string
      &lt;br /&gt;&lt;/strong&gt;At first we wanted to use the type of the interface directly. Unfortunately, this doesn’t work in Silverlight, because you cannot create types in XAML, because {x:Type} doesn’t work. But working with strings isn’t too bad. We’re planning to make the resolving logic pluggable. This way, you could for example use logical names, exported by your modules, to identify and retrieve the views. In fact, the &lt;a href="http://code.msdn.microsoft.com/mef"&gt;MEF framework&lt;/a&gt; also works like that. 

    &lt;br /&gt;&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;The viewtype is a really long string
      &lt;br /&gt;&lt;/strong&gt;To make working with those really long strings a bit more bearable, we’re also thinking of building a custom type resolver. Since 99.9% of the times the full typename (Namespace.TypeName) is unique, you can get away with just specifying that and let the framework figure out which assembly the type came from.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We’re also considering moving the View resolving functionality from the ContentController to the RegionManager. Even though technically this has nothing to do with regions, conceptually it’s very similar. A region specifies where you want to display visual elements from other modules. In the top down approach, you specify the content via it’s interface and in the bottom up approach you give it a name so others can push views into it. But it’s still a placeholder for views. &lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Hopefully you’ve found this post useful in explaining what we’re building. As always, we are very open to feedback. If you don’t like something we do, please tell us! Also if you do like something, tell us that as well! It might just prevent us from changing something you are already happy with :) &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9015367" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/CAL/default.aspx">CAL</category><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/Design+Patterns/default.aspx">Design Patterns</category><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Prism V2 (Composite Application Guidance) – Drop 3 is out</title><link>http://blogs.msdn.com/erwinvandervalk/archive/2008/10/14/prism-v2-drop-3-is-out.aspx</link><pubDate>Tue, 14 Oct 2008 23:19:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9000006</guid><dc:creator>erwinvandervalk</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/erwinvandervalk/comments/9000006.aspx</comments><wfw:commentRss>http://blogs.msdn.com/erwinvandervalk/commentrss.aspx?PostID=9000006</wfw:commentRss><description>&lt;p&gt;Yesterday, we’ve put the third drop of the Prism V2 project (Composite Application Guidance for WPF and Silverlight) online. &lt;/p&gt;  &lt;p&gt;You can download it from here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.codeplex.com/CompositeWPF/Release/ProjectReleases.aspx?ReleaseId=18184" href="http://www.codeplex.com/CompositeWPF/Release/ProjectReleases.aspx?ReleaseId=18184"&gt;http://www.codeplex.com/CompositeWPF/Release/ProjectReleases.aspx?ReleaseId=18184&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In this blog post I’m going to answer the following questions:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;What’s new in this drop?&lt;/li&gt;    &lt;li&gt;What are the Prism V2 module loading scenario’s?&lt;/li&gt;    &lt;li&gt;How is module loading implemented in Prism V2?&lt;/li&gt;    &lt;li&gt;Why the change from module enumerators to module catalogs?&lt;/li&gt; &lt;/ul&gt;  &lt;h1&gt;What’s new in this drop?&lt;/h1&gt;  &lt;p&gt;In this drop, we are starting to address Modularity. We’ve laid down the foundations for two new quickstarts: a static loading quickstart and a remote module loading quickstart. The most interesting of these two is the remote module loading quickstart because it does asynchronous downloading of modules from XAP files, and introduces a new XAML markup based way of defining modules. &lt;/p&gt;  &lt;h2&gt;&lt;/h2&gt;  &lt;h3&gt;Why address modularity in the third drop?&lt;/h3&gt;  &lt;p&gt;It might be interesting to address why we haven’t started to address modularity until this third drop. In the first two drops, we’ve mostly focused around multi targeting solutions between WPF and Silverlight. This might seem a bit strange, considering Prism is focused on composition. One of the goals of Prism V2 is to enable you to create applications that target WPF on the desktop and Silverlight from the browser using mostly the same codebase. we quickly found that targeting both Silverlight and WPF is not easy, so in true agile fashion, we tried to tackle this high risk unknown factor first. The added benefit is that we are dogfooding the tool we created to help multitargeting and can start capturing guidance on multi targeting applications early. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1&gt;Prism V2 Module loading scenario’s&lt;/h1&gt;  &lt;p&gt;When designing the module loading strategy for Prism V2, we first had to come up with the scenario’s we wanted to address. &lt;/p&gt;  &lt;p&gt;In a desktop application, you would typically want to create a modular application if you wanted to develop, version and deploy modules independently from each other. Of course these reasons are still valid for Silverlight applications, but we found that in Silverlight there is an other really important for creating a modular application: Minimizing download size. Especially on the web, users are very impatient. So you want users to wait for the minimum amount of time to start using your application. If you deploy your application in one massive 20 Mb Xap file, you are not going to end up with very happy customers. &lt;/p&gt;  &lt;p&gt;So you could also use modularity to minimize download time. We defined three categories of modules for this: Core, background and On demand modules. &lt;/p&gt;  &lt;h2&gt;“Core” modules&lt;/h2&gt;  &lt;p&gt;There is going to be a group of modules that are the bare minimum for your application to run. Most of the time, this will be the shell, shared common infrastructure modules with shared services and one or more functional modules that the user absolutely needs to productively use the application. Of course, speed is essential, so you should try to keep these modules to the minimum size possible. &lt;/p&gt;  &lt;p&gt;The core modules, will typically be packaged in the main Xap file. While this main XAP file is downloaded, you can use the built in Silverlight functionality to display a splash screen while the main XAP files are downloaded. Once the main XAP file is downloaded, the core modules will get initialized and the application will start up. &lt;/p&gt;  &lt;h2&gt;Background downloaded modules&lt;/h2&gt;  &lt;p&gt;Now there might be a couple of modules that are really important to your application, but the user doesn’t need them right away. However you don’t want them to wait for the module to get downloaded once they actually do need them. So to improve the user experience, you want to download these modules in the background. Modules will be downloaded in order and initialized when they are downloaded.&lt;/p&gt;  &lt;h2&gt;On demand downloaded modules &lt;/h2&gt;  &lt;p&gt;Then you might have a group of modules that are only used by a very select group of users (IE: an administration module). This will mostly help in minimizing the installation bandwidth used, because it’s not needlessly downloading assemblies. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1&gt;Module loading in Prism V2&lt;/h1&gt;  &lt;p&gt;In Prism V1, there was no concept of module downloading, because all modules where assumed to be available on the file system. Now for silverlight, this approach only works for assemblies that are present in the main XAP file. In Prism V2, we want to support retrieving modules from elsewhere. We’ll support downloading XAP files for Silverlight, but nothing prevents you from downloading modules from the web or from a database in WPF. &lt;/p&gt;  &lt;p&gt;This image displays roughly how the module loading pieces relate to each other:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/erwinvandervalk/WindowsLiveWriter/PrismV2Drop3isout_9DC7/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/erwinvandervalk/WindowsLiveWriter/PrismV2Drop3isout_9DC7/image_thumb_2.png" width="500" height="285" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The bootstrapper creates the Catalog and the Module manager. Then it kickstarts the modulemanager to start initializing the modules. &lt;/li&gt;    &lt;li&gt;The Catalog holds a list of ModuleInfoGroups which is a collection of module info’s. We’ve created a grouping, to make it easier to define which containers (XAP files) hold which modules. It’s also a convenient way to create a group of modules that are ‘Core’. &lt;/li&gt;    &lt;li&gt;The ModuleManager is responsible for coordinating the whole module retrieval and loading process. It will query the Catalog for core modules, background modules. It will also be the point where you hook up events to get notified when modules are downloaded. &lt;/li&gt;    &lt;li&gt;The moduleManager has a list of ModuleRetrievers. We are likely to ship only one retriever: the XapModuleRetriever that downloads silverlight modules. However, this way you can plug in your own retrieval strategies (IE, load modules from a database, webservice or some other means)&lt;/li&gt;    &lt;li&gt;If a module is present (either it was already on the filesystem, or it has been retrieved) the ModuleManager calls the ModuleLoader to instantate the module and call the Initialize method on it. This is the place where you can plug in your own module loading and initialization strategy. &lt;/li&gt; &lt;/ol&gt;  &lt;h1&gt;Defining module information in XAML&lt;/h1&gt;  &lt;p&gt;One other new thing we are supporting is defining module information in XAML. This is different from defining module info’s from a config file, because loading the XAML actually instantiates the ModuleInfo files. This way, it’s easier to create your own ModuleInfo files and extend it with custom properties. Defining modules in XAML looks like this:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Modularity:ModuleCatalogBuilder&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;                &lt;span style="color: #ff0000"&gt;xmlns:x&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;                &lt;span style="color: #ff0000"&gt;xmlns:Modularity&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;clr-namespace:Microsoft.Practices.Composite.Modularity;assembly=Microsoft.Practices.Composite.Silverlight&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Modularity:ModuleInfoGroup&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Ref&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;ModuleY.Silverlight.xap&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;InitializationMode&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;WhenAvailable&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Modularity:ModuleInfo&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ModuleName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;ModuleY&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ModuleType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;ModuleY.ModuleY, ModuleY.Silverlight, Version=1.0.0.0&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Modularity:ModuleInfoGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Modularity:ModuleInfoGroup&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Ref&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;ModuleZ.Silverlight.xap&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;InitializationMode&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;WhenAvailable&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Modularity:ModuleInfo&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ModuleName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;ModuleZ&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ModuleType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;ModuleZ.ModuleZ, ModuleZ.Silverlight, Version=1.0.0.0&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Modularity:ModuleInfoGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Modularity:ModuleCatalogBuilder&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2&gt;&lt;/h2&gt;

&lt;h1&gt;&lt;/h1&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;This example (from the RemoteModuleLoading quickstart) has two XAP files. Each XAP file has a single ModuleInfo. These modules will be downloaded on a background thread and initialized when they have been downloaded (WhenAvailable)&lt;/p&gt;

&lt;h1&gt;Moving from ModuleEnumerators to Catalogs of modules&lt;/h1&gt;

&lt;p&gt;In Prism V1, we have the concept of module enumerators that define which modules are used by the application. For instance, the DirectoryLookupModuleEnumerator would find all modules in a specific directory. After many discussions, we found that this name is a bit confusing. If you think about it, an enumerator in .Net takes a collection and provides a way to walk through that collection. The prism ModuleEnumerators acted more like Module Info providers because they read module information from a certain location (IE: a directory or a config file) and returned the list of module info’s. &lt;/p&gt;

&lt;p&gt;In Prism V2, we have defined the concept of a Catalog (of modules). A catalog contains the list of all the modules that are available to the application. Other components, like the ModuleManager can query the catalog for specific groups of modules. Like: “Give me all the Core modules”. Or “Give me all the modules to download in the background”.&lt;/p&gt;

&lt;h1&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;There is a bunch of interesting stuff going on in this drop. We are still in the middle of a bunch of changes, but it does give a clear indication of the direction we’re taking. &lt;/p&gt;

&lt;p&gt;As always, let us know what you guys think, either by commenting here, commenting on the CodePlex site, or by sending us an E-mail.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9000006" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/Design+Patterns/default.aspx">Design Patterns</category><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/WPF/default.aspx">WPF</category></item><item><title>Composite Application Guidance for WPF has landed</title><link>http://blogs.msdn.com/erwinvandervalk/archive/2008/07/04/composite-application-guidance-for-wpf-has-landed.aspx</link><pubDate>Fri, 04 Jul 2008 21:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8690387</guid><dc:creator>erwinvandervalk</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/erwinvandervalk/comments/8690387.aspx</comments><wfw:commentRss>http://blogs.msdn.com/erwinvandervalk/commentrss.aspx?PostID=8690387</wfw:commentRss><description>&lt;P&gt;My new colleagues at patterns &amp;amp; practices have just delivered a great new deliverable around creating composite applications in WPF. Check it out at:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://msdn.microsoft.com/en-us/library/cc707819.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc707819.aspx&lt;/A&gt;&amp;nbsp;or at: &lt;A href="http://www.codeplex.com/CompositeWPF"&gt;http://www.codeplex.com/CompositeWPF&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This deliverable contains:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Composite Application Library components.&lt;/LI&gt;
&lt;LI&gt;Guidance around creating composite applications, including detailled descriptions of common UI design patterns.&lt;/LI&gt;
&lt;LI&gt;Reference implementation&lt;/LI&gt;
&lt;LI&gt;Quickstart applications that demonstrate specific aspects of CAL&lt;/LI&gt;
&lt;LI&gt;Lots of hands on labs&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;Great stuff!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8690387" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/CAL/default.aspx">CAL</category><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/Design+Patterns/default.aspx">Design Patterns</category><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/patterns+_2600_amp_3B00_+practices/default.aspx">patterns &amp;amp; practices</category><category domain="http://blogs.msdn.com/erwinvandervalk/archive/tags/WPF/default.aspx">WPF</category></item></channel></rss>