<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/4.0.3" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Architecture, Design &#38; Strategy - Author(s): Alex Ullrich</title>
		<link>http://blogs.lessthandot.com/index.php/Architect/</link>
		<atom:link rel="self" type="application/rss+xml" href="http://blogs.lessthandot.com/index.php/Architect/?tempskin=_rss2" />
		<description></description>
		<language>en-GB</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=4.0.3"/>
		<ttl>60</ttl>
				<item>
			<title>Getting Flexible With NDepend 4 and CQLinq</title>
			<link>http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/getting-flexible-with-ndepend-4-and-cqlinq</link>
			<pubDate>Mon, 04 Jun 2012 10:45:00 +0000</pubDate>			<dc:creator>Alex Ullrich</dc:creator>
			<category domain="main">Designing Software</category>			<guid isPermaLink="false">1746@http://blogs.lessthandot.com/</guid>
						<description>&lt;p&gt;At my last job we had a non-functional attribute that another team used to decorate service methods that they consumed.  The other team was working on an alternative client to our WCF services, and they weren&#039;t on the same release schedule they needed to be able to target multiple versions of our services within a single version of their application.  Because of this requirement, they maintained a wrapper around our services that handled some of the differences   between versions.  The main use for this attribute was to foster communication between the teams, so that if we changed a decorated method we would let them know.  As I&#039;m sure anyone on this other team would tell you, we weren&#039;t always that good about communicating these changes.&lt;/p&gt;

&lt;p&gt;In an effort to make communication between teams easier we used a CQL query like this to report changes to these methods as part of our automated builds:&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;sql&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;sql&quot; id=&quot;cb18717&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; METHODS &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; NAMESPACES &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Services&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; HasAttribute &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;OPTIONAL:Services.KnownExternalClientsAttribute&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; CodeWasChanged&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb3015&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This was nice, but it only got us part of the way there.  This would alert us to signature changes or changes to the content of the method, but not necessarily changes to the message contracts passed in to the method.  In Pseudo-CQL the query I had in mind looks something like this:&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;sql&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;sql&quot; id=&quot;cb84695&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; TYPES &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; NAMESPACES &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Services&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; CodeWasChanged&lt;br /&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; IsUsedBy &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; METHODS &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; NAMESPACES &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Services&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; HasAttribute &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;OPTIONAL:Services.KnownExternalClientsAttribute&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb76534&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This didn&#039;t work however (CQL doesn&#039;t really have support for subqueries), and I couldn&#039;t really find anything in the language that would allow us to achieve what we wanted.  NDepend 4 introduces a new linq-based replacement called CQLinq that offers a lot more flexibility, so I figured I would see if I could write the query that we needed using it.  It ended up being much easier than I thought - CQLinq gives us access to most (if not all) of the standard LINQ operators, and the same functions for querying code using attributes and history that we had with CQL.  This is the query I came up with:&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;csharp&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;csharp&quot; id=&quot;cb90371&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;// &amp;lt;Name&amp;gt;Test Query for Contract Changes&amp;lt;/Name&amp;gt;&lt;/span&gt;&lt;br /&gt;warnif count &amp;gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;0&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;let decoratedMethods = from m &lt;span style=&quot;color: #0600FF;&quot;&gt;in&lt;/span&gt; JustMyCode.&lt;span style=&quot;color: #0000FF;&quot;&gt;Methods&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; where m.&lt;span style=&quot;color: #0000FF;&quot;&gt;HasAttribute&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;quot;NDependSample.TestAttribute&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; m.&lt;span style=&quot;color: #0000FF;&quot;&gt;ParentNamespace&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Name&lt;/span&gt; == &lt;span style=&quot;color: #808080;&quot;&gt;&amp;quot;NDependSample.Services&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; select m&lt;br /&gt;&amp;nbsp;&lt;br /&gt;from t &lt;span style=&quot;color: #0600FF;&quot;&gt;in&lt;/span&gt; JustMyCode.&lt;span style=&quot;color: #0000FF;&quot;&gt;Types&lt;/span&gt;&lt;br /&gt;where &amp;nbsp;t.&lt;span style=&quot;color: #0000FF;&quot;&gt;ParentNamespace&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Name&lt;/span&gt; == &lt;span style=&quot;color: #808080;&quot;&gt;&amp;quot;NDependSample.Contracts&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;amp;&amp;amp; t.&lt;span style=&quot;color: #0000FF;&quot;&gt;CodeWasChanged&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;amp;&amp;amp; decoratedMethods.&lt;span style=&quot;color: #0600FF;&quot;&gt;Using&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;t&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Any&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;select t&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb29564&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once we have the query we can mark it as critical, so we will have a failing build after the changes are made.  Only the first build after making the changes should fail, but that would be enough to trigger an investigation that would result in communicating the changes to the other team.&lt;/p&gt;

