<?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>Skinner's Blog : VSTS 2010 Fall CTP</title><link>http://blogs.msdn.com/camerons/archive/tags/VSTS+2010+Fall+CTP/default.aspx</link><description>Tags: VSTS 2010 Fall CTP</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Channel 9 and 10-4</title><link>http://blogs.msdn.com/camerons/archive/2008/12/18/channel-9-and-10-4.aspx</link><pubDate>Thu, 18 Dec 2008 06:09:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9233895</guid><dc:creator>camerons</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/camerons/comments/9233895.aspx</comments><wfw:commentRss>http://blogs.msdn.com/camerons/commentrss.aspx?PostID=9233895</wfw:commentRss><description>&lt;p&gt;If you are not already aware of &lt;a href="http://channel9.msdn.com/"&gt;Channel 9&lt;/a&gt;, stop what you are doing right now and go check it out.&lt;/p&gt;  &lt;p&gt;Really.&lt;/p&gt;  &lt;p&gt;I'll wait. :)&lt;/p&gt;  &lt;p&gt;Channel 9 has a long a brilliant history of shining a light on all things that Microsoft is doing through the video medium. Soon after the 2008 PDC was over, the session videos were &lt;a href="http://channel9.msdn.com/pdc2008/"&gt;made available on Channel 9&lt;/a&gt;, allowing folks who couldn't make the conference to see the details, but also giving the folks who were there the ability to catch the sessions they were unable to catch in person. ( Here's the &lt;a href="http://channel9.msdn.com/pdc2008/TL47/"&gt;link to my talk&lt;/a&gt; at the PDC. )&lt;/p&gt;  &lt;p&gt;In addition, when the VSTS 2010 CTP became available, the Channel 9 folks launched a &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Visual-Studio-Team-System-2010-Week-on-Channel-9/"&gt;series of videos&lt;/a&gt; that introduced you to the various areas of the Team System product line ( including &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Cameron-Skinner-Visual-Studio-Team-System-2010-Architecture/"&gt;your's truly&lt;/a&gt; :) ).&lt;/p&gt;  &lt;p&gt;Well now, they're doing it again.&lt;/p&gt;  &lt;p&gt;Today the Channel 9 folks have announced a new video podcast series entitled &amp;quot;&lt;a href="http://channel9.msdn.com/shows/10-4/"&gt;10-4&lt;/a&gt;&amp;quot;. The idea is simple: every week, provide a video to the community detailing various aspects of Visual Studio 20&lt;strong&gt;&lt;font color="#ff0000"&gt;10&lt;/font&gt;&lt;/strong&gt; and the .NET Framework &lt;strong&gt;&lt;font color="#ff0000"&gt;4&lt;/font&gt;&lt;/strong&gt;.0. &lt;/p&gt;  &lt;p&gt;Check out &lt;a href="http://blogs.msdn.com/briankel/archive/2008/12/17/announcing-10-4.aspx"&gt;Brian Keller's post&lt;/a&gt; for some more details.&lt;/p&gt;  &lt;p&gt;I &lt;strong&gt;love&lt;/strong&gt; those guys! &lt;img alt="" src="http://www.zu14.cn/coolemotion/emotions/gmail_73.gif" /&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9233895" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/camerons/archive/tags/PDC2008/default.aspx">PDC2008</category><category domain="http://blogs.msdn.com/camerons/archive/tags/Videos/default.aspx">Videos</category><category domain="http://blogs.msdn.com/camerons/archive/tags/VSTS+2010+Fall+CTP/default.aspx">VSTS 2010 Fall CTP</category></item><item><title>"Standard Graphs"</title><link>http://blogs.msdn.com/camerons/archive/2008/12/18/standard-graphs.aspx</link><pubDate>Thu, 18 Dec 2008 03:04:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9232721</guid><dc:creator>camerons</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/camerons/comments/9232721.aspx</comments><wfw:commentRss>http://blogs.msdn.com/camerons/commentrss.aspx?PostID=9232721</wfw:commentRss><description>&lt;p&gt;It became clear from the emails and comments to my &lt;a href="http://blogs.msdn.com/camerons/archive/2008/12/16/introduction-to-directed-graph-markup-language-dgml.aspx"&gt;last post&lt;/a&gt; that I should probably spend a little more time describing the functionality found in the &lt;a href="http://blogs.msdn.com/briankel/archive/2008/10/27/helpful-links-for-the-visual-studio-2010-ctp.aspx"&gt;VSTS 2010 CTP&lt;/a&gt; a bit better, specifically that functionality involving the Architecture Explorer and the graphs generated via the AE. ( I just figured everyone had already run out, downloaded that 7.5gig image, and started playing! :) )&lt;/p&gt;  &lt;p&gt;This post introduces the three &amp;quot;Standard Graphs&amp;quot; found off the Architecture Explorer using the &lt;strong&gt;DinnerNow - ServicePortfolio2&lt;/strong&gt; solution found in that aforementioned CTP. The idea behind these graphs are to give you the ability to get some &amp;quot;typical&amp;quot; views of your source base with as few mouse clicks as possible.&lt;/p&gt;  &lt;h3&gt;&lt;u&gt;Standard Graphs&lt;/u&gt;&lt;/h3&gt;  &lt;p&gt;Here's a shot of the Archicture Explorer, as seen with the DinnerNow solution open in VS 2010:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="316" alt="image" src="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image.png" width="501" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;You'll notice the &lt;strong&gt;Visualize Code Relationships&lt;/strong&gt; menu item, which is where you'll find the three menu items that will create graphs by Assembly, Namespace, or Class dependencies based on the contents of the current solution.&lt;/p&gt;  &lt;h3&gt;&lt;u&gt;Visualize Call Dependency - By Assembly&lt;/u&gt;&lt;/h3&gt;  &lt;p&gt;If you select the &lt;strong&gt;Visualize Call Dependency - By Assembly&lt;/strong&gt; menu item, here's what you'll get:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_3.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="324" alt="image" src="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_thumb.png" width="640" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This graph is all about showing you the dependencies between the various assemblies that make up all the projects in your solution. If you don't have the solution built, you'll notice that after selecting this menu item ( this will happen for any &amp;quot;standard&amp;quot; graph actually ) the solution is built. This is due to the fact that we are cracking the assemblies in the output directories and gathering the information found there.&lt;/p&gt;  &lt;p&gt;The nodes you see above represent each of the assemblies discovered in this solution. You'll also notice links of various thickness between these nodes. The thicker the link, the more dependencies between the two assemblies. We sometimes refer to these types of links as &amp;quot;blood vessels&amp;quot;.&lt;/p&gt;  &lt;p&gt;Notice the chevrons in the upper right hand corner of the nodes in this graph:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="125" alt="image" src="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_4.png" width="252" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;This is an &amp;quot;expand / collapse&amp;quot; button for this &amp;quot;group&amp;quot; node. You'll also notice in the upper left corner of each node, a number indicating the number of internal nodes inside the group. Here's what the &lt;strong&gt;DinnerNow.Services&lt;/strong&gt; assembly node looks like when expanded ( click for larger view ):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_5.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="98" alt="image" src="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_thumb_3.png" width="640" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The green and blue nodes represent Classes and Interfaces. You'll notice in the shot above the tooltip displayed as I hover over the &lt;strong&gt;CustomerService&lt;/strong&gt; node, the category reads &amp;quot;Class&amp;quot;. If I double-click on that node, it takes me to the source code where that class is defined.&lt;/p&gt;  &lt;h3&gt;&lt;u&gt;Visualize Call Dependency - By Namespace&lt;/u&gt;&lt;/h3&gt;  &lt;p&gt;Selecting the &lt;strong&gt;Visualize Call Dependency - By Namespace&lt;/strong&gt; results in a similar type graph, except this time the initial nodes you see below represent the namespaces found in the solution:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_6.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="191" alt="image" src="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_thumb_4.png" width="640" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Clicking on the chevron of the &lt;strong&gt;DinnerNow.Services&lt;/strong&gt; node shows the exact same information as it did when viewing from the Assembly diagram ( show below in-situ ):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_7.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="113" alt="image" src="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_thumb_5.png" width="640" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;&lt;u&gt;Visualize Call Dependency - By Class&lt;/u&gt;&lt;/h3&gt;  &lt;p&gt;Selecting the &lt;strong&gt;Visualize Call Dependency - By Class&lt;/strong&gt; results in the most complicated of graphs, mostly because what you are seeing is dependencies at the class level, with no grouping by assembly or namespace. Expanding a chevron in this graph reveals methods, properties, fields, indexers, etc. that are contained by that class or interface. Below is a shot of just a section, as the graph is pretty large:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_8.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="480" alt="image" src="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_thumb_6.png" width="542" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;One thing to point out if you haven't already discovered this, is that if you hover your mouse over a particular link, you can quickly jump to either end of the link. Quite helpful on large graphs like the Class dependency graph!&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="149" alt="image" src="http://www.cwskinner.members.winisp.net/BlogImages/StandardGraphsArchitectureExplorerandDGM_CF84/image_9.png" width="352" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;One other thing worth mentioning. The dependencies discovered on these graphs are dependencies discovered through static analysis of method call data, not structural dependencies. For example, if you have two classes that don't call each other but one includes the other as a type for a member, no dependency link will be created. &lt;/p&gt;  &lt;p&gt;What other &amp;quot;Standard Graphs&amp;quot; should we include out of the box? What are some typical views over your solution that you would like one to two clicks away?&lt;/p&gt;  &lt;p&gt;Thanks!&lt;/p&gt;  &lt;p&gt;Cameron&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9232721" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/camerons/archive/tags/tsbt-arch/default.aspx">tsbt-arch</category><category domain="http://blogs.msdn.com/camerons/archive/tags/Architecture+Edition/default.aspx">Architecture Edition</category><category domain="http://blogs.msdn.com/camerons/archive/tags/VSTS+2010+Fall+CTP/default.aspx">VSTS 2010 Fall CTP</category><category domain="http://blogs.msdn.com/camerons/archive/tags/Architecture+Explorer/default.aspx">Architecture Explorer</category><category domain="http://blogs.msdn.com/camerons/archive/tags/Standard+Graphs/default.aspx">Standard Graphs</category></item><item><title>Introduction to Directed Graph Markup Language ( DGML )</title><link>http://blogs.msdn.com/camerons/archive/2008/12/16/introduction-to-directed-graph-markup-language-dgml.aspx</link><pubDate>Tue, 16 Dec 2008 23:59:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9228382</guid><dc:creator>camerons</dc:creator><slash:comments>14</slash:comments><comments>http://blogs.msdn.com/camerons/comments/9228382.aspx</comments><wfw:commentRss>http://blogs.msdn.com/camerons/commentrss.aspx?PostID=9228382</wfw:commentRss><description>&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;font color="#000000"&gt;DGML, or &amp;quot;Directed Graph Markup Language&amp;quot; is what we are using in VSTS 2010 Architecture to render graphs like the one below:          &lt;br /&gt;&lt;a href="http://www.cwskinner.members.winisp.net/BlogImages/IntroductiontoDirectedGraphMarkupLanguag_B68E/image_thumb31.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="324" alt="image_thumb3[1]" src="http://www.cwskinner.members.winisp.net/BlogImages/IntroductiontoDirectedGraphMarkupLanguag_B68E/image_thumb31_thumb.png" width="640" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;font color="#000000"&gt;The power of DGML is in its simplicity. Let me show you what I mean.&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;font color="#000000"&gt;If you launch the &lt;a href="http://blogs.msdn.com/briankel/archive/2008/10/27/helpful-links-for-the-visual-studio-2010-ctp.aspx"&gt;VSTS 2010 CTP&lt;/a&gt;, open a project, click &lt;strong&gt;View-&amp;gt;Architecture Explorer&lt;/strong&gt;, then click the button shown below...           &lt;br /&gt;&amp;#160;&lt;a href="http://www.cwskinner.members.winisp.net/BlogImages/IntroductiontoDirectedGraphMarkupLanguag_B68E/image_thumb8.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="209" alt="image_thumb8" src="http://www.cwskinner.members.winisp.net/BlogImages/IntroductiontoDirectedGraphMarkupLanguag_B68E/image_thumb8_thumb.png" width="609" border="0" /&gt;&lt;/a&gt; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;font color="#000000"&gt;...you'll get a new dgml editor in the document well. You can then right click inside that document and select &amp;quot;View Code&amp;quot;. Right click on the tab of the resulting editor and select &amp;quot;New Horizontal Tab Group&amp;quot;. You'll have something similar to this:&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.cwskinner.members.winisp.net/BlogImages/IntroductiontoDirectedGraphMarkupLanguag_B68E/image_thumb14.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="468" alt="image_thumb14" src="http://www.cwskinner.members.winisp.net/BlogImages/IntroductiontoDirectedGraphMarkupLanguag_B68E/image_thumb14_thumb.png" width="640" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;font color="#000000"&gt;&lt;font color="#333333"&gt;If you add a &lt;strong&gt;Link&lt;/strong&gt; element as a child element to the &lt;strong&gt;Links&lt;/strong&gt; node, with a &lt;strong&gt;Source &lt;/strong&gt;and &lt;strong&gt;Target&lt;/strong&gt; attribute, you'll get something similar to this:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;font color="#000000"&gt;&lt;a href="http://www.cwskinner.members.winisp.net/BlogImages/IntroductiontoDirectedGraphMarkupLanguag_B68E/image_thumb17.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="467" alt="image_thumb17" src="http://www.cwskinner.members.winisp.net/BlogImages/IntroductiontoDirectedGraphMarkupLanguag_B68E/image_thumb17_thumb.png" width="640" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;font color="#000000"&gt;To add a few more elements, try this:&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.cwskinner.members.winisp.net/BlogImages/IntroductiontoDirectedGraphMarkupLanguag_B68E/image_thumb20.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="469" alt="image_thumb20" src="http://www.cwskinner.members.winisp.net/BlogImages/IntroductiontoDirectedGraphMarkupLanguag_B68E/image_thumb20_thumb.png" width="640" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You'll notice the &lt;strong&gt;Nodes&lt;/strong&gt; element isn't even needed to render the graph above. That is really all you need to know to visualize all kinds of data. Rest assured there is a lot more goodness to discuss about this technology, but the simplicity of it is one of the most exciting aspects as far as I'm concerned!&lt;/p&gt;  &lt;p&gt;In my next post, I'm actually going to show you how, armed with just this little nugget of DGML information, you can visualize some Java code. Stay tuned!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9228382" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/camerons/archive/tags/tsbt-arch/default.aspx">tsbt-arch</category><category domain="http://blogs.msdn.com/camerons/archive/tags/Architecture+Edition/default.aspx">Architecture Edition</category><category domain="http://blogs.msdn.com/camerons/archive/tags/VSTS+2010+Fall+CTP/default.aspx">VSTS 2010 Fall CTP</category><category domain="http://blogs.msdn.com/camerons/archive/tags/DGML/default.aspx">DGML</category><category domain="http://blogs.msdn.com/camerons/archive/tags/Architecture+Explorer/default.aspx">Architecture Explorer</category></item><item><title>Incorporate Layer Validation in your Builds</title><link>http://blogs.msdn.com/camerons/archive/2008/12/11/incorporate-layer-validation-in-your-builds.aspx</link><pubDate>Thu, 11 Dec 2008 08:20:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9195002</guid><dc:creator>camerons</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/camerons/comments/9195002.aspx</comments><wfw:commentRss>http://blogs.msdn.com/camerons/commentrss.aspx?PostID=9195002</wfw:commentRss><description>&lt;p&gt;As I promised in my &lt;a href="http://blogs.msdn.com/camerons/archive/2008/12/09/layer-validation-with-the-vsts-2010-ctp.aspx"&gt;last post&lt;/a&gt;, I want to show you how you can make Layer Validation part of your build process. I'm going to assume you've followed along from last post to make things easy. Again, this is all possible in the &lt;a href="http://blogs.msdn.com/briankel/archive/2008/10/27/helpful-links-for-the-visual-studio-2010-ctp.aspx"&gt;VSTS 2010 CTP&lt;/a&gt;.&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Unload the "Client" project ( Right click on the "Client" project and select "Unload Project" )&lt;/li&gt; &lt;li&gt;Once unloaded, right click on the unloaded "Client" project and select "Edit Client.csproj":&lt;br&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/IncorporateLayerValidationinyourBuilds_11BC3/image_2.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="293" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/IncorporateLayerValidationinyourBuilds_11BC3/image_thumb.png" width="342" border="0"&gt;&lt;/a&gt; &lt;/li&gt; &lt;li&gt;Find this line:&lt;br&gt;&amp;nbsp; &lt;br&gt;&lt;font color="#0080ff"&gt;&amp;lt;Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;And add this line right after it:&lt;br&gt;&lt;br&gt;&lt;font color="#0080ff"&gt;&amp;lt;Import Project=" $(ProgramFiles)\Microsoft Visual Studio 10.0\Team Tools\Architecture Tools\Microsoft.VisualStudio.TeamArchitect.Validate.Targets"/&amp;gt;&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;font color="#000000"&gt;This is a temporary step to make this work in the CTP. At RTM ( and even for Beta ), the new targets file will be part of the core MSBuild targets file.&lt;br&gt;&lt;/font&gt;&lt;/li&gt; &lt;li&gt;Save the project, then reload.&lt;/li&gt; &lt;li&gt;You'll be presented with this dialog:&lt;br&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/IncorporateLayerValidationinyourBuilds_11BC3/image_12.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="449" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/IncorporateLayerValidationinyourBuilds_11BC3/image_thumb_4.png" width="644" border="0"&gt;&lt;/a&gt;&amp;nbsp;&lt;br&gt;&lt;/li&gt; &lt;li&gt;Click on the "Load project normally" and click &lt;strong&gt;OK.&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;Now drag the "FirstLayerDiagram.layer" file from the "Diagrams" solution folder into the "Client" project.&lt;/li&gt; &lt;li&gt;Delete the "FirstLayerDiagram.layer" file from the solution folder.&lt;/li&gt; &lt;li&gt;Select the "FirstLayerdiagram.layer" file that is now in the "Client" project, and set its "Build" action to "Validate":&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/IncorporateLayerValidationinyourBuilds_11BC3/image_16.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="546" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/IncorporateLayerValidationinyourBuilds_11BC3/image_thumb_6.png" width="369" border="0"&gt;&lt;/a&gt; &lt;br&gt;Now if you did want to leave the "FirstLayerDiagram.layer" file in the "Diagrams" solution folder, you would have to manually edit the "Client.csproj" file, changing this line:&lt;br&gt;&lt;br&gt;&lt;font color="#000080"&gt;&amp;lt;Validate Include="FirstLayerDiagram.layer" /&amp;gt;&lt;br&gt;&lt;/font&gt;&lt;br&gt;to this:&lt;br&gt;&lt;br&gt;&lt;font color="#000080"&gt;&amp;lt;Validate Include="&lt;strong&gt;..\&lt;/strong&gt;FirstLayerDiagram.layer" /&amp;gt;&lt;br&gt;&lt;br&gt;&lt;font color="#000000"&gt;You're project would look something like this ( notice the little arrow overlay, indicating that this is a reference to a file elsewhere ):&lt;br&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/IncorporateLayerValidationinyourBuilds_11BC3/image_18.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="96" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/IncorporateLayerValidationinyourBuilds_11BC3/image_thumb_7.png" width="244" border="0"&gt;&lt;/a&gt; &lt;/font&gt;&lt;br&gt;&lt;/font&gt;&lt;/li&gt; &lt;li&gt;Now at this point you could drop to the command line, assuming the Client.csproj file is in "c:\temp\Layer Validation\Client", and type "&lt;strong&gt;msbuild /t:ValidateArchitecture&lt;/strong&gt;".&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Ideally, it would be great to incorporate this step into the build process whenever you build the solution or Client project. You would do something like add a DependsOn="ValidateArchitecture" attribute to the "AfterBuild" target in the project file. Unfortunately, the same bug that requires you to refresh the Architectural Explorer after each build of the project will prevent this from working as it should. Clearly, this will be corrected by RTM.&lt;br&gt;&lt;/p&gt; &lt;p&gt;Hope that helps!&lt;/p&gt; &lt;p&gt;Cameron&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9195002" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/camerons/archive/tags/Layer+Diagram/default.aspx">Layer Diagram</category><category domain="http://blogs.msdn.com/camerons/archive/tags/VSTS+2010+Fall+CTP/default.aspx">VSTS 2010 Fall CTP</category></item><item><title>Layer Validation with the VSTS 2010 CTP</title><link>http://blogs.msdn.com/camerons/archive/2008/12/09/layer-validation-with-the-vsts-2010-ctp.aspx</link><pubDate>Tue, 09 Dec 2008 08:26:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9186397</guid><dc:creator>camerons</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/camerons/comments/9186397.aspx</comments><wfw:commentRss>http://blogs.msdn.com/camerons/commentrss.aspx?PostID=9186397</wfw:commentRss><description>&lt;p&gt;In my first post of this series, I broke down the VSTS 2010 Architecture product into "functional" areas, and I've been slowly describing the pieces. The areas highlighted ( Modeling Project &lt;a href="http://blogs.msdn.com/camerons/archive/2008/11/17/vsts-2010-architecture-part-one-model-project.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/camerons/archive/2008/11/24/vsts-2010-architecture-part-two-model-project-and-4-1-project-template.aspx"&gt;here&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/camerons/archive/2008/12/01/the-uml-model-explorer.aspx"&gt;Model Explorer&lt;/a&gt;, and &lt;a href="http://blogs.msdn.com/camerons/archive/2008/11/25/model-and-work-item-integration.aspx"&gt;Work Item Integration&lt;/a&gt; ) I've already discussed at some length. Today, I want to drill into the Layer Diagram a bit more. Specifically, I want to walk you through the steps of creating a simple Layer diagram, map your code onto it, and validate that code against the constraints authored in the diagram via a manual validation gesture. ( In a future post I'll show you how to automate validation in your build process. ) &lt;/p&gt; &lt;p&gt;For this post, I'll be using the &lt;a href="http://blogs.msdn.com/briankel/archive/2008/10/27/helpful-links-for-the-visual-studio-2010-ctp.aspx"&gt;VSTS 2010 CTP&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_4.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="480" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_1.png" width="501" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt; &lt;p&gt;In this example, I'm going to be using some very simplistic code, as it is not the details of the code that I'm trying to emphasize, but more the concept the code represents. Let's get started...&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Start you VSTS 2010 CTP image&lt;/li&gt; &lt;li&gt;Launch VS 2010&lt;/li&gt; &lt;li&gt;Create a C# console app called "Client", and name the solution "Layer Validation". You're "New Project" dialog should look similar to this:&lt;br&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_6.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="457" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_2.png" width="644" border="0"&gt;&lt;/a&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;Now right click on the solution node, select "New Project...", select "Class Library" and name the Project "Implementation":&lt;br&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_8.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="412" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_3.png" width="644" border="0"&gt;&lt;/a&gt;&amp;nbsp;&lt;br&gt;&lt;/li&gt; &lt;li&gt;Do the exact same thing you just did in step 4, except name the project "Interfaces".&lt;/li&gt; &lt;li&gt;Again, do the exact same thing except name the project "Creators". You should have a solution explorer that looks similar to this:&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_12.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="241" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_5.png" width="292" border="0"&gt;&lt;/a&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;Now expand the "Interfaces" project node. Right click on the "Class1.cs" file, select "Rename", rename the class to &lt;strong&gt;IDataRetriever.cs&lt;/strong&gt;, and click the "Yes" button when prompted. You should now see something like this in your document well and Solution Explorer:&lt;br&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_14.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="297" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_6.png" width="640" border="0"&gt;&lt;/a&gt; &lt;/li&gt; &lt;li&gt;Change &lt;strong&gt;IDataRetriever&lt;/strong&gt; into an interface by replacing the "class" keyword with "interface".&lt;/li&gt; &lt;li&gt;Now add a getter property that returns an object that implements the "IData" interface. You'll notice that VS is indicating to you that IData doesn't exist yet by putting the red squiggles underneath "IData":&lt;br&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_16.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="71" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_7.png" width="251" border="0"&gt;&lt;/a&gt; &lt;br&gt;Let's resolve this error by taking advantage of a new feature in VS 2010.&lt;/li&gt; &lt;li&gt;Right click on the offending "IData", select "Generate", and select "Other...":&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_20.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="235" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_9.png" width="404" border="0"&gt;&lt;/a&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;You'll now be presented with the "New Type" dialog. Change the "Type Kind:" drop-down to "interface" and the "Access:" drop-down to "public". Leave the rest as defaults:&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_33.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="234" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_14.png" width="244" border="0"&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;VS will automatically create a new interface called "IData" in a new file called "IData.cs" placed in the Interfaces project. Nice, that's exactly what we wanted! Now let's go implement the IDataRetriever interface over in the "Implementation" project.&lt;br&gt;&lt;/li&gt; &lt;li&gt;Expand the "Implementation" project node.&lt;/li&gt; &lt;li&gt;Right click on the "References" node, select "Add Reference...", click the "Projects" tab, and select "Interfaces":&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="412" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_25.png" width="485" border="0"&gt;&amp;nbsp;&lt;br&gt;&lt;/li&gt; &lt;li&gt;Collapse the "References" node.&lt;/li&gt; &lt;li&gt;Right click on the "Class1.cs" file, select "Rename", change the file name to "&lt;strong&gt;DataRetriever.cs"&lt;/strong&gt;, and select "Yes" in the dialog that pops up. &lt;/li&gt; &lt;li&gt;Double-click on the "DataRetriever.cs" file, and make the new class implement the "IDataRetriever" interface. You'll notice that as you attempt to type "IDataRetriever", you get no intellisense support. That's ok, finish typing in "IDataRetriever", and again notice the red squigglies below the term.&lt;/li&gt; &lt;li&gt;Hover over "IDataRetriever" and notice a small rectangle under the start of the word. Click on that and select "using interfaces;". This will automatically insert the using statement that is required.&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="189" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_28.png" width="476" border="0"&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;Now that the "using Interfaces;" line has been automatically added, select the "smart tag" again, but this time select "Implement interface 'IDataRetriever'":&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="165" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_31.png" width="525" border="0"&gt;&amp;nbsp;&lt;br&gt;&lt;br&gt;Your final "DataRetriever" file should look like this:&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="365" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_38.png" width="576" border="0"&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;Now add a reference to the "Implementation" project as well as the "Interfaces" project, following the similar steps in step 13 above.&lt;/li&gt; &lt;li&gt;Expand the "Client" project node and double click on "Program.cs".&lt;/li&gt; &lt;li&gt;Type "DataRetriever", select the smart-tag and select "using Implementation;". That will automatically generate the using statement needed to use the DataRetriever type. Finish like so, adding the "using Interfaces;" statement as well:&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="384" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_41.png" width="506" border="0"&gt; &lt;/li&gt; &lt;li&gt;Rebuild the solution. If all went according to plan, no errors.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;So what does this program do at this point? Well, actually nothing except instantiate a type, call a property on that type, throw a "NotImplementedException", then exit. Not that interesting, but also not the point. This is just setting the stage for a very common problem found in systems of all types.&lt;/p&gt; &lt;p&gt;This code is pretty typical of code that is early in its evolutionary path. We've got a client program accessing the specific implementation of an interface directly. This is fine for now, as all the program needs is the data that "DataRetriever" was designed to retrieve ( imagine DataRetriever pulling from a SQL database for instance ). But what about tomorrow when a requirement hits your desk, demanding data to be pulled from a different data source without changing the behavior of the rest of the application?&lt;/p&gt; &lt;p&gt;What we need is to *not* make any assumptions on *how* an interface is implemented, and depend *only* on the contract of the interface(s) itself. Again, a fairly common design pattern, but one that is pretty easy to violate in today's world, as it takes but one line of code to break this pattern and create dependencies that were not intended. This is what various &lt;a href="http://en.wikipedia.org/wiki/Inversion_of_control"&gt;IoC&lt;/a&gt; containers are out to help mitigate.&lt;/p&gt; &lt;p&gt;So how do we enforce this design in our code, protecting the intent of that design, and ensure our code is resilient to this type of breakage? Enter the Layer Diagram and Layer Validation.&lt;/p&gt; &lt;p&gt;Let's create a Layer Diagram where we will visually describe the constraints on our architecture that we want to maintain.&lt;/p&gt; &lt;h3&gt;&lt;u&gt;Create the Layer Diagram&lt;/u&gt;&lt;/h3&gt; &lt;ol&gt; &lt;li&gt;Right click on the solution node and select Add-&amp;gt;New Solution Folder. Name the folder "Diagrams"&lt;/li&gt; &lt;li&gt;Right click on the "Diagrams" solution folder and select Add-&amp;gt;New Item..., select the "Layer Diagram" template, and name the diagram "FirstLayerDiagram.layer":&lt;br&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_43.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="388" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_18.png" width="644" border="0"&gt;&lt;/a&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;Since these are CTP bits, there are still a few things not quite right. One of these things is the fact that you'll see two Layer Diagram Explorers appear next to your Solution Explorer. Close the one that looks like this:&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="161" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_46.png" width="256" border="0"&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;Now let's draw the layer diagram, make your diagram look like this one:&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="471" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_49.png" width="319" border="0"&gt; &lt;br&gt;Please make sure that the links are going in the direction you see above, or things aren't going to work right in later steps!&lt;br&gt;&lt;br&gt;What we're saying through this diagram is that we have a "Client Logic" layer that is dependent on the "Interfaces" layer, and an "Implementation" layer also dependent on the "Interfaces" layer. What we are also saying is that the "Client Logic" layer is *not* dependent on the "Implementation" layer, nor should it be. The lack of a directed link in this last case is very important.&lt;br&gt;&lt;br&gt;But now we need to map our source code onto this layer diagram, so that the system can verify that your code is complying or *not* complying with the constraints this seemingly simple diagram is describing.&lt;br&gt;&lt;br&gt;Let's do that now.&lt;br&gt;&lt;/li&gt;&lt;/ol&gt; &lt;h3&gt;&lt;u&gt;Map Source Onto the Layers&lt;/u&gt;&lt;/h3&gt; &lt;ol&gt; &lt;li&gt;In the Solution Explorer, click and drag the "Client" project out onto the layer diagram and release your mouse on the "Client Logic" layer shape:&lt;br&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_51.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="227" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_21.png" width="541" border="0"&gt;&lt;/a&gt;&amp;nbsp;&lt;br&gt;&lt;/li&gt; &lt;li&gt;Drag the "Interfaces" project from the Solution Explorer out onto the layer diagram and let go over the top of the "Interfaces" layer shape:&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="224" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_54.png" width="537" border="0"&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;And finally, drag the "Implementation" project from the Solution Explorer out onto the "Implementation" layer shape:&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="187" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_57.png" width="497" border="0"&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;Your layer diagram should now look something like this. Notice the little icons in the upper right hand corner of the shapes. This indicates that source ( or some type of artifact(s) ) has been associated to the layer:&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="465" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_60.png" width="335" border="0"&gt; &lt;br&gt;&lt;br&gt;If you select the "Client Logic" shape, then click on the "Layer Explorer", that shows you the types of items associated with the layer. In this case, the "Client" csharp project:&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="195" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_63.png" width="733" border="0"&gt;&lt;br&gt;&lt;br&gt; Now we're ready to "Validate" our code against the diagram.&lt;br&gt;&lt;/li&gt; &lt;li&gt;Right click anywhere in the layer diagram and select "Validate":&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="444" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_66.png" width="310" border="0"&gt; &lt;br&gt;&lt;br&gt;Notice an error is displayed in the Error Window:&lt;br&gt;&lt;br&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_68.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="172" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_thumb_27.png" width="644" border="0"&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;This is expected at this point, 'cause the code in Program.cs found in the "Client" project is directly manipulating types from the "Implementation" project. We just finished creating a layer diagram that declares this type of dependency invalid!&lt;br&gt;&lt;br&gt;So let's fix the problem in code so that this layer validation error goes away.&lt;br&gt;&lt;/li&gt;&lt;/ol&gt; &lt;h3&gt;&lt;u&gt;Fix Code&lt;/u&gt;&lt;/h3&gt; &lt;p&gt;Back in Program.cs, we need to make sure that we are only using types out of the "Interfaces" project, or more importantly, *not* use types out of the "Implementation" project. That's all well and good, but we need a way to get an instance of an object that implements IDataRetriever without taking a direct dependency on that type. &lt;br&gt;&lt;br&gt;Enter the Factory pattern.&lt;br&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt;In the Solution Explorer, expand the "Creators" project, right click on "Class1.cs", select "Rename...", and rename the file to "TypeCreator.cs".&lt;/li&gt; &lt;li&gt;Add the "Implementation" project and "Interfaces" as a references to the "Creators" project ( i.e., "Creators" now depends on the "Implementation" and "Interfaces" projects ).&lt;/li&gt; &lt;li&gt;Double click on the "TypeCreator.cs" file in Solution Explorer, which will make that file fill the document well.&lt;/li&gt; &lt;li&gt;Add a static method that creates a "DataRetriever" object but returns an IDataRetriever interface. TypeCreator.cs should look similar to this:&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="356" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_74.png" width="543" border="0"&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;In the "Client" project, remove the "Implementation" project reference, and add a reference to the "Creators" project.&lt;/li&gt; &lt;li&gt;Change Program.cs to take advantage of the new method we just created. Program.cs should look something like this:&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="393" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_73.png" width="612" border="0"&gt; &lt;br&gt;&lt;/li&gt; &lt;li&gt;Rebuild the solution. No errors.&lt;br&gt;&lt;br&gt;Now we need to bring up the Architecture Explorer and click the refresh button to work around a current limitation in the CTP bits.&lt;br&gt;&lt;/li&gt; &lt;li&gt;From the main menu bar, select "View-&amp;gt;Architecture Explorer".&lt;/li&gt; &lt;li&gt;Select the "Refresh Content" button on that explorer:&lt;br&gt;&lt;br&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="206" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/LayerValidationwiththeVSTS2010CTP_ED27/image_77.png" width="363" border="0"&gt; &lt;/li&gt; &lt;li&gt;Now bring the FirstLayerDiagram back into view, right click on "Validate", and take a look at the error tool window. No errors! WooHoo! :)&lt;/li&gt;&lt;/ol&gt; &lt;h3&gt;&lt;u&gt;Summary&lt;/u&gt;&lt;/h3&gt; &lt;p&gt;I've shown you, through an admittedly trivial example, how to validate your solution through a simple Layer diagram. I've shown you how to map source onto the layers and how to tell the system what dependencies are valid and which are not via a manual gesture and that diagram.&lt;/p&gt; &lt;p&gt;There is much more to show on this diagram and how you can interact with it. A very important next step is to show you how to make the Validation action an automatic step in your build process. I'll do that in a future post. &lt;/p&gt; &lt;p&gt;Stay tuned! :)&lt;/p&gt; &lt;p&gt;Cameron&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9186397" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/camerons/archive/tags/tsbt-arch/default.aspx">tsbt-arch</category><category domain="http://blogs.msdn.com/camerons/archive/tags/Architecture+Edition/default.aspx">Architecture Edition</category><category domain="http://blogs.msdn.com/camerons/archive/tags/Layer+Diagram/default.aspx">Layer Diagram</category><category domain="http://blogs.msdn.com/camerons/archive/tags/VSTS+2010+Fall+CTP/default.aspx">VSTS 2010 Fall CTP</category></item><item><title>VSTS 2010 CTP, Hyper-V, and January 1st, 2009</title><link>http://blogs.msdn.com/camerons/archive/2008/12/06/vsts-2010-ctp-hyper-v-and-january-1st-2009.aspx</link><pubDate>Sun, 07 Dec 2008 00:40:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9181511</guid><dc:creator>camerons</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/camerons/comments/9181511.aspx</comments><wfw:commentRss>http://blogs.msdn.com/camerons/commentrss.aspx?PostID=9181511</wfw:commentRss><description>&lt;p&gt;For those of you folks who have converted the VSTS 2010 CTP ( see &lt;a href="http://blogs.msdn.com/granth/archive/2008/11/03/converting-vs2010-ctp-to-hyper-v.aspx"&gt;Grant's post&lt;/a&gt; ) to take advantage of the performance improvements in hyper-v, here's a manual way to get around the fact that VSTS will expire Jan. 1st 2009. ( If you're using the CTP with VPC, see &lt;a href="http://blogs.msdn.com/briankel/archive/2008/10/27/visual-studio-2010-ctp-vpc-dealing-with-activation-messages.aspx"&gt;Brian's post&lt;/a&gt; for a similar workaround ).&lt;/p&gt; &lt;p&gt;&lt;strong&gt;1)&lt;/strong&gt; The first thing to do is snapshot your current image ( if you followed Grant's steps, that should have been the last thing you did while you converted your image to hyper-v ). You'll need this to rollback as needed.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;2)&lt;/strong&gt; Next, you need to turn off the Time Synchronization feature that the Integration Services of Hyper-v do for you. Do this by going into your Hyper-V Manager, right click on your VSTS 2010 CTP image, select "Settings...". This will prevent the guest image from automatically synching its system time with the host machine while the guest is running. If you don't do this first, steps 4+ won't work at all.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/VSTS2010CTPHyperVandJanuary1st2009_BF7C/image_2.png" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="484" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/VSTS2010CTPHyperVandJanuary1st2009_BF7C/image_thumb.png" width="519" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;3)&lt;/strong&gt; Now start the CTP image.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;4)&lt;/strong&gt;&amp;nbsp; In the bottom right hand corner of the CTP image, click on the time display in the status bar, which brings up the clock settings. Click "Change date and time settings..."&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/VSTS2010CTPHyperVandJanuary1st2009_BF7C/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="284" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/VSTS2010CTPHyperVandJanuary1st2009_BF7C/image_thumb_1.png" width="342" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;5)&lt;/strong&gt; In the "Date and Time" dialog, click on the "Internet Time" tab, click the "Change settings..." button, which gives you the dialog below. Uncheck the "Synchronize with an Internet time server" check box. Hit OK.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/VSTS2010CTPHyperVandJanuary1st2009_BF7C/image_6.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="484" alt="image" src="http://blogs.msdn.com/blogfiles/camerons/WindowsLiveWriter/VSTS2010CTPHyperVandJanuary1st2009_BF7C/image_thumb_2.png" width="590" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;6)&lt;/strong&gt; Now back in the "Date and Time" dialog, change the date to something like October 20th, 2008 by first clicking on "Change date and time..." button. You can't go back too far, otherwise you'll get the dreaded "Eval has expired" dialog. Hit OK on that dialog, and then OK again to close the "Date and Time" dialog.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;7)&lt;/strong&gt; Now fire up VSTS, you're good to go!&lt;/p&gt; &lt;p&gt;Since this is such a manual process, I would recommend going through the steps above, and then Pause then Save the image each time you want to regain the memory being used up by the image.&lt;/p&gt; &lt;p&gt;Hope that helps,&lt;/p&gt; &lt;p&gt;Cameron&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9181511" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/camerons/archive/tags/Team+System/default.aspx">Team System</category><category domain="http://blogs.msdn.com/camerons/archive/tags/VSTS+2010+Fall+CTP/default.aspx">VSTS 2010 Fall CTP</category></item></channel></rss>