&lt;p&gt;CQL has always been my favorite feature of NDepend, so its no surprise that CQLinq is my favorite feature in this new release.  The LINQ based syntax feels much more natural to me when writing queries against a codebase than the SQL-like syntax of CQL, and still gives us all the same visualization goodies to foster quick understanding of the query results.  I&#039;m really excited to dig in a little more and see what else I can do with it.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/getting-flexible-with-ndepend-4-and-cqlinq&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>At my last job we had a non-functional attribute that another team used to decorate service methods that they consumed.  The other team was working on an alternative client to our WCF services, and they weren't on the same release schedule they needed to be able to target multiple versions of our services within a single version of their application.  Because of this requirement, they maintained a wrapper around our services that handled some of the differences   between versions.  The main use for this attribute was to foster communication between the teams, so that if we changed a decorated method we would let them know.  As I'm sure anyone on this other team would tell you, we weren't always that good about communicating these changes.</p>

<p>In an effort to make communication between teams easier we used a CQL query like this to report changes to these methods as part of our automated builds:</p>

<div class="codebox"><div class="codeheader"><span>sql</span><div class="codebox_javascript_links"><a href="http://blogs.lessthandot.com" onclick="linenumberOnOff('cb7003'); return false;">Line number Off</a> | <a href="http://blogs.lessthandot.com#" onclick="expandCode('cb7003','cb9732'); return false;">Hide</a> | <a href="http://blogs.lessthandot.com#" onclick="selectCode(this); return false;">Select all</a></div></div><!-- we need this dummy div to fix a firefox bug when selecting code lines --><div class="codeholder"><div class="sql" id="cb7003" style="display: block; color: rgb(0, 0, 0);"><ol><li style="" class="li1"><span style="color: #993333; font-weight: bold;">SELECT</span> METHODS <span style="color: #993333; font-weight: bold;">FROM</span> NAMESPACES <span style="color: #ff0000;">&quot;Services&quot;</span></li><li style="" class="li2"><span style="color: #993333; font-weight: bold;">WHERE</span> HasAttribute <span style="color: #ff0000;">&quot;OPTIONAL:Services.KnownExternalClientsAttribute&quot;</span></li><li style="" class="li1"><span style="color: #993333; font-weight: bold;">AND</span> CodeWasChanged</li></ol></div><div id="cb9732" style="display: none; color: red;"></div></div></div>

<p>This was nice, but it only got us part of the way there.  This would alert us to signature changes or changes to the content of the method, but not necessarily changes to the message contracts passed in to the method.  In Pseudo-CQL the query I had in mind looks something like this:</p>

<div class="codebox"><div class="codeheader"><span>sql</span><div class="codebox_javascript_links"><a href="http://blogs.lessthandot.com" onclick="linenumberOnOff('cb7453'); return false;">Line number Off</a> | <a href="http://blogs.lessthandot.com#" onclick="expandCode('cb7453','cb41597'); return false;">Hide</a> | <a href="http://blogs.lessthandot.com#" onclick="selectCode(this); return false;">Select all</a></div></div><!-- we need this dummy div to fix a firefox bug when selecting code lines --><div class="codeholder"><div class="sql" id="cb7453" style="display: block; color: rgb(0, 0, 0);"><ol><li style="" class="li1"><span style="color: #993333; font-weight: bold;">SELECT</span> TYPES <span style="color: #993333; font-weight: bold;">FROM</span> NAMESPACES <span style="color: #ff0000;">&quot;Services&quot;</span></li><li style="" class="li2"><span style="color: #993333; font-weight: bold;">WHERE</span> CodeWasChanged</li><li style="" class="li1"><span style="color: #993333; font-weight: bold;">AND</span> IsUsedBy <span style="color: #66cc66;">&#40;</span></li><li style="" class="li2">&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">SELECT</span> METHODS <span style="color: #993333; font-weight: bold;">FROM</span> NAMESPACES <span style="color: #ff0000;">&quot;Services&quot;</span></li><li style="" class="li1">&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">WHERE</span> HasAttribute <span style="color: #ff0000;">&quot;OPTIONAL:Services.KnownExternalClientsAttribute&quot;</span></li><li style="" class="li2"><span style="color: #66cc66;">&#41;</span></li></ol></div><div id="cb41597" style="display: none; color: red;"></div></div></div>

<p>This didn't work however (CQL doesn't really have support for subqueries), and I couldn't really find anything in the language that would allow us to achieve what we wanted.  NDepend 4 introduces a new linq-based replacement called CQLinq that offers a lot more flexibility, so I figured I would see if I could write the query that we needed using it.  It ended up being much easier than I thought - CQLinq gives us access to most (if not all) of the standard LINQ operators, and the same functions for querying code using attributes and history that we had with CQL.  This is the query I came up with:</p>

<div class="codebox"><div class="codeheader"><span>csharp</span><div class="codebox_javascript_links"><a href="http://blogs.lessthandot.com" onclick="linenumberOnOff('cb31269'); return false;">Line number Off</a> | <a href="http://blogs.lessthandot.com#" onclick="expandCode('cb31269','cb13695'); return false;">Hide</a> | <a href="http://blogs.lessthandot.com#" onclick="selectCode(this); return false;">Select all</a></div></div><!-- we need this dummy div to fix a firefox bug when selecting code lines --><div class="codeholder"><div class="csharp" id="cb31269" style="display: block; color: rgb(0, 0, 0);"><ol><li style="" class="li1"><span style="color: #008080; font-style: italic;">// &lt;Name&gt;Test Query for Contract Changes&lt;/Name&gt;</span></li><li style="" class="li2">warnif count &gt; <span style="color: #FF0000;">0</span></li><li style="" class="li1">&nbsp;</li><li style="" class="li2">let decoratedMethods = from m <span style="color: #0600FF;">in</span> JustMyCode.<span style="color: #0000FF;">Methods</span></li><li style="" class="li1">&nbsp; &nbsp; where m.<span style="color: #0000FF;">HasAttribute</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;NDependSample.TestAttribute&quot;</span><span style="color: #000000;">&#41;</span></li><li style="" class="li2">&nbsp; &nbsp; &nbsp; &nbsp; &amp;&amp; m.<span style="color: #0000FF;">ParentNamespace</span>.<span style="color: #0000FF;">Name</span> == <span style="color: #808080;">&quot;NDependSample.Services&quot;</span></li><li style="" class="li1">&nbsp; &nbsp; select m</li><li style="" class="li2">&nbsp;</li><li style="" class="li1">from t <span style="color: #0600FF;">in</span> JustMyCode.<span style="color: #0000FF;">Types</span></li><li style="" class="li2">where &nbsp;t.<span style="color: #0000FF;">ParentNamespace</span>.<span style="color: #0000FF;">Name</span> == <span style="color: #808080;">&quot;NDependSample.Contracts&quot;</span></li><li style="" class="li1">&nbsp; &amp;&amp; t.<span style="color: #0000FF;">CodeWasChanged</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></li><li style="" class="li2">&nbsp; &amp;&amp; decoratedMethods.<span style="color: #0600FF;">Using</span><span style="color: #000000;">&#40;</span>t<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Any</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></li><li style="" class="li1">select t</li></ol></div><div id="cb13695" style="display: none; color: red;"></div></div></div>

<p>Once we have the query we can mark it as critical, so we will have a failing build after the changes are made.  Only the first build after making the changes should fail, but that would be enough to trigger an investigation that would result in communicating the changes to the other team.</p>

<p>CQL has always been my favorite feature of NDepend, so its no surprise that CQLinq is my favorite feature in this new release.  The LINQ based syntax feels much more natural to me when writing queries against a codebase than the SQL-like syntax of CQL, and still gives us all the same visualization goodies to foster quick understanding of the query results.  I'm really excited to dig in a little more and see what else I can do with it.</p><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/getting-flexible-with-ndepend-4-and-cqlinq">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/getting-flexible-with-ndepend-4-and-cqlinq#comments</comments>
			<wfw:commentRss>http://blogs.lessthandot.com/index.php/Architect/?tempskin=_rss2&#38;disp=comments&#38;p=1746</wfw:commentRss>
		</item>
				<item>
			<title>CQL From Visual Studio With NDepend 3</title>
			<link>http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/cql-from-visual-studio-with-ndepend-3</link>
			<pubDate>Mon, 06 Sep 2010 20:29:00 +0000</pubDate>			<dc:creator>Alex Ullrich</dc:creator>
			<category domain="main">Designing Software</category>			<guid isPermaLink="false">955@http://blogs.lessthandot.com/</guid>
						<description>&lt;p&gt;For the last few months I&#039;ve had the pleasure of working with &lt;a href=&quot;http://ndepend.com/&quot;&gt;NDepend&lt;/a&gt; version 3.  Most of my development at home is on linux these days, so I haven&#039;t used it as much as I&#039;d like, but I have been using it to poke around in various codebases and see what the new Visual Studio integration is all about.  The last version integrated with Visual Studio, technically speaking, but it didn&#039;t seem nearly as thorough as what I&#039;ve seen in version 3.  I suspect the improved extensibility model in VS 2010 has a lot to do with this, but can&#039;t confirm (I haven&#039;t tried it with 2008 either).&lt;/p&gt;

&lt;p&gt;My favorite feature of NDepend has always been CQL, the SQL-like query language that allows you to query your codebase using a variety of common metrics.  This is the same as it ever was (the integration with VS is even quite similar) but with the more thorough integration it seems much more useful.  I like how easy it is now to keep an eye on my CQL constraints when I rebuild.&lt;/p&gt;

&lt;p&gt;My favorite CQL feature is the ability to set up CQL constraints &lt;em&gt;from now&lt;/em&gt;.  This is really cool for older projects, where it&#039;s unrealistic to think that your team will be able to fix everything right away.  But what you can do with this feature is ensure that all &lt;em&gt;new or modified&lt;/em&gt; code does measure up to your team&#039;s standards.  You may not be able to clean up all those 1,000 line methods right away, but you &lt;em&gt;can&lt;/em&gt; ensure that newer methods fit in a more reasonable size limit (like 975 &lt;img src=&quot;http://blogs.lessthandot.com/rsc/smilies/icon_wink.gif&quot; title=&quot;;)&quot; alt=&quot;;)&quot; class=&quot;middle&quot; width=&quot;15&quot; height=&quot;15&quot; /&gt; ).  This is one of the most useful features of the application, IMO.  The way it works is by allowing you to establish a baseline.  By comparing the code&#039;s current state to this baseline, future analyses are able to determine which methods/types/etc are new or changed, and apply the constraint to only these methods/types/etc.  Sometimes I feel like this would be useful just to be able to concisely see which methods have been changed as well (version control logs aren&#039;t the most friendly things to read, especially spread throughout a large codebase).  Below is a screenshot of this feature in action.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/Architect/CQL-VS-NDepend3/cqlexplorer.PNG&quot; alt=&quot;CQL Explorer&quot; title=&quot;CQL Explorer Screenshot&quot; width=&quot;971&quot; height=&quot;283&quot; /&gt;&lt;/div&gt;

&lt;p&gt;The first three queries listed are built in to NDepend.  I added the fourth, just to have a listing of new/changed methods ready.  The CQL for this query is simply &lt;/p&gt;&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;text&quot; id=&quot;cb69846&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;SELECT METHODS WHERE WasAdded OR CodeWasChanged&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb17262&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Not a bad way to keep an eye on what is getting changed in the codebase.  To get in this state I added three new methods to the codebase I was looking at (in a place that I could remove them easily since they are not only low quality but useless as well). Two had 7 parameters, putting them in violation of the constraint for basic quality principles.  I didn&#039;t add any tests, so all three were in violation of the test coverage constraint.  And finally they all showed up in the list of new methods.  It&#039;s worth noting the yellow circle at the bottom right as well - the yellow means that warnings were encountered when running the CQL portion of the analysis.  Green would be good, and red would mean I have some bad queries that can&#039;t be run.  &lt;/p&gt;

&lt;p&gt;Double clicking a row in the CQL Explorer will take you to the CQL Editor - from here you can view the results of the query, and the CQL it contains.  From there you can easily navigate to the method definition in your source code by double-clicking.  &lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/Architect/CQL-VS-NDepend3/cqleditor.PNG&quot; alt=&quot;CQL Editor&quot; title=&quot;CQL Editor Screenshot&quot; width=&quot;457&quot; height=&quot;913&quot; /&gt;&lt;/div&gt;

&lt;p&gt;One of the things I really like here is the comments in the built-in queries.  They contain numerous links to metric definitions on the NDepend website, and sometimes even links to blog entries where the lead developer, &lt;a href=&quot;http://codebetter.com/blogs/patricksmacchia/default.aspx&quot;&gt;Patrick Smacchia&lt;/a&gt; has explained features in greater detail.  I really like this form of documentation, it makes it easier to keep up to date and also minimizes what needs to be stored on the user&#039;s computer.  &lt;/p&gt;

&lt;p&gt;What I was happiest to find in the VS integration is the ability to superimpose CQL results onto the metrics view.  The metrics view consists of a grid where each block represents a unit of code (type, method, etc...) and they are sized according to their value for the metric in question.  When running CQL queries, the units of code matching your criteria are highlighted, giving a great visualization of how much code exhibits the properties you are looking for.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/Architect/CQL-VS-NDepend3/metricsexplorer.PNG&quot; alt=&quot;Metrics Explorer&quot; title=&quot;CQL Metrics Explorer&quot; width=&quot;887&quot; height=&quot;686&quot; /&gt;&lt;/div&gt;

&lt;p&gt;The selected query (about types having too many efferent couplings) is the currently selected query, and I had moused over the QueryParser class to highlight it in pink and show the metrics summary on the right.  I find that having this built right into visual studio really helps me figure out where to focus my refactoring energy.&lt;/p&gt;

&lt;p&gt;It looks as if a lot of effort went into &lt;a href=&quot;http://codebetter.com/blogs/patricksmacchia/archive/2010/08/29/validating-code-rules-in-visual-studio.aspx&quot;&gt;making the CQL validation phase fast&lt;/a&gt;: &lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;CQL rules validation phase is fast. The performance challenge was to make this happens almost instantly to avoid slowing the developer machine. Hopefully for a large 100K Lines of Code application, code gets re-analyzed and 200 CQL rules can get checked, all within 3 seconds after the (re)compilation of one or several .NET assemblies. These fast performances were made possible thanks to the development of a new technology of incremental code analysis. With incremental code analysis, only modified code gets re-analyzed. I can attest that this was extremely challenging and complex development!&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;From what I&#039;ve seen, the effort&#039;s been a success.  I&#039;ve mostly been using it to look at different versions of &lt;a href=&quot;http://lucene.apache.org/lucene.net/&quot;&gt;Lucene.net&lt;/a&gt;, as I&#039;ve got some work to do to get some of my code to build in VS2010.  For this size codebase (~23k lines) the analysis is completed very quickly, even if I disable the incremental analysis.  The CQL validation portion completes almost instantly, and memory usage doesn&#039;t seem to get out of hand even when keeping VS open for days.  I&#039;d imagine if your computer can handle running Visual Studio to begin with, it won&#039;t have too much trouble with the NDepend integration. I could see some of the VS add-ins that don&#039;t play well with others causing issues, especially with a very large codebase, so I hope to go back and test with a larger codebase and some other add-ins installed eventually.&lt;/p&gt;

&lt;p&gt;Most of the other NDepend goodies are available in VS now as well (Dependency Graphs, Test Coverage Analysis, Class Browser, etc...) but I won&#039;t get into all that here.  I really see CQL as the app&#039;s killer feature, and that is what I spend the most time thinking about.  There is a good overview of the app&#039;s capabilities &lt;a href=&quot;http://www.ndepend.com/Features.aspx#Tour&quot;&gt;here&lt;/a&gt; if you&#039;d like to read more.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/cql-from-visual-studio-with-ndepend-3&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>For the last few months I've had the pleasure of working with <a href="http://ndepend.com/">NDepend</a> version 3.  Most of my development at home is on linux these days, so I haven't used it as much as I'd like, but I have been using it to poke around in various codebases and see what the new Visual Studio integration is all about.  The last version integrated with Visual Studio, technically speaking, but it didn't seem nearly as thorough as what I've seen in version 3.  I suspect the improved extensibility model in VS 2010 has a lot to do with this, but can't confirm (I haven't tried it with 2008 either).</p>

<p>My favorite feature of NDepend has always been CQL, the SQL-like query language that allows you to query your codebase using a variety of common metrics.  This is the same as it ever was (the integration with VS is even quite similar) but with the more thorough integration it seems much more useful.  I like how easy it is now to keep an eye on my CQL constraints when I rebuild.</p>

<p>My favorite CQL feature is the ability to set up CQL constraints <em>from now</em>.  This is really cool for older projects, where it's unrealistic to think that your team will be able to fix everything right away.  But what you can do with this feature is ensure that all <em>new or modified</em> code does measure up to your team's standards.  You may not be able to clean up all those 1,000 line methods right away, but you <em>can</em> ensure that newer methods fit in a more reasonable size limit (like 975 <img src="http://blogs.lessthandot.com/rsc/smilies/icon_wink.gif" title=";)" alt=";)" class="middle" width="15" height="15" /> ).  This is one of the most useful features of the application, IMO.  The way it works is by allowing you to establish a baseline.  By comparing the code's current state to this baseline, future analyses are able to determine which methods/types/etc are new or changed, and apply the constraint to only these methods/types/etc.  Sometimes I feel like this would be useful just to be able to concisely see which methods have been changed as well (version control logs aren't the most friendly things to read, especially spread throughout a large codebase).  Below is a screenshot of this feature in action.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/Architect/CQL-VS-NDepend3/cqlexplorer.PNG" alt="CQL Explorer" title="CQL Explorer Screenshot" width="971" height="283" /></div>

<p>The first three queries listed are built in to NDepend.  I added the fourth, just to have a listing of new/changed methods ready.  The CQL for this query is simply </p><div class="codebox"><div class="codeheader"><span>text</span><div class="codebox_javascript_links"><a href="http://blogs.lessthandot.com" onclick="linenumberOnOff('cb73675'); return false;">Line number Off</a> | <a href="http://blogs.lessthandot.com#" onclick="expandCode('cb73675','cb54800'); return false;">Hide</a> | <a href="http://blogs.lessthandot.com#" onclick="selectCode(this); return false;">Select all</a></div></div><!-- we need this dummy div to fix a firefox bug when selecting code lines --><div class="codeholder"><div class="text" id="cb73675" style="display: block; color: rgb(0, 0, 0);"><ol><li style="" class="li1">SELECT METHODS WHERE WasAdded OR CodeWasChanged</li></ol></div><div id="cb54800" style="display: none; color: red;"></div></div></div>
<p>Not a bad way to keep an eye on what is getting changed in the codebase.  To get in this state I added three new methods to the codebase I was looking at (in a place that I could remove them easily since they are not only low quality but useless as well). Two had 7 parameters, putting them in violation of the constraint for basic quality principles.  I didn't add any tests, so all three were in violation of the test coverage constraint.  And finally they all showed up in the list of new methods.  It's worth noting the yellow circle at the bottom right as well - the yellow means that warnings were encountered when running the CQL portion of the analysis.  Green would be good, and red would mean I have some bad queries that can't be run.  </p>

<p>Double clicking a row in the CQL Explorer will take you to the CQL Editor - from here you can view the results of the query, and the CQL it contains.  From there you can easily navigate to the method definition in your source code by double-clicking.  </p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/Architect/CQL-VS-NDepend3/cqleditor.PNG" alt="CQL Editor" title="CQL Editor Screenshot" width="457" height="913" /></div>

<p>One of the things I really like here is the comments in the built-in queries.  They contain numerous links to metric definitions on the NDepend website, and sometimes even links to blog entries where the lead developer, <a href="http://codebetter.com/blogs/patricksmacchia/default.aspx">Patrick Smacchia</a> has explained features in greater detail.  I really like this form of documentation, it makes it easier to keep up to date and also minimizes what needs to be stored on the user's computer.  </p>

<p>What I was happiest to find in the VS integration is the ability to superimpose CQL results onto the metrics view.  The metrics view consists of a grid where each block represents a unit of code (type, method, etc...) and they are sized according to their value for the metric in question.  When running CQL queries, the units of code matching your criteria are highlighted, giving a great visualization of how much code exhibits the properties you are looking for.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/Architect/CQL-VS-NDepend3/metricsexplorer.PNG" alt="Metrics Explorer" title="CQL Metrics Explorer" width="887" height="686" /></div>

<p>The selected query (about types having too many efferent couplings) is the currently selected query, and I had moused over the QueryParser class to highlight it in pink and show the metrics summary on the right.  I find that having this built right into visual studio really helps me figure out where to focus my refactoring energy.</p>

<p>It looks as if a lot of effort went into <a href="http://codebetter.com/blogs/patricksmacchia/archive/2010/08/29/validating-code-rules-in-visual-studio.aspx">making the CQL validation phase fast</a>: </p><blockquote><p>CQL rules validation phase is fast. The performance challenge was to make this happens almost instantly to avoid slowing the developer machine. Hopefully for a large 100K Lines of Code application, code gets re-analyzed and 200 CQL rules can get checked, all within 3 seconds after the (re)compilation of one or several .NET assemblies. These fast performances were made possible thanks to the development of a new technology of incremental code analysis. With incremental code analysis, only modified code gets re-analyzed. I can attest that this was extremely challenging and complex development!</p></blockquote>
<p>From what I've seen, the effort's been a success.  I've mostly been using it to look at different versions of <a href="http://lucene.apache.org/lucene.net/">Lucene.net</a>, as I've got some work to do to get some of my code to build in VS2010.  For this size codebase (~23k lines) the analysis is completed very quickly, even if I disable the incremental analysis.  The CQL validation portion completes almost instantly, and memory usage doesn't seem to get out of hand even when keeping VS open for days.  I'd imagine if your computer can handle running Visual Studio to begin with, it won't have too much trouble with the NDepend integration. I could see some of the VS add-ins that don't play well with others causing issues, especially with a very large codebase, so I hope to go back and test with a larger codebase and some other add-ins installed eventually.</p>

<p>Most of the other NDepend goodies are available in VS now as well (Dependency Graphs, Test Coverage Analysis, Class Browser, etc...) but I won't get into all that here.  I really see CQL as the app's killer feature, and that is what I spend the most time thinking about.  There is a good overview of the app's capabilities <a href="http://www.ndepend.com/Features.aspx#Tour">here</a> if you'd like to read more.</p><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/cql-from-visual-studio-with-ndepend-3">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/cql-from-visual-studio-with-ndepend-3#comments</comments>
			<wfw:commentRss>http://blogs.lessthandot.com/index.php/Architect/?tempskin=_rss2&#38;disp=comments&#38;p=955</wfw:commentRss>
		</item>
				<item>
			<title>Validating Architecture with Visual Studio 2010</title>
			<link>http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/validating-architecture-with-visual-stud-2010</link>
			<pubDate>Fri, 29 Jan 2010 11:11:00 +0000</pubDate>			<dc:creator>Alex Ullrich</dc:creator>
			<category domain="main">Designing Software</category>
<category domain="alt">Introduction to Architecture &amp; Design</category>			<guid isPermaLink="false">738@http://blogs.lessthandot.com/</guid>
						<description>&lt;p&gt;I went to a local MS launch event for Visual Studio today, mainly to see what was new with Team Foundation Server, but what really impressed me was some of the new architecture tools they&#039;ve added.  I admittedly haven&#039;t read too much about this before today (my needs have been well-served by &lt;a href=&quot;http://ndepend.com/&quot;&gt;NDepend&lt;/a&gt;) but I&#039;m happy to see some improved architecture tools find their way into Visual Studio.  Looking at the &lt;a href=&quot;http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx#compare&quot;&gt;version comparison chart&lt;/a&gt;, it appears this is only available in the &lt;em&gt;Ultimate&lt;/em&gt; version.&lt;/p&gt;

&lt;p&gt;For this example, I&#039;ll use a Layer Diagram for an imaginary application with Web, Business and Data tiers, and some shared model objects.  This is an intentionally oversimplified example.&lt;/p&gt;

&lt;p&gt;Anyway here&#039;s what the diagram looks like:&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/Architect/Validating-Architecture-VS2010/ArchitectureDiagramExample.PNG&quot; alt=&quot;Sample Architecture Diagram&quot; title=&quot;Diagram&quot; width=&quot;428&quot; height=&quot;372&quot; /&gt;&lt;/div&gt;

&lt;p&gt;Nothing really special here - the words are the name of the tier, and the numbers are the number of units of code (in this case projects, but you can add individual namespaces or classes as well).  To create the diagram, we need to first create a new Visual Studio Modeling Project.  A new layer diagram can then be added to this project.  I used the designer to add the shapes and dependency lines, and all looks good.  But we want to do more than look at it!&lt;/p&gt;

&lt;p&gt;This is where things get interesting.  To place modules into one of the tiers, you can drag and drop either from the Solution Explorer or from the new Architecture Explorer.  Both have different ways of finding the objects you are looking for, but the result is the same.  Once all modules are allocated to the right layer, you can right click the diagram and choose &quot;Validate Architecture&quot;.&lt;/p&gt;

&lt;p&gt;Visual Studio will then build your solution and validate its architecture.  If all goes well, you&#039;ll see something like this in the output window:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;1/28/2010 4:04:17 PM: Architecture validation is starting.&lt;br /&gt;
1/28/2010 4:04:23 PM: Architecture validation succeeded (0 suppressed).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, let&#039;s try adding an illegal call, in this case from the data tier to a caching provider found in the web tier (I first tried adding a reference to the &quot;Biz&quot; project, but was not allowed because it would introduce a cyclic dependency - I guess this was in previous versions but I never ran into it before - pretty cool).&lt;/p&gt;

&lt;p&gt;After this call is added, try validating the architecture again.  The solution will be rebuilt, and you&#039;ll see something like this: &lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;1/28/2010 4:19:46 PM: Architecture validation is starting.&lt;br /&gt;
1/28/2010 4:19:55 PM: Architecture validation failed with 3 violation(s) (0 suppressed).&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Ok, so we have violations, just as expected.  Clicking over to the error list you can find what exactly the errors are.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/Architect/Validating-Architecture-VS2010/ArchitectureValidationErrors.PNG&quot; alt=&quot;Architecture Validation Errors&quot; title=&quot;ArchitectureValidationErrors&quot; width=&quot;862&quot; height=&quot;233&quot; /&gt;&lt;/div&gt;

&lt;p&gt;So, not only do the undesirable calls added to the Data Layer&#039;s code trigger violations, but the reference itself does as well.  There are a few things of interest that we can do with the errors from here.  &lt;/p&gt;

&lt;p&gt;When right clicking the error, you can choose &quot;Manage Validation Errors&quot; from the context menu, and then &quot;Suppress Errors&quot;.  Well, as long as you&#039;re willing to do it at your own risk &lt;img src=&quot;http://blogs.lessthandot.com/rsc/smilies/icon_wink.gif&quot; title=&quot;;)&quot; alt=&quot;;)&quot; class=&quot;middle&quot; width=&quot;15&quot; height=&quot;15&quot; /&gt;.  Then you&#039;d end up with a build output like this:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;1/28/2010 4:25:03 PM: Architecture validation is starting.&lt;br /&gt;
1/28/2010 4:25:09 PM: Architecture validation succeeded (3 suppressed).&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Knowing our readership, I doubt this will be an option though.  So what can be done about this?  If you want to fix the error immediately, you can double click the error message and be taken to the offending code, just as you would for a syntax error if a normal build failed.  If you use Team Foundation Server, you can also select &quot;Create Work Item&quot; to create a new TFS work item based on the error.&lt;/p&gt;

&lt;p&gt;This can also be included as part of your local build process by setting the &quot;Validate Architecture&quot; property of the Modeling Project.  TFS users can also add this step to their team build by opening the Compilation tab and adding the following to the MSBuild arguments section:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;/p:ValidateArchitecture=true&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Adding this to the team build is especially cool, because you can actually block check-ins that introduce these kinds of architectural problems.&lt;/p&gt;

&lt;p&gt;I am &lt;strong&gt;really&lt;/strong&gt; excited to see this kind of stuff getting more attention in Visual Studio.  I&#039;m not sure if these new components will be able to do everything I&#039;ve come to expect (and love) from NDepend, but their presence is a huge step forward for Visual Studio, and I think for the .net community in general.  I&#039;m a big believer in the use of static code analysis as a tool for better understanding the code we work with, and I think that making these tools available to more developers (especially those in shops that are reluctant to use non-Microsoft components or tooling) will really help us continue to improve as a group.  &lt;/p&gt;

&lt;p&gt;I noticed while writing this post that &lt;a href=&quot;http://codebetter.com/blogs/patricksmacchia/archive/2010/01/28/ndepend-v3-is-now-100-integrated-in-visual-studio.aspx&quot;&gt;the latest beta of NDepend 3 is now fully integrated with Visual Studio&lt;/a&gt;.  I&#039;d meant to do a future post comparing the DGQL queries available in Visual Studio 2010 with NDepend&#039;s CQL, but perhaps a more thorough comparison will be in order.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/validating-architecture-with-visual-stud-2010&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>I went to a local MS launch event for Visual Studio today, mainly to see what was new with Team Foundation Server, but what really impressed me was some of the new architecture tools they've added.  I admittedly haven't read too much about this before today (my needs have been well-served by <a href="http://ndepend.com/">NDepend</a>) but I'm happy to see some improved architecture tools find their way into Visual Studio.  Looking at the <a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx#compare">version comparison chart</a>, it appears this is only available in the <em>Ultimate</em> version.</p>

<p>For this example, I'll use a Layer Diagram for an imaginary application with Web, Business and Data tiers, and some shared model objects.  This is an intentionally oversimplified example.</p>

<p>Anyway here's what the diagram looks like:</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/Architect/Validating-Architecture-VS2010/ArchitectureDiagramExample.PNG" alt="Sample Architecture Diagram" title="Diagram" width="428" height="372" /></div>

<p>Nothing really special here - the words are the name of the tier, and the numbers are the number of units of code (in this case projects, but you can add individual namespaces or classes as well).  To create the diagram, we need to first create a new Visual Studio Modeling Project.  A new layer diagram can then be added to this project.  I used the designer to add the shapes and dependency lines, and all looks good.  But we want to do more than look at it!</p>

<p>This is where things get interesting.  To place modules into one of the tiers, you can drag and drop either from the Solution Explorer or from the new Architecture Explorer.  Both have different ways of finding the objects you are looking for, but the result is the same.  Once all modules are allocated to the right layer, you can right click the diagram and choose "Validate Architecture".</p>

<p>Visual Studio will then build your solution and validate its architecture.  If all goes well, you'll see something like this in the output window:</p>

<blockquote><p>1/28/2010 4:04:17 PM: Architecture validation is starting.<br />
1/28/2010 4:04:23 PM: Architecture validation succeeded (0 suppressed).</p>
</blockquote>

<p>Now, let's try adding an illegal call, in this case from the data tier to a caching provider found in the web tier (I first tried adding a reference to the "Biz" project, but was not allowed because it would introduce a cyclic dependency - I guess this was in previous versions but I never ran into it before - pretty cool).</p>

<p>After this call is added, try validating the architecture again.  The solution will be rebuilt, and you'll see something like this: </p>

<blockquote><p>1/28/2010 4:19:46 PM: Architecture validation is starting.<br />
1/28/2010 4:19:55 PM: Architecture validation failed with 3 violation(s) (0 suppressed).</p></blockquote>

<p>Ok, so we have violations, just as expected.  Clicking over to the error list you can find what exactly the errors are.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/Architect/Validating-Architecture-VS2010/ArchitectureValidationErrors.PNG" alt="Architecture Validation Errors" title="ArchitectureValidationErrors" width="862" height="233" /></div>

<p>So, not only do the undesirable calls added to the Data Layer's code trigger violations, but the reference itself does as well.  There are a few things of interest that we can do with the errors from here.  </p>

<p>When right clicking the error, you can choose "Manage Validation Errors" from the context menu, and then "Suppress Errors".  Well, as long as you're willing to do it at your own risk <img src="http://blogs.lessthandot.com/rsc/smilies/icon_wink.gif" title=";)" alt=";)" class="middle" width="15" height="15" />.  Then you'd end up with a build output like this:</p>

<blockquote><p>1/28/2010 4:25:03 PM: Architecture validation is starting.<br />
1/28/2010 4:25:09 PM: Architecture validation succeeded (3 suppressed).</p></blockquote>

<p>Knowing our readership, I doubt this will be an option though.  So what can be done about this?  If you want to fix the error immediately, you can double click the error message and be taken to the offending code, just as you would for a syntax error if a normal build failed.  If you use Team Foundation Server, you can also select "Create Work Item" to create a new TFS work item based on the error.</p>

<p>This can also be included as part of your local build process by setting the "Validate Architecture" property of the Modeling Project.  TFS users can also add this step to their team build by opening the Compilation tab and adding the following to the MSBuild arguments section:</p>

<blockquote><p>/p:ValidateArchitecture=true</p></blockquote>

<p>Adding this to the team build is especially cool, because you can actually block check-ins that introduce these kinds of architectural problems.</p>

<p>I am <strong>really</strong> excited to see this kind of stuff getting more attention in Visual Studio.  I'm not sure if these new components will be able to do everything I've come to expect (and love) from NDepend, but their presence is a huge step forward for Visual Studio, and I think for the .net community in general.  I'm a big believer in the use of static code analysis as a tool for better understanding the code we work with, and I think that making these tools available to more developers (especially those in shops that are reluctant to use non-Microsoft components or tooling) will really help us continue to improve as a group.  </p>

<p>I noticed while writing this post that <a href="http://codebetter.com/blogs/patricksmacchia/archive/2010/01/28/ndepend-v3-is-now-100-integrated-in-visual-studio.aspx">the latest beta of NDepend 3 is now fully integrated with Visual Studio</a>.  I'd meant to do a future post comparing the DGQL queries available in Visual Studio 2010 with NDepend's CQL, but perhaps a more thorough comparison will be in order.</p><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/validating-architecture-with-visual-stud-2010">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/validating-architecture-with-visual-stud-2010#comments</comments>
			<wfw:commentRss>http://blogs.lessthandot.com/index.php/Architect/?tempskin=_rss2&#38;disp=comments&#38;p=738</wfw:commentRss>
		</item>
			</channel>
</rss>
