<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Architecture Rules - Blog</title>
	<atom:link href="http://blog.architecturerules.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.architecturerules.org</link>
	<description>"Assert Your Architecture"</description>
	<lastBuildDate>Thu, 20 Aug 2009 11:24:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Architecture Rules eats his own Dog Food</title>
		<link>http://blog.architecturerules.org/architecture-rules-eats-his-own-dog-food/</link>
		<comments>http://blog.architecturerules.org/architecture-rules-eats-his-own-dog-food/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 18:41:39 +0000</pubDate>
		<dc:creator>MykolaNikishov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[cyclic dependency]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=182</guid>
		<description><![CDATA[While adding support for YAML configuration files I introduced a cyclic dependency (shame on me) in our code base. How did I discovered this? First of all, this post is about eating your own dog food, right? One of the purposes of Architecture Rules is to report on cyclic dependencies among your project’s packages and classes. And my build system was ready to catch this with just running mvn test.]]></description>
			<content:encoded><![CDATA[<p><em>Reprinted from <a href="http://manandbytes.wordpress.com/2009/06/20/architecture-rules-eats-his-own-dog-food/">Architecture Rules eats his own dog food</a> with permission from <a href="http://blog.architecturerules.org/developers-and-contributors/">Mykola Nikishov</a></em></p>
<p>While <a href="http://code.google.com/p/architecturerules/issues/detail?id=83">adding support for YAML configuration files</a> I <a href="http://code.google.com/p/architecturerules/source/detail?r=686">introduced a cyclic dependency</a> (shame on me) in our code base. If this means nothing to you there are some reasons <a href="http://wiki.architecturerules.org/index.php?title=CyclicDependencies">why introducing cycles considered as a bad practice</a>.</p>
<p>How to catch problems like this one?</p>
<p>Your project’s build system must be ready for this. Integrate tools like <a href="http://code.google.com/p/architecturerules/">Architecture Rules</a> or any other <a href="http://wiki.architecturerules.org/index.php?title=Alternatives">alternative tool</a> into your Maven, Ant or whatever build system of your choice.</p>
<p>Build your projects and run tests against them continuously, with <a href="http://wiki.hudson-ci.org/display/HUDSON">Hudson</a>, <a href="http://cruisecontrol.sourceforge.net/">CruiseControl</a> or <a href="http://www.jetbrains.com/teamcity/">TeamCity</a></p>
<p>Sounds obviously for you? For sure.</p>
<p>As the problem popped up as soon as it was introduced, fixing it was <a href="http://code.google.com/p/architecturerules/source/detail?r=687">a trivial task</a>. I absolutely agree with a statement that every piece of code becomes “legacy” few hours after it’s written. Distributed development teams make such things even worse. <a href="http://agilemanifesto.org/">`Individuals and interactions over processes and tools’</a> don’t work.</p>
<p>How did I discovered this? First of all, this post is about <a href="http://en.wikipedia.org/wiki/Eating_one%27s_own_dog_food">eating your own dog food</a>, right? One of the purposes of <a href="http://code.google.com/p/architecturerules/">Architecture Rules</a> is to report on cyclic dependencies among your project’s packages and classes. And my build system was ready to catch this with just running <code>mvn test</code>.</p>
<p>How this looks like? As a plain old unit test’s failure:</p>
<pre class="brush: xml;">
Results :

Tests in error:
    testArchitecture(org.architecturerules.SimpleArchitectureTest)

Tests run: 99, Failures: 0, Errors: 1, Skipped: 0
</pre>
<p>In my case more details are in the <code>target/surefire-reports</code></p>
<p><code>org.architecturerules.SimpleArchitectureTest.txt</code>:</p>
<pre class="brush: xml;">
-------------------------------------------------------------------------------
Test set: org.architecturerules.SimpleArchitectureTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.54 sec &lt;&lt;&lt; FAILURE!
testArchitecture(org.architecturerules.SimpleArchitectureTest)  Time elapsed: 0.532 sec  &lt;&lt;&lt; ERROR!
org.architecturerules.exceptions.CyclicRedundancyException: 2 cyclic dependencies found:

	-- org.architecturerules.configuration.xml depends on
	|  |
	|  |-- org.architecturerules.configuration
	|	 |-- @ org.architecturerules.configuration.xml.DigesterConfigurationFactory
	|	    \ while
	|	     |-- org.architecturerules.configuration.DefaultConfigurationFactory
	|	       \ depends on org.architecturerules.configuration.xml
	|
	-- org.architecturerules.configuration depends on
	|  |
	|  |-- org.architecturerules.configuration.xml
	|	 |-- @ org.architecturerules.configuration.DefaultConfigurationFactory
	|	    \ while
	|	     |-- org.architecturerules.configuration.xml.DigesterConfigurationFactory
	|	       \ depends on org.architecturerules.configuration
	|

	at org.architecturerules.services.CyclicRedundancyServiceImpl.buildCyclicRedundancyException(CyclicRedundancyServiceImpl.java:162)
	at org.architecturerules.services.CyclicRedundancyServiceImpl.performCyclicRedundancyCheck(CyclicRedundancyServiceImpl.java:117)
	at org.architecturerules.AbstractArchitectureRulesConfigurationTest.doTests(AbstractArchitectureRulesConfigurationTest.java:143)
	at org.architecturerules.SimpleArchitectureTest.testArchitecture(SimpleArchitectureTest.java:51)
</pre>
<p>Thanks to our <a href="http://architecturerules.googlecode.com/svn/docs/maven-architecture-rules-plugin/plugin-info.html">Maven 2 plugin</a> your build will fail too as soon as you introduce cycles in a dependency graph. Even if your project uses Apache Ant (sorry, it’s not my favorite tool) as a build system, you can download and use our <a href="http://code.google.com/p/architecturerules/downloads/list?can=2&amp;q=ant">Ant task</a> to get the same result.</p>
<p>How-to setup Ant task? <del datetime="2009-06-20T18:34:51+00:00">Sorry, it’s <a href="http://72miles.com/architecturerules/getting-started">still not available</a> and I have any clue.</del> In a response to this post <a href="../developers-and-contributors/">Mike</a> provided this great <a href="http://wiki.architecturerules.org/index.php?title=Ant">how-to install and configure</a> guide. Thank you, Mike!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Farchitecture-rules-eats-his-own-dog-food%2F&amp;linkname=Architecture%20Rules%20eats%20his%20own%20Dog%20Food">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/hudson/" title="Hudson">Hudson</a></li></ul><hr />
<p><small>&copy; MykolaNikishov for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2009. |
<a href="http://blog.architecturerules.org/architecture-rules-eats-his-own-dog-food/">Permalink</a> |
<a href="http://blog.architecturerules.org/architecture-rules-eats-his-own-dog-food/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/architecture-rules-eats-his-own-dog-food/&amp;title=Architecture Rules eats his own Dog Food">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/continuous-integration/" rel="tag">continuous integration</a>, <a href="http://blog.architecturerules.org/tag/cyclic-dependency/" rel="tag">cyclic dependency</a>, <a href="http://blog.architecturerules.org/tag/maven/" rel="tag">maven</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/architecture-rules-eats-his-own-dog-food/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML Report Prototype</title>
		<link>http://blog.architecturerules.org/xml-report-prototype/</link>
		<comments>http://blog.architecturerules.org/xml-report-prototype/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 01:27:03 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[report]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=155</guid>
		<description><![CDATA[One of the 3.0 Roadmap items is an XML report. Eventually we will use this XML output for a Maven 2 report and hopefully it will be used to write a Sonar Plugin and a Hudson Plugin. We&#8217;ve prototyped one possible format for this output. This output should be enough to generate a rich architecture [...]]]></description>
			<content:encoded><![CDATA[<p>One of the <a href="http://blog.architecturerules.org/30-roadmap/">3.0 Roadmap</a> items is an XML report. Eventually we will use this XML output for a Maven 2 report and hopefully it will be used to write a <a href="http://sonar.codehaus.org/">Sonar Plugin</a> and a <a href="https://hudson.dev.java.net/">Hudson Plugin</a>. We&#8217;ve prototyped one possible format for this output. This output should be enough to generate a rich architecture report for maven 2 and eventually provide <a href="http://en.wikipedia.org/wiki/Dependency_Structure_Matrix">DSM analysis and reports</a>.</p>
<p>Have a look, then I will identify each section of it and mention why its been designed the way it was.</p>
<h2>The XML</h2>
<pre class="brush: xml;">
&lt;architecture&gt;
  &lt;rules&gt;
    &lt;rule id=&quot;dao_layer_rule&quot;&gt;
      &lt;comment&gt;dao layer may not access service or web layers&lt;/comment&gt;
      &lt;packages&gt;
        &lt;package&gt;com.company.project.dao&lt;/package&gt;
        &lt;package&gt;com.company.project.dao..*&lt;/package&gt;
      &lt;packages&gt;
      &lt;violations&gt;
        &lt;package&gt;com.company.project.service&lt;/package&gt;
        &lt;package&gt;com.company.project.service..*&lt;/package&gt;
        &lt;package&gt;com.company.project.web&lt;/package&gt;
        &lt;package&gt;com.company.project.web..*&lt;/package&gt;
      &lt;/violations&gt;
    &lt;/rule&gt;
  &lt;/rules&gt;
  &lt;analysis&gt;
    &lt;packages&gt;
      &lt;package package=&quot;com.company.project.dao.hibernate.person&quot;&gt;
        &lt;matches&gt;
          &lt;rule&gt;dao_layer_rule&lt;/rule&gt;
        &lt;/matches&gt;
        &lt;dependencies&gt;
          &lt;package&gt;com.company.project.dao&lt;/package&gt;
          &lt;package&gt;com.company.project.dao.hibernate&lt;/package&gt;
          &lt;package&gt;com.company.project.service&lt;/package&gt;
        &lt;/dependencies&gt;
        &lt;violations&gt;
          &lt;violation violates=&quot;dao_layer_rule&quot;&gt;com.company.project.service&lt;/violation&gt;
        &lt;/violations&gt;
        &lt;cycles&gt;
          &lt;cycle&gt;com.company.project.service&lt;/cycle&gt;
        &lt;/cycles&gt;
        &lt;classes&gt;
          &lt;class class=&quot;HibernatePersonDAOImpl&quot;&gt;
            &lt;dependencies&gt;
              &lt;package package=&quot;com.company.project.dao&quot;&gt;
                &lt;classes&gt;
                  &lt;class&gt;PersonDAO&lt;/class&gt;
                &lt;/classes&gt;
              &lt;/package&gt;
              &lt;package package=&quot;com.company.project.dao.hibernate.person&quot;&gt;
              	&lt;classes&gt;
                  &lt;class&gt;AbstractHibernateDAO&lt;/class&gt;
                &lt;/classes&gt;
              &lt;/package&gt;
              &lt;package package=&quot;com.company.project.service&quot;&gt;
                &lt;classes&gt;
                  &lt;class&gt;PersonService&lt;/class&gt;
                &lt;/classes&gt;
              &lt;/package&gt;
            &lt;/dependencies&gt;
            &lt;violations&gt;
              &lt;package package=&quot;com.company.project.service&quot;&gt;
                &lt;classes&gt;
                  &lt;class&gt;PersonService&lt;/class&gt;
                &lt;/classes&gt;
              &lt;/package&gt;
            &lt;/violations&gt;
            &lt;cycles&gt;
              &lt;package package=&quot;com.company.project.service&quot;&gt;
                &lt;classes&gt;
                  &lt;class&gt;PersonService&lt;/class&gt;
                &lt;/classes&gt;
              &lt;/package&gt;
            &lt;/cycles&gt;
          &lt;/class&gt;
        &lt;/classes&gt;
      &lt;/package&gt;
    &lt;/packages&gt;
  &lt;/analysis&gt;
&lt;/architecture&gt;
</pre>
<h2>Explanation</h2>
<p>There are two major parts to the report. The first is the <tt>rules</tt> elements. The second is the analysis elements.</p>
<p>The <tt>rules</tt> elements simply regurgitate the user&#8217;s rules as the user defined them. Architecture Rules is hopefully going to provide so much useful information someday that users would potentially not even define any rules and just use Architecture Rules to detect cyclic dependencies, get reports on their architecture including class and package dependencies, and someday <a href="http://en.wikipedia.org/wiki/Dependency_Structure_Matrix">Design Structure Matrix analysis</a>. But for now I believe most of our users utilize rules, since that is what this project is currently designed to do.</p>
<p>The second element is the <tt>analysis</tt> element. This is were we will put everything that we discover about every package and class in the analyzed code base. Lets look at each element under the <tt>analysis</tt> element individually.</p>
<h2>&lt;analysis&gt; Elements</h2>
<p>For each package in the project that we analyze, we will output:</p>
<p><strong>Rules</strong></p>
<p>Each rule that was matched. This indicates which rules were matched based on the exact package names and wildcarded package names that you have defined in your <tt>architecture-rules.xml</tt></p>
<p><strong>Dependencies</strong></p>
<p>Lists every package that the package under investigation depends on, including packages that are defined as a violation and packages that are involved in a cyclical dependency.</p>
<p><strong>Violations</strong></p>
<p>Lists packages that are defined as violations.</p>
<p><strong>Cycles</strong></p>
<p>The packages that are involved in a cyclical dependency with the package under investigation.</p>
<p><strong>Classes</strong></p>
<p>Now that we have listed dependencies at the package level, we are going to have an in depth look at each class within that package.  So the package level analysis is a sort of summary of the information found at the class level.</p>
<p>For each and every class in the package under investigation we&#8217;ll output the class&#8217;s dependencies, the violations (as determined by the matched rules and that rule&#8217;s violations as described in <tt>architecture-rules.xml</tt>) and each class that is involved in a cyclical dependency with the class under investigation.</p>
<p>We would appreciate any feedback that you might have on this output. It might take a while to read and really digest all of the information that this report contains within it, but the sooner we get this prototype reviewed the sooner we can implement it, and the better the review is, the better the chances that we get it right the first time. </p>
<p>Look for a subset of this report in the 3.0 release. We won&#8217;t be able to output this entire report until we replace JDepend with a new analysis tool, or write our own.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Fxml-report-prototype%2F&amp;linkname=XML%20Report%20Prototype">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/sonar/" title="Sonar">Sonar</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2009. |
<a href="http://blog.architecturerules.org/xml-report-prototype/">Permalink</a> |
<a href="http://blog.architecturerules.org/xml-report-prototype/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/xml-report-prototype/&amp;title=XML Report Prototype">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/integration/" rel="tag">integration</a>, <a href="http://blog.architecturerules.org/tag/report/" rel="tag">report</a>, <a href="http://blog.architecturerules.org/tag/xml/" rel="tag">xml</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/xml-report-prototype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hudson</title>
		<link>http://blog.architecturerules.org/hudson/</link>
		<comments>http://blog.architecturerules.org/hudson/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 00:33:16 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[hudson]]></category>
		<category><![CDATA[sonar]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=166</guid>
		<description><![CDATA[The Sonar team has an instance of Hudson running.  Hudson is a fantastic open source continuous integration server.
Here are some links:
Architecture Rules on Hudson
http://ci.sonar.codehaus.org/job/Architecture rules/
Build Status RSS
http://ci.sonar.codehaus.org/job/Architecture rules/rssAll
Modules
http://ci.sonar.codehaus.org/job/Architecture rules/modules
Share/SaveRelated PostsArchitecture Rules eats his own Dog FoodSonar
&#169; MikeNereson for Architecture Rules - Blog, 2009. &#124;
Permalink &#124;
No comment &#124;
Add to
del.icio.us

Post tags: continuous integration, hudson, sonar

Feed enhanced by [...]]]></description>
			<content:encoded><![CDATA[<p>The Sonar team has an instance of Hudson running.  Hudson is a fantastic open source continuous integration server.</p>
<p>Here are some links:</p>
<p><strong>Architecture Rules on Hudson</strong><br />
<a href="http://ci.sonar.codehaus.org/job/Architecture%20rules/">http://ci.sonar.codehaus.org/job/Architecture rules/</a></p>
<p><strong>Build Status RSS</strong><br />
<a href="http://ci.sonar.codehaus.org/job/Architecture%20rules/rssAll">http://ci.sonar.codehaus.org/job/Architecture rules/rssAll</a></p>
<p><strong>Modules</strong><br />
<a href="http://ci.sonar.codehaus.org/job/Architecture%20rules/modules">http://ci.sonar.codehaus.org/job/Architecture rules/modules</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Fhudson%2F&amp;linkname=Hudson">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/architecture-rules-eats-his-own-dog-food/" title="Architecture Rules eats his own Dog Food">Architecture Rules eats his own Dog Food</a></li><li><a href="http://blog.architecturerules.org/sonar/" title="Sonar">Sonar</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2009. |
<a href="http://blog.architecturerules.org/hudson/">Permalink</a> |
<a href="http://blog.architecturerules.org/hudson/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/hudson/&amp;title=Hudson">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/continuous-integration/" rel="tag">continuous integration</a>, <a href="http://blog.architecturerules.org/tag/hudson/" rel="tag">hudson</a>, <a href="http://blog.architecturerules.org/tag/sonar/" rel="tag">sonar</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/hudson/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sonar</title>
		<link>http://blog.architecturerules.org/sonar/</link>
		<comments>http://blog.architecturerules.org/sonar/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 00:17:25 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[sonar]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=161</guid>
		<description><![CDATA[Sonar is an &#8220;Open Source Quality Management Platform&#8221;.  It provides software analysis using many great open source tools such as Checkstyle, PMD, Maven, and Cobertura to provide a dashboard with granular drill down capabilities from projects, to packages, to classes. Architecture Rules has been added to their public hosted instanced (they call this instance [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sonar.codehaus.org/">Sonar</a> is an &#8220;Open Source Quality Management Platform&#8221;.  It provides software analysis using many great open source tools such as Checkstyle, PMD, Maven, and Cobertura to provide a dashboard with granular drill down capabilities from projects, to packages, to classes. Architecture Rules has been added to their public hosted instanced (they call this instance Nemo). I encourage you to check out <a href="http://nemo.sonar.codehaus.org/project/index/org.architecturerules:architecture-rules-parent">Architecture Rules on Sonar</a>. Sonar is also continuously building our project and <a href="http://ci.sonar.codehaus.org/job/Architecture%20rules/">running our tests with Hudson</a>.</p>
<p>While investigating back links to our websites, I <a href="http://jira.codehaus.org/browse/SONAR-501">discovered an issue in Sonar&#8217;s issue tracker</a> where they were discussing finding a tool that could analyze architecture so that they can add additional reporting to Sonar. This issue brought me to the <a href="http://jira.codehaus.org/browse/SONARPLUGINS-35">source of the issue</a>. I added my input to that issue. It turns out that they would prefer to utilize a project like ours more than the alternatives because our project is the most active. The alternatives have not been updated in years. Sonar also really wants to add DSM analysis reporting to their product, so they are looking for an architecture analysis tool to handle this.</p>
<p>We are discussing with the Sonar project team how we might fill this role.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Fsonar%2F&amp;linkname=Sonar">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/xml-report-prototype/" title="XML Report Prototype">XML Report Prototype</a></li><li><a href="http://blog.architecturerules.org/hudson/" title="Hudson">Hudson</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2009. |
<a href="http://blog.architecturerules.org/sonar/">Permalink</a> |
<a href="http://blog.architecturerules.org/sonar/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/sonar/&amp;title=Sonar">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/integration/" rel="tag">integration</a>, <a href="http://blog.architecturerules.org/tag/sonar/" rel="tag">sonar</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/sonar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3.0 Roadmap</title>
		<link>http://blog.architecturerules.org/30-roadmap/</link>
		<comments>http://blog.architecturerules.org/30-roadmap/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 02:01:49 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3.0]]></category>
		<category><![CDATA[roadmap]]></category>

		<guid isPermaLink="false">http://72miles.com/blog.architecturerules.org/?p=3</guid>
		<description><![CDATA[Lays out a road map for 3.0. We have a few things that I want to see put into it including event listeners, XML report output, and enhanced exception reporting. We'd also like to hear what you want in it.]]></description>
			<content:encoded><![CDATA[<p>OK, lets lay out a road map for 3.0. I sent this message to the <a href="http://groups.google.com/group/architecture-rules-users">architecture-rules-user mailing list </a>and the <a href="http://groups.google.com/group/architecture-rules-dev">architecture-rules-dev mailing list</a> tonight. I have a few things that I want to see put into it, and I&#8217;d also like to hear what you want in it.</p>
<h3><strong>org.architecturerules</strong></h3>
<p>First. The big change is the <span style="font-family: courier new,monospace;">groupId </span>which is finally going to be moved to <span style="font-family: courier new,monospace;">org.architecturerules </span>for the core project and the maven plugin. I don&#8217;t have the domain yet. I have a <a href="http://wiki.architecturerules.org/index.php?title=FundRaising" target="_blank">fund raiser</a> page where I was hoping to get about $30 to secure the domain for 3 years. So far no contributions <strong>: \</strong> Maybe if any of your work for a company that uses the project, and the company has donated money in the past, you could ask your boss for a small $30 contribution to this project. Regardless, we&#8217;ll get it eventually and the project needs to get off of <span style="font-family: courier new,monospace;">com.*</span> and the maven plugin needs to be the same <span style="font-family: courier new,monospace;">groupId</span>.</p>
<h3><strong>architecture-rules-ant</strong></h3>
<p>We are going to refactor the <span style="font-family: courier new,monospace;">..architecturerules.ant </span>package to its own jar so that:</p>
<ul>
<li>User&#8217;s who want to use the ant interface can include this jar.</li>
<li> By including the jar, you get the Ant jars and dependencies. If you don&#8217;t use Ant, you don&#8217;t need the jar or the ant libraries.</li>
<li> As we add new functionality to architecture rules someone else could take on the task of keeping the ant task up to date on their own schedule.</li>
<li> This module also acts as an example of how to extend the core &#8211; add your own functionality!</li>
<li> Allows us to develop new ant features and fix ant issues without doing a major release of the core. There are a couple of open <a href="http://code.google.com/p/architecturerules/issues/list?can=2&amp;q=ant">ant-related issues in the issue list</a>.</li>
</ul>
<p>The downsides is that the API is broken, but we are willing to accept this given that this release  the packages are all changing to org.architecturerules so the API will be broken anyway.</p>
<h3><strong><a href="http://code.google.com/p/architecturerules/issues/detail?id=59" target="_blank">Issue 59</a>: </strong><span><strong>DependencyConstraintException should report the violating class</strong></span></h3>
<p><span> This is sort of a tough issue. We utilize jDepend which only looks at packages. However, Mykola brought </span>Classycle to my attention (which I included on the <a href="http://wiki.architecturerules.org/index.php?title=Alternatives" target="_blank">alternatives page</a>) which looks at class dependencies rather than package dependencies. We could move off of jDepend and switch over to using Classclye to find dependencies, or we could continue to use jDpend, and when a rule is broken, we can jump over to Classycle to figure out which class is breaking the rule. Another benefit to Classclye is that it is able to detect static dependencies which jDpend is not. I actually got an email from SonarJ, a commercial competitor listed on the alternatives page who congratulated us on developing a good open source architecture risk mitigating project but pointed out that jDepend could not detect static dependencies. I think in the long term we need to support detecting static dependencies so this Classycle might have been an important find.</p>
<p><span style="text-decoration: line-through;"><em>Looking to get involved? We&#8217;re looking for contributors for this </em><em>task</em><em>.</em></span> <a href="http://groups.google.com/group/architecture-rules-dev/browse_thread/thread/a1a5c75239349838">Welcome to the team, Raja.</a><br />
<span><strong><a href="http://code.google.com/p/architecturerules/issues/detail?id=60"></a></strong></span></p>
<h3><span><strong><a href="http://code.google.com/p/architecturerules/issues/detail?id=60">Issue 60</a>: XML reports</strong></span></h3>
<p><span> The only other current issue that I would like to tackle somehow is the output of the XML reports. I sent out a pretty detailed email on this to the user and dev mailing list. I got little response. I put a <a href="http://code.google.com/p/architecturerules/issues/detail?id=60#c1">copy of the email</a> in the issue which includes a prototype for the XML output. The premise would be that the execution of architecture rules results in the output of an XML file that describes all of the rules, the packages that were investigated because of that rule, the dependencies of each package that match that rule, and a list of each violation. One major change would be that instead of throwing an exception when a rule is broken, the rest of the packages would be investigated first and then the XML output is written, and then an exception could be thrown describing all of the rules that were broken &#8211; not just the first rule.</span></p>
<p>The reason for this XML output is two-fold: first, it provides output for other developers to start processing and developing new tools for which could be good for this project. second: it provides a data source for our maven 2 plugin to use to generate a site report for. Or this could be a new project: maven-architecture-rules-report-plugin. Either way, this is a good stepping stone to new functionality and growth for this project.</p>
<p><em><span style="text-decoration: line-through;">Looking to get involved? We&#8217;re looking for contributors for this task.</span> </em><a href="http://groups.google.com/group/architecture-rules-dev/browse_thread/thread/ac2129a81fd829b4">Welcome to the team, Chris.</a></p>
<h3><span><strong>FindBugs</strong></span></h3>
<p><span> We added the <a href="http://architecturerules.googlecode.com/svn/docs/maven-generated-site/findbugs.html">FindBugs report</a> recently to the <a href="http://architecturerules.googlecode.com/svn/docs/maven-generated-site/project-reports.html">maven-generated site</a>. We should be able to clear this list for all of our code.</span></p>
<h3><span> <strong>Remove 3rd party org packages</strong></span></h3>
<p><span> I had created an <a href="http://code.google.com/p/architecturerules/issues/detail?id=2">Issue to remove unnecessary dependencies</a> to cut down on the number of libraries that we depended on. But I think this was implemented poorly to the point where it caused a <a href="http://code.google.com/p/architecturerules/issues/detail?id=46&amp;can=1">reported bug</a>. Also, we have a pseudo maven repository so that makes this issue almost moot.</span></p>
<p>This list encompasses most of the open issues in the issue tracker that I want to see implemented. There are a couple of issues that I am going to leave on hold (such as inverting the project to expect the user to define the accepted packages rather than the exceptional packages) and some that I can not fix with out money (continuous integration server).</p>
<p>All of these tasks are up for discussion. And most any of them are open to user contributions. If you are interested in taking on one of these tasks, just reply to this email, tell us what you want to work on, what questions you have, and maybe describe how you plan on implementing it. If its a small task, you can submit a patch, if its bigger, we can make you a contributor (for a short term or longer term depending on circumstances)</p>
<h3><strong>UPDATE: <a href="http://code.google.com/p/architecturerules/issues/detail?id=68" target="_blank">Issue 68</a>: Listener Support</strong></h3>
<p>Adding support for event listeners gives us a few different things that we either need or that would benefit us in the future.  This will hopefully invite other developers to begin extending the project. For example someone someday might make a GUI tool or an IDE plugin and want to provide real-time feedback to the GUI as packages are investigated. This also enables us to develop the XML report in a very modular fashion, without littering the services with code that is not related to performing the service that the class is named for. Listeners provide a great point for adding new functionality from too.</p>
<h3><strong>UPDATE: Introduce API Package</strong></h3>
<p>Interfaces will be moved to a new org.architecturerules.api package so that developers who wish to extend the project have someplace to start from. This will break backwards compatibility. But so will migrating to org.architecturerules, so if this is going to be done, it should be done now. Sorry everyone.</p>
<h3><strong>UPDATE: <a href="http://code.google.com/p/architecturerules/issues/detail?id=64" target="_blank">Issue 64</a>: default-architecture-rules.xml</strong></h3>
<p>The initial state of the Configuration entity will be created by reading default-architecture-rules.xml. This essentially just allows us to define the default values via XML rather than defining them with java constants which is what we are doing now. This XML file is easier for the user to read to figure out the default values, is easy to add new default values to as we develop new features, and may be used to demonstrate a sample XML configuration or how features are configured.</p>
<h3><strong>UPDATE: <a href="http://code.google.com/p/architecturerules/issues/detail?id=67" target="_blank">Issue 67</a>: Configuration Properties</strong></h3>
<p>The listeners require some configuration. Some other tools that have yet to be written may also require configuration. We&#8217;ll be adding support for arbitrary properties. These allow you to define a set of keys and a values that can be handed off to the Listeners and to other features that may be created in the future. This provides a pretty robust mechanism for providing configuration values for classes that extend the project.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2F30-roadmap%2F&amp;linkname=3.0%20Roadmap">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/configuration-method-chaining/" title="Configuration Method Chaining">Configuration Method Chaining</a></li><li><a href="http://blog.architecturerules.org/squash-those-cyles/" title="Squash those Cycles">Squash those Cycles</a></li><li><a href="http://blog.architecturerules.org/wildcard-support/" title="Wildcard Support">Wildcard Support</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/30-roadmap/">Permalink</a> |
<a href="http://blog.architecturerules.org/30-roadmap/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/30-roadmap/&amp;title=3.0 Roadmap">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/30/" rel="tag">3.0</a>, <a href="http://blog.architecturerules.org/tag/roadmap/" rel="tag">roadmap</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/30-roadmap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On del.icio.us</title>
		<link>http://blog.architecturerules.org/on-delicious/</link>
		<comments>http://blog.architecturerules.org/on-delicious/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 04:17:55 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[buzz]]></category>
		<category><![CDATA[del.icio.us]]></category>

		<guid isPermaLink="false">http://72miles.com/blog.architecturerules.org/?p=12</guid>
		<description><![CDATA[I try to keep an eye on what Internet users are saying about Architecture Rules. I checked del.icio.us for architecture rules. Its bookmarked by 60 people, which is pretty cool, but not all of the descriptions are accurate. I reached out to one bookmarker.]]></description>
			<content:encoded><![CDATA[<p>I try to keep an eye on what Internet users are saying about Architecture Rules. I checked <a href="http://del.icio.us/url/f3ee434523ac268133d807e6f2ede3f8">del.icio.us for architecture rules</a>. Its bookmarked by 60 people, which is pretty cool.</p>
<p>I read one description which concerned me. Chris suggested in his description that architecture rules as &#8220;way to &#8216;test architecture&#8217;, although it seems to be limited to detecting cyclic package dependencies&#8221;. Whoa, hold on. That&#8217;s not what we are about. Detecting cyclical dependencies is something that we can do, because we wrap JDepend, but the whole point of the project is to assert that the Rules that you have defined are not violated.</p>
<p>So, I tracked down Chris&#8217;s email address, which I found in his resume, which I found on his site. I emailed him.</p>
<p>I started by apologizing for the unsolicited email. Next I explained that I found his comment delicious, I reiterated his comment to him, then briefly explained and showed (with XML) how architecture rules was about asserting architecture through the definition of rules. I sent off the email assuming that Chris probably wouldn&#8217;t read it, and certainly wouldn&#8217;t respond favorably. Fortunately, I underestimated Chris.</p>
<p>Chris wrote back to me and thanked me for taking the time to write to him. He also pointed out that it is &#8220;always a good sign to me when an open-source project is interested in what people are saying about it.&#8221;</p>
<p>I just wanted to share this experience. I have no great analysis of it yet. I hope that it might encourage you to think about reaching out to your user base weather they be paying customers or users of your open source tool.  After all, that&#8217;s why we write the code, right? To satisfy the end users, to make their jobs easier, or to change the way that people do business.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Fon-delicious%2F&amp;linkname=On%20del.icio.us">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/" title="Architecture-Rules 2.1.0 on the Horizon">Architecture-Rules 2.1.0 on the Horizon</a></li><li><a href="http://blog.architecturerules.org/architecture-rules-eats-his-own-dog-food/" title="Architecture Rules eats his own Dog Food">Architecture Rules eats his own Dog Food</a></li><li><a href="http://blog.architecturerules.org/xml-report-prototype/" title="XML Report Prototype">XML Report Prototype</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/on-delicious/">Permalink</a> |
<a href="http://blog.architecturerules.org/on-delicious/#comments">2 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/on-delicious/&amp;title=On del.icio.us">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/buzz/" rel="tag">buzz</a>, <a href="http://blog.architecturerules.org/tag/delicious/" rel="tag">del.icio.us</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/on-delicious/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Architecture-Rules 2.1.1 Release</title>
		<link>http://blog.architecturerules.org/architecture-rules-211-release/</link>
		<comments>http://blog.architecturerules.org/architecture-rules-211-release/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 00:42:55 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2.1.1]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[retrospective]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=70</guid>
		<description><![CDATA[It is an open source project. That means our mishaps are out there for everyone to see.  Read about our major release that contained a major problem. Hopefully you can learn from our mistake (and we get some of those users back).]]></description>
			<content:encoded><![CDATA[<p>It is an open source project. That means our mishaps are out there for everyone to see.  Read about our major release that contained a major problem. Hopefully you can learn from our mistake (and we get some of those users back).</p>
<h3>2.1.0 Release not so Good</h3>
<p>Architecture Rules 2.1.0 was released this past weekend. It was going great. The project was getting a lot of attention on <a href="http://www.dzone.com/links/architecturerules210_released.html">dzone</a>, <a href="http://freshmeat.net/projects/architecturerules/">freshmeat.net</a> drove some good traffic, it made the front page of <a href="http://www.theserverside.com/news/thread.tss?thread_id=49953">The Server Side&#8217;s news section</a>. All of these sites brought in a huge 128 downloads over the weekend while the <a href="http://code.google.com/p/architecturerules/downloads/list?q=label:Version-2.0.3">previous version</a> was out for seven months and only claims 222 downloads (by the way, I hope there are many times more users using the maven repository, which we don&#8217;t yet track for downloads). So it was a good weekend. And then it was pointed out that wildcards don&#8217;t work&#8230;</p>
<h3>What Happened?</h3>
<p>We implemented wildcards a few weeks ago and released a 2.1.0-SNAPSHOT for users to test out. Unfortunately, we don&#8217;t have a huge number of early adopters who are pulling down snapshots. So It seemed worked well and we planned a release for the weekend of July 4th.  On June 29th, I got a friendly email from Andrew Swan. He had graciously taken the time to review the 2.1.0 code before the release. He discovered that the JPackage equals method delegated the work to the JPackage matches method. This broke the contract of the Java equals method because, in his words, &#8220;if a.equals(b), then b.equals(a) should also be true.&#8221; We all know that he is absolutely 100% correct. He even pointed me to <a href="http://www.amazon.com/gp/search?ie=UTF8&amp;keywords=effective%20java&amp;tag=72mile-20&amp;index=blended&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">Effective Java</a>. We were excited to have Andrew reviewing the code and of course wanted to fix this problem. So we modified each reference to JPackge.equals to use JPackage.matches, ran our tests, and got a green <a href="http://code.google.com/p/architecturerules/issues/detail?id=45&amp;can=1#c1">&#8220;tests pass 82 of 82&#8243;.</a></p>
<p>I quickly followed that up by creating the binaries, committing everything to SVN, updating the documentation, and promoting the 2.1.0 release. However, one reference to .equals remained in the AbstractRuleService. This is the service that itterates over each package defined in each rule and checks to see if a given package is dependent on a package that it is not allowed to depend on. So now, if a package is defined using wildcards, it tries to match &#8220;com.company.application.*&#8221;, the String, to fully qualified String such as &#8220;java.util&#8221;. Of course, no package is ever going to be named with an asterisk character, so now if a package is defined with a wildcard, its not looked at. So wildcards are busted.</p>
<h3>What Now?</h3>
<p>Now, we <a href="http://wiki.architecturerules.org/index.php?title=Release:2.1.1">released 2.1.1</a> just to fix this bug and pray that the 128 (and hopefully many many more though the maven repository) java developers who are rightfully concerned with mitigating architectural risk take some time to come back and grab the 2.1.1 release.</p>
<p>We have fixed the problem and quickly put up <a href="http://wiki.architecturerules.org/index.php?title=Release:2.1.1">2.1.1</a>. Please <a href="http://wiki.architecturerules.org/index.php?title=Release:2.1.1">download it</a>, or update your <a href="http://wiki.architecturerules.org/index.php?title=Maven2Repository">pom.xml</a>, give us another try, and <strong>Assert your Architecture</strong>.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Farchitecture-rules-211-release%2F&amp;linkname=Architecture-Rules%202.1.1%20Release">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/" title="Architecture-Rules 2.1.0 on the Horizon">Architecture-Rules 2.1.0 on the Horizon</a></li><li><a href="http://blog.architecturerules.org/architecture-rules-210-release/" title="Architecture-Rules 2.1.0 Release">Architecture-Rules 2.1.0 Release</a></li><li><a href="http://blog.architecturerules.org/wildcard-support/" title="Wildcard Support">Wildcard Support</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/architecture-rules-211-release/">Permalink</a> |
<a href="http://blog.architecturerules.org/architecture-rules-211-release/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/architecture-rules-211-release/&amp;title=Architecture-Rules 2.1.1 Release">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/211/" rel="tag">2.1.1</a>, <a href="http://blog.architecturerules.org/tag/release/" rel="tag">release</a>, <a href="http://blog.architecturerules.org/tag/retrospective/" rel="tag">retrospective</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/architecture-rules-211-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Architecture-Rules 2.1.0 Release</title>
		<link>http://blog.architecturerules.org/architecture-rules-210-release/</link>
		<comments>http://blog.architecturerules.org/architecture-rules-210-release/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 00:45:20 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2.1.0]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=72</guid>
		<description><![CDATA[Architecture Rules announces today that version 2.1.0 is released. This was a fun release for two reasons: the new features, and the timing of the release.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://architecturerules.org/">Architecture Rules</a> announces today that <a href="http://wiki.architecturerules.org/index.php?title=Release:2.1.0">version 2.1.0 is released</a>.</p>
<p>This was a fun release for two reasons: the new features, and the timing of the release.</p>
<h3>Features</h3>
<p>This was a major release in that it finally allows the users to define packages with wildcards. We&#8217;ve had a handful of users <a href="http://groups.google.com/group/architecture-rules-users/browse_thread/thread/d0bf8498968369e3/e7984bc7a00367bd?#e7984bc7a00367bd">asking for this functionality</a> for a while. We thank them for sticking with us despite having to ask us for this feature a few times. Read about how we implemented wildcards, how to use them, and some open issues with them on our previous post <a href="wildcard-support">Wildcard Support</a>.</p>
<p>We added method chaining to the domain classes to improve the feel of programmatic configuration. We talk about this change when we <a href="architecture-rules-210-on-the-horizon/#chaining">introduced the development goals for 2.1.0</a> and we talked in depth about method chaining when we started researching weather we should support it or not in our post <a href="configuration-method-chaining">Configuration Method Chaining</a>.</p>
<p>We also made some positive changes to the project&#8217;s exceptions. We have a lot of exceptions for reporting different issues with architecture rules configuration and with the project that the tool is inspecting. We <a href="http://code.google.com/p/architecturerules/issues/detail?id=42&amp;can=1">added some references</a> to the packages that cause the exception to be thrown, and we tied all of the exceptions together under one higher level exception, the <a href="http://code.google.com/p/architecturerules/source/browse/trunk/architecture-rules/src/main/java/com/seventytwomiles/architecturerules/exceptions/ArchitectureException.java">ArchitectureRulesException</a>.</p>
<h3>Release Date</h3>
<p>Architecture Rules 2.1.0 is officially released on Friday, July 4th, 2008. This is a great date for a milestone release not because it is an <a href="http://en.wikipedia.org/wiki/Independence_Day_(United_States)">American national holiday</a>, but because it is one year from the day that development started on the project just about to the day. The first release, <a href="http://code.google.com/p/architecturerules/downloads/detail?name=architecture-rules-1.0.jar&amp;can=2&amp;q=#makechanges">1.0</a>, was made just a couple weeks after development started, on July 17th, 2007. So happy anniversary Architecture Rules. With wildcards, a new domain name, and the upcoming maven 2 plugin, this next year is going to be bigger than the last.</p>
<h3>Upcoming Releases</h3>
<p>There will be a 3.0.0 release soon. Today, the maven 2 plugin that has been in development and the architecture rules project have different package names. One com.seventytwomiles and one info.manandbytes because I developed most of the core project as 72miles.com and Mykola developed the plugin under his domain mandandbytes.info. Before I can see developers using the plugin, we need to normalize the domain names. We&#8217;ll purchase ArchitectureRules.org any day now, update the site, update the documentation, and update the packages. This will be a major change to the users, warranting the 3.0.0 release. If you can afford a couple bucks to <a href="http://wiki.architecturerules.org/index.php?title=FundRaising">help get the domain</a>, we would really appreciate the monetary support.</p>
<p>Once the packages are straightened out, we can push out the plugin. We need to write the documentation for the maven 2 architecture rules plugin. Mykola has been working hard on the plugin for months now. Its actually been ready for public consumption for a while, we just haven&#8217;t had the time to document it for the public. I will make this my next task and get the plugin out for everyone to start using. It makes Architecture Rules even easier to use by allowing the user to skip writing a silly little Test class and lets you move Architecture Rules right into your everyday build process. Awesome.</p>
<h3>2.1.0</h3>
<p>For a complete list of the changes, check out the <a href="http://wiki.architecturerules.org/index.php?title=Release:2.1.0">2.1.0 release/download page</a>. You can get the update by downloading the new jar, or by <a href="http://wiki.architecturerules.org/index.php?title=Maven2Repository">updating your pom.xml to version 2.1.0</a>.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Farchitecture-rules-210-release%2F&amp;linkname=Architecture-Rules%202.1.0%20Release">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/architecture-rules-211-release/" title="Architecture-Rules 2.1.1 Release">Architecture-Rules 2.1.1 Release</a></li><li><a href="http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/" title="Architecture-Rules 2.1.0 on the Horizon">Architecture-Rules 2.1.0 on the Horizon</a></li><li><a href="http://blog.architecturerules.org/architecture-rules-203/" title="Architecture-Rules 2.0.3">Architecture-Rules 2.0.3</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/architecture-rules-210-release/">Permalink</a> |
<a href="http://blog.architecturerules.org/architecture-rules-210-release/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/architecture-rules-210-release/&amp;title=Architecture-Rules 2.1.0 Release">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/210/" rel="tag">2.1.0</a>, <a href="http://blog.architecturerules.org/tag/release/" rel="tag">release</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/architecture-rules-210-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wildcard Support</title>
		<link>http://blog.architecturerules.org/wildcard-support/</link>
		<comments>http://blog.architecturerules.org/wildcard-support/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 00:46:45 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2.1.1]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[wildcard]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=74</guid>
		<description><![CDATA[Architecture Rules is proud to announce that it now support wild cards.]]></description>
			<content:encoded><![CDATA[<p><a href="http://architecturerules.org/">Architecture Rules</a> is proud to announce that it now support wild cards.</p>
<h3><strong>Benefits of Wildcards</strong></h3>
<p>Wildcards bring the ability to match multiple packages with one <tt>Rule</tt> entry. This falls inline with the original goal of the project, which was to simplify the usage of jDepend and to define rules in a way that is very readable, understandable, and modifiable.</p>
<p>With wildcards, users can now define a package or violation in one line with the ability to match many packages. This means you won&#8217;t need to update your Rules each time you add a new package and your <a href="http://wiki.architecturerules.org/index.php?title=SampleConfiguration">XML configuration </a>file will be much shorter.</p>
<h3><strong>Wildcard Patterns</strong></h3>
<p>We identified a few different Wildcard Patterns. Some we don&#8217;t support and don&#8217;t plan on supporting, others we do support, and there are still a couple that we want to add.</p>
<p>Here is a description of what we now support:</p>
<table class="api_table" style="table-layout: fixed; padding: 10px; vertical-align: top;" border="0">
<tbody>
<tr>
<th>Internal Wildcard</th>
<th>Terminating Wildcard</th>
</tr>
<tr>
<td>Wildcard stated within a package.</td>
<td>Wildcard stated at the end of a package.</td>
</tr>
<tr>
<td><tt>com.company.*.dao</tt></td>
<td><tt>com.company.project.dao.*</tt></td>
</tr>
<tr>
<th>Match One Package</th>
<th>Match Many Packages</th>
</tr>
<tr>
<td>Match to the depth of one package with the <tt>.*</tt> combination</td>
<td>Match to the depth of one or more packages with the <tt>..*</tt> combination</td>
</tr>
<tr>
<td><tt>com.company.*.dao</tt> matches only <tt>com.company.SOMETHING.dao</tt></td>
<td><tt>com.company.project.dao..*</tt> matches <tt>..dao.hibernate</tt><br />
as well as packages below hibernate: <tt>..dao.hibernate.user</tt>,<br />
<tt>..dao.hibernate.account</tt>,<br />
etc.</td>
</tr>
</tbody>
</table>
<h3>Example</h3>
<p>Now creating a rule to assert that the web layer does not interact with the DAO (or integration) layer is as easy as:</p>
<pre class="brush: xml;">
&lt;rule id=&quot;web-layer&quot;&gt;
&lt;comment&gt;web and dao mix like oil and water&lt;/comment&gt;
&lt;packages&gt;
&lt;package&gt;com.company.app.web..*&lt;/package&gt;
&lt;/packages&gt;
&lt;violations&gt;
&lt;violation&gt;com.company.app.dao..*&lt;/violation&gt;
&lt;/violations&gt;
&lt;/rule&gt;
</pre>
<p>Prior to wildcards, you might have needed to define <tt>..web.controllers</tt>, <tt>..web.filters</tt>, <tt>..web.views</tt>, <tt>..web.forms</tt>, <tt>..web.tags</tt> as the packages, and then you would have had to defined every ..dao package as a violation. Now its easy!</p>
<h3>Implementation</h3>
<p>Architecture Rules uses Regular Expressions to compare the packages with wildcards against the inspected packages. The regular expression needed to be able to handle exact packages, one package deep, and one or more packages deep. We accomplished this by modifying the given package with wildcards (such as <tt>com.company.project.*</tt>) to apply regular expression characters.</p>
<p>Thank you to Ryan Stewart for helping us hash out this expression. This is what we came up with:</p>
<pre class="brush: java;">
final String regex = this.path
// foo.bar exactly foo.bar
.replaceAll(&quot;\\.&quot;, &quot;\\\\.&quot;)
// foo.bar.1 or foo.bar.1.2 and so on...
.replaceAll(&quot;\\\\.\\\\.\\\\*&quot;, &quot;\\\\.\\[A-Za-z_0-9.]&quot;)
// packages only
.replaceAll(&quot;\\.\\*&quot;, &quot;\\.[A-Za-z_0-9]*&quot;);
</pre>
<p>The break down is this: The third line of code looks for <tt>..*</tt> combination and replaces it with the regular expression to allow for any string with any number of periods.</p>
<p>The fourth line of code looks for the remaining <tt>.*</tt> combinations and replaces it the an expression to match package name but no more periods.</p>
<p>If you consider yourself a regular expression wizard, please consider taking a moment to review this and offer any feedback or suggestions that you might come up with. Thank you.</p>
<h3>Outstanding Issues</h3>
<p>One usability issue that we have uncovered is the matching of the package prior to the wildcard. For example, some users think that <tt>com.company.project.*</tt> should match <tt>com.company.project</tt> in addition to the packages under project. Others aren&#8217;t sure it should match <tt>..project</tt>. As of right now <tt>..project</tt> is not included as a match. We are open to comments on this and welcome feedback from the early adopters.</p>
<h3>Roll Out</h3>
<p>Wildcard support has been slated for the 2.1.0 release which should happen any day now. We are just waiting for a couple of our early adopters to test the wildcards with the <tt>2.1.0-SNAPSHOT </tt>that is currently in the <a href="http://wiki.architecturerules.org/index.php?title=Maven2Repository">maven repository</a>.</p>
<p>If you&#8217;ve been waiting and can&#8217;t wait to try it out, or if you can help out with testing, just <a href="hhttp://wiki.architecturerules.org/index.php?title=Releases">grab the jar</a>, or add our <a href="http://wiki.architecturerules.org/index.php?title=Maven2Repository">repository</a> and dependency to your maven <em>pom.xml</em>.</p>
<h3>Thanks</h3>
<p>Finally. Thanks you to Andrew Swan for hounding us to get this feature implemented and for sticking with us while we worked on it. Also thank you for testing it for us. Thank you, again, to Ryan Stewart for helping out with the regular expression. And as always, thank you to Mykola Nickishov for working diligently on the Maven 2 plugin that will be released with the 2.1.0 release of Architecture Rules.</p>
<p>And thank you to you for reading this far. <a href="http://wiki.architecturerules.org/index.php?title=Maven2Repository">Now</a> <a href="http://wiki.architecturerules.org/index.php?title=Releases">go</a> <a href="http://wiki.architecturerules.org/index.php?title=SVN">get</a> Architecture Rules and start <strong>Asserting Your Architecture!</strong></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Fwildcard-support%2F&amp;linkname=Wildcard%20Support">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/architecture-rules-211-release/" title="Architecture-Rules 2.1.1 Release">Architecture-Rules 2.1.1 Release</a></li><li><a href="http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/" title="Architecture-Rules 2.1.0 on the Horizon">Architecture-Rules 2.1.0 on the Horizon</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/wildcard-support/">Permalink</a> |
<a href="http://blog.architecturerules.org/wildcard-support/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/wildcard-support/&amp;title=Wildcard Support">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/211/" rel="tag">2.1.1</a>, <a href="http://blog.architecturerules.org/tag/feature/" rel="tag">feature</a>, <a href="http://blog.architecturerules.org/tag/wildcard/" rel="tag">wildcard</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/wildcard-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Architecture Rules Tutorial: 102</title>
		<link>http://blog.architecturerules.org/architecture-rules-tutorial-102/</link>
		<comments>http://blog.architecturerules.org/architecture-rules-tutorial-102/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 00:48:23 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=76</guid>
		<description><![CDATA[This is the second part in an introduction to Architecture Rules. In this tutorial we show how to tune the exceptions that Architecture Rules can throw under specific conditions.]]></description>
			<content:encoded><![CDATA[<p>This is the second part in an introduction to Architecture Rules.</p>
<p>The first part, <a href="architecture-rules-tutorial-101">Architecture Rules 101</a> went over a short, sweet, and simple configuration.</p>
<h3>Reminder</h3>
<p>So remember, the basics of Architecture Rules is that it is</p>
<ul>
<li>Java.</li>
<li><a href="http://www.apache.org/licenses/LICENSE-2.0">Open Source</a>.</li>
<li>Asserts architectural rules via unit tests.</li>
<li>You write your rules in <a href="http://wiki.architecturerules.org/index.php?title=SampleConfiguration">XML</a>.</li>
<li>Your run your tests with junit, <a href="http://architecturerules.googlecode.com/svn/docs/run.html#ant-task">ant</a>, or a continuous integration server.</li>
</ul>
<h3>Source Locations</h3>
<p>In this second installment of introductions to Architecture Rules, we&#8217;re going to go over source locations which enables the tool to support multi-module projects, and allows you to define when a particular source must exist, or may be optional.</p>
<p>By allowing a source to be optional, you can have different developers with different modules of code. So while one developer may have all eight modules of a project, another developer may only need to work on two or three of the modules.</p>
<h3>Configuration</h3>
<p>Here is an example that uses all of the current features supported by <strong>Architecture Rules 2.0.3</strong>.</p>
<pre class="brush: xml;">
&lt;configuration&gt;

&lt;sources no-packages=&quot;exception&quot;&gt;
&lt;source not-found=&quot;exception&quot;&gt;coretargetclasses&lt;/source&gt;
&lt;source not-found=&quot;ignore&quot;&gt;webtargetclasses&lt;/source&gt;
&lt;source not-found=&quot;ignore&quot;&gt;wstargetclasses&lt;/source&gt;
&lt;/sources&gt;

&lt;/configuration&gt;
</pre>
<p>The first property that we see is the <tt>sources no-packages="exception"</tt>. This tells Architecture Rule that, after reading all of the defined source directories, if no classes are found, then throw an Exception, more specifically, a <a href="http://wiki.architecturerules.org/index.php?title=Exceptions#NoPackagesFoundException">NoPackagesFoundException</a>. Here are the configuration options for <tt>no-packages</tt>:</p>
<table class="api_table" border="0">
<caption>sources no-packages values</caption>
<tbody>
<tr>
<th style="width: 100px;">Value</th>
<th>Description</th>
</tr>
</tbody>
<tbody>
<tr class="odd">
<td>exception</td>
<td>causes a NoPackagesFoundException when zero classes are found among all of the defined sources</td>
</tr>
<tr class="even">
<td>ignore</td>
<td><strong>default</strong> all test continue although there are no classes to test</td>
</tr>
</tbody>
</table>
<p>The next interesting thing that we come across is <tt>&lt;source not-found="ignore"&gt;</tt> This configuration causes a <a href="http://wiki.architecturerules.org/index.php?title=Exceptions#SourceNotFoundException">SourceNotFoundException</a> when the given path can not be found on the file system. This allows you to ensure that specific modules are present in the test. Alternatively, if you don&#8217;t particularly care if some source path is present, you can use the ignore value, which happens to be the default value. In the example above, the core module must be present for the tests to continue. The web and web services (ws) modules are optional.</p>
<table class="api_table" border="0">
<caption>source not-found values</caption>
<tbody>
<tr>
<th style="width: 100px;">Value</th>
<th>Description</th>
</tr>
</tbody>
<tbody>
<tr class="odd">
<td>exception</td>
<td>causes a SourceNotFoundException when the path does not exist</td>
</tr>
<tr class="even">
<td>ignore</td>
<td><strong>default</strong> all test continue although the classes at the given path will not be included in the test</td>
</tr>
</tbody>
</table>
<p>So, after showing the simplistic configuration in Architecture Rules 101, we have now shown how you can customize your configuration to fit your needs with little work.</p>
<p>In the next Architecture Rules lesson, we&#8217;ll demonstrate how to get the Configuration and show how easy it is to provide programmatic configuration instead of or in addition to the XML configuration. Also coming up right after that, we&#8217;ll finally introduce the Maven 2 Architecture Rules plugin that Mykola has been working on for the past couple of months.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Farchitecture-rules-tutorial-102%2F&amp;linkname=Architecture%20Rules%20Tutorial%3A%20102">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/architecture-rules-tutorial-101/" title="Architecture Rules Tutorial: 101">Architecture Rules Tutorial: 101</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/architecture-rules-tutorial-102/">Permalink</a> |
<a href="http://blog.architecturerules.org/architecture-rules-tutorial-102/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/architecture-rules-tutorial-102/&amp;title=Architecture Rules Tutorial: 102">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/tutorial/" rel="tag">tutorial</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/architecture-rules-tutorial-102/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Exceptional Metadata</title>
		<link>http://blog.architecturerules.org/exceptional-metadata/</link>
		<comments>http://blog.architecturerules.org/exceptional-metadata/#comments</comments>
		<pubDate>Fri, 30 May 2008 00:49:49 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[exceptions]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=78</guid>
		<description><![CDATA[Exceptions are an important part of any programming language, especially Java. Java has two types of Exceptions. No, not checked and unchecked, but rather useful and useless. The utility of the Exception is up to you, the developer.]]></description>
			<content:encoded><![CDATA[<p>Exceptions are an important part of any programming language, especially Java. Java has two types of Exceptions. No, not checked and unchecked, but rather useful and useless. The utility of the Exception is up to you, the developer. What am I talking about? Bear with me, read on, and please share your comments at the end.</p>
<h3>Core data</h3>
<p>Exceptions are comprised of some sort of primary data, for example, the name or type of Exception, and maybe the exception&#8217;s <tt>message</tt>. Take, for example, a <tt>ConnectionTimeoutException</tt>.</p>
<p>You, as a developer, have a pretty good idea as to what is going on when you see this at the top of the stack trace. You may be able to read the message, if the developer provided one, and get a little more information about the exception.</p>
<pre class="brush: java;">
/**
* Signals that a timeout occurred while opening the socket.
*/
public class ConnectionTimeoutException extends IOException {

/** Create an instance */
public ConnectionTimeoutException(String message) {
super(message);
}

}
</pre>
<h3>Default Metadata</h3>
<p>If you read a stack trace or hack the exception&#8217;s API, you can even get some more information about the it. Such as the Class that threw the Exception, or the line number where the Exception occurred.  You might be able to review the hierarchy of the class to garner some information. For example, this <tt>ConnectionTimeoutException</tt> extends from <tt>IOException</tt>. That tells you something.</p>
<h3>The Problem</h3>
<p>The problem with this type of Exception is that someone, like a developer, needs to review this information in order to track down the cause of the issue. That means locating the stack trace, and determining the parameters and other configurations that were present at the time of the Exception.</p>
<p>Java, however, and most any other language, provide a means for supplying pertinent metadata when an Exception occurs. They are called properties, getters and setters, or mutators. You, as the designer, just need to include those properties when you design the class.</p>
<h3>Example</h3>
<p>Consider the <tt>ConnectionTimeoutException</tt>. Wouldn&#8217;t it be nice to know the source  and destination URIs of the connection? And what the timeout value was?</p>
<pre class="brush: java;">
/**
* Signals that a timeout occurred while opening the socket.
*/
public class ConnectionTimeoutException extends IOException {

private long timeout;
private String source;
private String destination;

/** Create an instance */
public ConnectionTimeoutException(long timeout, String source, String destination) {

super(&quot;failed to connect to &quot; + destination + &quot; within alloted &quot; + timeout + &quot;ms&quot;);

this.timeout = timeout;
this.source = source;
this.destination = destination;
}

public long getTimeout();
public String getSource();
public String getDestination();
}
</pre>
<p>Would you agree that the Exception that knows the timeout value and destination URI is more valuable to you, the developer, than some Exception with an arbitrary message that the designer may or may not have populated with relevant information?</p>
<h3>Benefits</h3>
<p>The resulting Exception implementation provides a constructor requiring specific values. The developer who consumes this Exception no longer needs to come up with some arbitrary message. He or she just needs to provide the requested parameters, which is known or can be read from some HttpClient implementation.</p>
<p>The developer who is catching and dealing with this <tt>ConnectionTimeoutException</tt> now has a few more options. Perhaps an error message will be displayed. The developer can write a custom message and use the <tt>timeout</tt> property to notify the end user what the timeout was. The developer doesn&#8217;t need to parse it from a <tt>String message</tt> property.</p>
<p>If the code throwing the <tt>ConnectionTimeoutException</tt> is a framework to be used by other developers, the developer has a lot more options to handle this <tt>Exception</tt>. Perhaps they are writing a GUI for your tool and can now provide their end users with more information.</p>
<h3>Metadata in the Real World</h3>
<p>I decided to write about this topic after a user of our <a href="http://architecturerules.org">Architecture Rules</a> (<strong>Assert your Architecture!</strong>) open source software <a href="http://code.google.com/p/architecturerules/issues/detail?id=42&amp;can=1">asked us to enhance our Exception APIs</a>.</p>
<p>Our <tt>CyclicRedundancyException</tt> simply contained a message that described a package by its name, and then listed all of the packages involved in a cyclic dependency with said package.</p>
<pre class="brush: xml;">
...architecturerules.exceptions.CyclicRedundancyException:
cyclic dependencies found:

-- test.com.seventytwomiles.services
|  |
|  |-- test.com.seventytwomiles.model
|  |
|  |-- test.com.seventytwomiles.dao.hibernate
|
|
-- test.com.seventytwomiles.model
|  |
|  |-- test.com.seventytwomiles.services
|
|
-- test.com.seventytwomiles.dao.hibernate
|
|-- test.com.seventytwomiles.services
</pre>
<p><a href="http://code.google.com/u/steven.devijver/">steven.devijver</a> asked that we provide an API to retrieve a List of the packages involved in the cycle. This way Steven can construct his own message, or wrap the data in his own domain <tt>Exception</tt>, or whatever else he had in mind. We accommodated him by providing a Map containing a key (package name) and value (List of package names involved in a cyclic dependency) pair. This should be useful when we go to write the Maven 2 plugin report for this tool.</p>
<p>As another example, we inherited a <tt>DataFinderException</tt> in another project we&#8217;re working on. The only constructor for this Exception was a String named <tt>message</tt>. We introduced a new constructor and two properties &#8212; <tt>name</tt> and <tt>value</tt> &#8212; and getters for each. Now, the code that constructs <tt>DataFinderExceptions</tt> no longer needs to build some complex message with a <tt>StringBuffer</tt> before throwing the Exception.</p>
<pre class="brush: java;">
StringBuffer message = new StringBuffer();
message.append(&quot;Could not find entity with&quot;);
message.append(&quot;userId&quot;);
message.append(&quot; = &quot;);
message.append(userId);

throw new DataFinderException(message.toString());
</pre>
<p>became</p>
<pre class="brush: java;">
throw new DataFinderException(&quot;userId&quot;, userId);
</pre>
<p>A cleaner execution, fewer lines of code, and useful metadata that can be passed on to the end user, logged, or handled eloquently.</p>
<p>How do you design your Exceptions to provide useful metadata? Can you think of any Exception in the JDK that provide such metadata?</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Fexceptional-metadata%2F&amp;linkname=Exceptional%20Metadata">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/wildcard-support/" title="Wildcard Support">Wildcard Support</a></li><li><a href="http://blog.architecturerules.org/on-delicious/" title="On del.icio.us">On del.icio.us</a></li><li><a href="http://blog.architecturerules.org/hudson/" title="Hudson">Hudson</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/exceptional-metadata/">Permalink</a> |
<a href="http://blog.architecturerules.org/exceptional-metadata/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/exceptional-metadata/&amp;title=Exceptional Metadata">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/exceptions/" rel="tag">exceptions</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/exceptional-metadata/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Squash those Cycles</title>
		<link>http://blog.architecturerules.org/squash-those-cyles/</link>
		<comments>http://blog.architecturerules.org/squash-those-cyles/#comments</comments>
		<pubDate>Sat, 17 May 2008 00:51:42 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=80</guid>
		<description><![CDATA[Two packages are said to be involved in a cyclic dependency when package A depends on package B and package B depends on package A. Learn why you should prevent cycles and when it is ok to use them.]]></description>
			<content:encoded><![CDATA[<p>Two packages are said to be involved in a cyclic dependency when package A depends on package B and package B depends on package A. This is called a direct cyclic dependency. Cyclic dependencies are created in various ways at different layers within a software system. It&#8217;s also possible for a cyclic relationship in one layer to cause cycles in another.</p>
<p style="text-align: center;"><a title="cycles by 72miles, on Flickr" href="http://www.flickr.com/photos/25114327@N04/2420371848/"><img src="http://farm4.static.flickr.com/3132/2420371848_967b59ba1b.jpg" alt="cycles" width="388" height="320" /></a></p>
<p>Cyclic dependencies hurt a <a href="http://72miles.com/blog/posts/software-engineering-goals/" target="_blank">software system&#8217;s goals</a>:</p>
<ul>
<li> <span class="tooltip"><span><strong>Understandability </strong></span></span><span>Understandable software is critical in managing complex systems. Software that is easily understood acts like a bridge between the problem and its solution.</span></li>
<li><strong>Flexibility</strong></li>
<li> <span><strong>Modularity</strong> An approach to developing software that breaks projects into smaller units designed so that they can work with other sections of the program. Modifying the way that modules work will have no adverse affects on the other components of a program </span></li>
</ul>
<ul>
<li> <span><strong>Modifiability</strong> </span><span class="tooltip"><span>Modifiability is controlled change to the system in which some parts are altered without increasing the complexity or obscuring the logic of the original structure.</span></span></li>
<li> <span><strong>Reliability</strong> Reliability is the extent to which a software yields consistent, stable, and uniform without any human intervention and is crucial for any software system that must operate for long periods. </span></li>
<li> <span><strong>Maintainability</strong> The ease with which a software system can be modified to change or add capabilities, improve performance, or correct defects. </span></li>
</ul>
<ul>
<li> <span><strong>Testability</strong> The degree to which a system or component facilitates the establishment of test criteria and the performance of tests to determine whether those criteria have been met. </span></li>
<li><strong>Reusability</strong></li>
<li><strong>Clarity</strong></li>
</ul>
<p>By using Architecture Rules to Assert your Architecture, you are taking the first step in developing a strong architecture by <strong>actively managing package relationships</strong>.</p>
<p>Aside from the adverse affects on the software development goals, cyclic dependencies create these negative consequences for the system:</p>
<ul>
<li> Diminish the ability to determine a package&#8217;s purpose.</li>
<li> Changes impact seemingly unrelated components of the architecture.</li>
<li> Separation of layers.</li>
<li> Packages cooperating in a cycle must be released as an atomic unit.</li>
</ul>
<h3>Determine a Package&#8217;s Purpose</h3>
<p>When future developers come along to maintain the software the presence of cycles can diminish the ability for that developer to determine a package&#8217;s purpose. This hurts the software&#8217;s clarity and understandability. The end result will be the introduction of bugs, or an increase in the amount of time required to modify the software.</p>
<h3>Changes Impact Unrelated Components</h3>
<p>When a class involved in a cycle is modified, it could change the bahavior of the other class involved in the cycle. This makes it difficult to accurately assess and manage the impact of changes to the system. This directly hinders the modifiability of your software. Reliability is also attacked since changing the behavior of an unrelated class could introduce a bug.</p>
<p>Affecting other components also introduces a maintenance and testing issue, since you can&#8217;t do anything to either class without possibly affecting the other. A situation exists where class A needs to compile against class B, but class B needs to compile against class A.</p>
<h3>Separation of Layers</h3>
<p>Most architectural approaches recognize the advantages of layered architectures. For example, if you develop a presentation layer, a business or logic layer, and a database access layer, you are able to swap out one implementation of a layer for another. Such as replacing a JDBC data access layer with one that utilizes Hibernate, or a JSP presentation layer for a Flash or PHP presentation layer.</p>
<p>Cyclic dependencies across layers couple the layers, defeating the purpose of layering. If a cycle exists between the service layer and the data access layer, then those two layers are no longer interchangeable. Thus, modifiability of the software is lowered. The layers are no longer encapsulated.</p>
<h3>Packages Must be Released as an Atomic Unit</h3>
<p>The <a href="http://www.springframework.org/">Spring Framework</a> is inspiring when it comes to its modular design. The Spring Framework can be considered as a collection of smaller frameworks. Most of these frameworks are designed to work independently of each other yet provide better functionalitys when used together.</p>
<p>This modularity by design, allows the Spring Framework to released as a full framework (spring.jar) or modularly, so that the users can use the features that they are interested, and nothing more (spring-core, spring-ldap, spring-orm, spring-aop, spring-beans, spring-mock, and on and on&#8230;). See all of the modules <a href="http://www.mvnrepository.com/artifact/org.springframework">here</a>.</p>
<p>When cyclic dependencies exist, your ability to make and release independent modules is removed. Packages that may not be related must be released as a single jar, or module.</p>
<p>ArchitectureRules wraps <a href="http://clarkware.com/software/JDepend.html">JDepend</a>, a java library which is able to identify these cyclic dependencies. Upon detecting a cyclic dependency, a <a href="http://wiki.architecturerules.org/index.php?title=Exceptions#CyclicRedundencyException">CyclicDependencyException</a> is thrown, a RuntimeException whose message notifies you of which packages are involved in a cyclic dependency:</p>
<pre class="brush: xml;">
...architecturerules.exceptions.CyclicRedundancyException:

cyclic dependencies found:
-- test.com.seventytwomiles.services
| |
| |-- test.com.seventytwomiles.dao.hibernate
|
-- test.com.seventytwomiles.dao.hibernate
|
|-- test.com.seventytwomiles.services
</pre>
<h3>When are Cycles Acceptable</h3>
<p>Generally speaking, cycles are most always accepted when in the same package. For example two domain objects in the same package, such as User and Account. A User has Accounts, and an Account has a User. Since these two classes are in the same package, the package remains encapsulated.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Fsquash-those-cyles%2F&amp;linkname=Squash%20those%20Cycles">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/wildcard-support/" title="Wildcard Support">Wildcard Support</a></li><li><a href="http://blog.architecturerules.org/30-roadmap/" title="3.0 Roadmap">3.0 Roadmap</a></li><li><a href="http://blog.architecturerules.org/hudson/" title="Hudson">Hudson</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/squash-those-cyles/">Permalink</a> |
<a href="http://blog.architecturerules.org/squash-those-cyles/#comments">2 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/squash-those-cyles/&amp;title=Squash those Cycles">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/squash-those-cyles/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gumby and Architecture Rules</title>
		<link>http://blog.architecturerules.org/gumby-and-architecture-rules/</link>
		<comments>http://blog.architecturerules.org/gumby-and-architecture-rules/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 00:52:50 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=82</guid>
		<description><![CDATA[We're selling Architecture Rules coffee mugs. Coffee mugs are great ways to spark conversations with coworkers. Pick up your mug to let everyone know that you Assert your Architecture.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">I keep my desk pretty minimal. Its pretty big, but the desktop is usually about 80% cleaned. The few things that I keep on it, other than a notebook and pen, are strategically placed and are designed to be conversation pieces. These items include a 2 gallon fish tank, with a Tiger Barb and plant, a poseable Gumby figure, and the latest addition, my Architecture Rules mug.</p>
<p style="text-align: left;">Now, the whole reason for these artifacts is to draw those two pass by my desk into a conversation &#8211; this offers a break in the day and a chance to get to know the people around me better.</p>
<p style="text-align: left;">The fish tank has been very popular, a lot of people can relate, or have a story, or just like to look at the fish. Gumby is a lot of fun. Its fun to see those who recognizes him, and those who don&#8217;t even know who Gumby is. I wanna order a couple of Blockhead figures to go along side him.</p>
<p style="text-align: center;"><a title="tigerbarb by 72miles, on Flickr" href="http://www.flickr.com/photos/25114327@N04/2419462335/"><img src="http://farm3.static.flickr.com/2175/2419462335_6590bb5853_o.gif" alt="tigerbarb" width="140" height="140" /></a> <a title="gumby by 72miles, on Flickr" href="http://www.flickr.com/photos/25114327@N04/2420276984/"><img src="http://farm3.static.flickr.com/2391/2420276984_871ab796c3_o.gif" alt="gumby" width="140" height="140" /></a> <a title="mug by 72miles, on Flickr" href="http://www.flickr.com/photos/25114327@N04/2419462135/"><img src="http://farm4.static.flickr.com/3182/2419462135_839d15a6ca_o.gif" alt="mug" width="140" height="140" /></a></p>
<p style="text-align: left;">So the new one is the Architecture Rules mug that I designed and put up on <a href="http://www.cafepress.com/arules">CafePress</a>.  This has been a great way for me to get the people around me to talk about software, and specifically, about software architecture.  I highly recommend that, if you use Architecture Rules, you pick up one of these mugs, put it on your desk, and start telling the world that you are actively mitigating architecture risk everyday. Hey, that&#8217;s something you, your coworkers, your customers, and your bosses can get behind.</p>
<p>Or, if you&#8217;re just looking for a new trinket to put on your desk, this mug is a lot cheaper and easier to maintain than a fish tank is. I have personally tested the mug and had successfully results with coffee, water, various teas, apple cider, and soup.</p>
<p>I have to be honest, the price that CafePress charges, of $13.99, is rather steep for a mug, <em>but</em> it is a tall mug with a capacity of 15 oz., and a buck or so goes to supporting Architecture Rules. Right now we are trying to raise funds to snag the domain architecturerules.com. Your purchase would go a long way in helping to secure that domain.</p>
<p>Here you can check out the <a href="http://architecturerules.googlecode.com/svn/docs/images/schwag.png">upclose graphic</a>. And if you can&#8217;t afford the mug, but you wanna help us get the domain or help us towards our current fund raising goal, you might be able to <a href="http://wiki.architecturerules.org/index.php?title=FundRaising">donate some change to the project</a>.</p>
<p>So, what toys do you keep on your desk? What are the best conversation starters? Do you keep any trinkets branded with a tool or technology (my pen branded with Sun Java)?</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Fgumby-and-architecture-rules%2F&amp;linkname=Gumby%20and%20Architecture%20Rules">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/configuration-method-chaining/" title="Configuration Method Chaining">Configuration Method Chaining</a></li><li><a href="http://blog.architecturerules.org/architecture-rules-tutorial-101/" title="Architecture Rules Tutorial: 101">Architecture Rules Tutorial: 101</a></li><li><a href="http://blog.architecturerules.org/architecture-rules-eats-his-own-dog-food/" title="Architecture Rules eats his own Dog Food">Architecture Rules eats his own Dog Food</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/gumby-and-architecture-rules/">Permalink</a> |
<a href="http://blog.architecturerules.org/gumby-and-architecture-rules/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/gumby-and-architecture-rules/&amp;title=Gumby and Architecture Rules">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/gumby-and-architecture-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration Method Chaining</title>
		<link>http://blog.architecturerules.org/configuration-method-chaining/</link>
		<comments>http://blog.architecturerules.org/configuration-method-chaining/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 00:54:58 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[configuration]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=84</guid>
		<description><![CDATA[We have all seen method chaining, especially in configuration classes. Architecture Rules has a typical configuration class that currently does not support method chaining. We decided to investigate method chaining to determine if it should be introduced into this project or not.]]></description>
			<content:encoded><![CDATA[<p>We have all seen method chaining, especially in configuration classes. <a href="http://architecturerules.org">Architecture Rules</a> has a typical configuration class that currently does not support method chaining. Modifying the public API of a tool is hardly ever a good thing, but in this case, the change would still be backwards compatible. So we decided to investigate method chaining to determine if it should be introduced into this project or not.</p>
<h3>What is it</h3>
<p>Method chaining is a programming technique that is supported by many public interfaces. It allows the programmer to call one method from &#8211; directly after &#8211; another. For example, in Java:</p>
<div style="width: 220px; float: left; display: inline; margin-right: 5px;">
<h4>Chained</h4>
<pre class="brush: java;">
Event event = new Event()
.setDescription(&quot;&quot;)
.setStartDate(start)
.setEndDate(end)
.setPrivate(true);
</pre>
</div>
<div style="width: 220px; float: left; display: inline;">
<h4>Unchained</h4>
<pre class="brush: java;">
Event event = new Event();
event.setDescription(&quot;&quot;);
event.setStartDate(start);
event.setEndDate(end);
event.setPrivate(true);
</pre>
</div>
<div style="clear: both;">
<h3>Where Is It</h3>
<p>We see it very often with configuration classes. Such as the <a href="http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html#configuration-programmatic" target="_blank">Hibernate Configuration class</a>.</p>
<pre class="brush: java;">
Configuration configuration = new Configuration()
.addClass(org.hibernate.Item.class)
.addClass(org.hibernate.Bid.class)
.setProperty(&quot;...dialect&quot;, &quot;...MySQLInnoDBDialect&quot;)
.setProperty(&quot;...connection.datasource&quot;, &quot;java:jdbc/test&quot;)
.setProperty(&quot;...order_updates&quot;, &quot;true&quot;);
</pre>
<p>Its also used commonly with the <a href="http://c2.com/cgi/wiki?BuilderPattern" target="_blank">Builder Pattern</a> which simply <q>creates a complex object using a number of steps.</q></p>
<h3>How To</h3>
<p>Designing method chaining into your code is pretty simple. In Java, rather than returning void by a method, such as a setter methods, return the entity being acted on. In Java, just <tt>return this;</tt></p>
<pre class="brush: java;">
class Event {

public Event setDescription(String description) {
this.description = description;
return this;
}

public Event create() {
... something complicated ...
return this;
}
}
</pre>
<p>So, to change an existing class to support method chaining in Java, change all your <tt>void</tt> methods, to return the entity type, and add <tt>return this;</tt> at the end of the method. It is pretty much a trivial task.</p>
<h3>Concerns</h3>
<p>There are some concerns with method chaining.</p>
<p>First, there are some out there who claim that chained methods are less readable. To them, it could be less readable. To other, more readable. Aligning the chained method calls on new lines can increase readability. A single line of method calls is certainly less readable than a single method call on a single line. Compare this to the examples of the Event class above.</p>
<pre class="brush: java;">
Event event = new Event()
.setDescription(&quot;&quot;).setStartDate(start).setEndDate(end);
</pre>
<p>Second, mixing setter methods, with action methods can be very confusing to the readers. The problem comes with determining where these complex actions are taking place. Consider the following.</p>
<pre class="brush: java;">
int eventId = new Event()
.setDescription(&quot;&quot;)
.setStartDate(start)
.setEndDate(end)
.setPrivate(true)
.insert()
.getId();
</pre>
<p>This is simple example. Most everyone understands that the <tt>insert()</tt> call is utilizing JDBC code to insert the Event in to a table, it probably sets the Event <tt>id</tt> property, and then the <tt>getId()</tt> returns that id. But what if the entity was more obscure, and the method name was not so clear? It might not be obvious where complex actions are taking place.</p>
<p>A third concern is when do you stop? and when don&#8217;t you stop? Let say an entity has a dozen or so setters that are commonly called as part of setting up a usable entity. Should you call all twelve? Two groups of six? Group by type? What is more readable? what is less readable? I don&#8217;t know. Depends on the author, the readers, the context. There are a lot of considerations.</p>
<h3>When to Use</h3>
<p>Method chaining is pretty commonly used when you are performing one complete action, building a complete entity, or performing an atomic task.</p>
<p>First, performing an action, such as a query. Here is an example from Hibernate.</p>
<pre class="brush: java;">
List cats = session.createCriteria(Cat.class)
.add( Restrictions.like(&quot;name&quot;, &quot;Fritz%&quot;) )
.add( Restrictions.between(&quot;age&quot;, minAge, maxAge) )
.list();
</pre>
<p>Second, building an entity. Sometimes this is done with a Builder class. With the example of the Event class, calling the setters could be chained. Calling <tt>insert()</tt> and <tt>getId()</tt> should not be chained.</p>
<p>Finally, an atomic task, such as validation, could reasonably be chained.</p>
<pre class="brush: java;">
boolean valid = validator(value)
.isGreaterThan(0)
.isLessThan(10)
.isCurrancy();
</pre>
<h3>Our Dilemma</h3>
<p>We did this research to determine weather or not we should modify the <a href="http://architecturerules.org">Architecture Rules</a> <a href="http://architecturerules.googlecode.com/svn/docs/api/">API</a> to support method chaining in the <tt><a href="http://architecturerules.googlecode.com/svn/docs/maven-generated-site/xref/com/seventytwomiles/architecturerules/configuration/Configuration.html">Configuration</a></tt> and <tt><a href="http://architecturerules.googlecode.com/svn/docs/maven-generated-site/xref/com/seventytwomiles/architecturerules/domain/Rule.html">Rule</a></tt> classes.</p>
<p><a title="rule_class_diagram by 72miles, on Flickr" href="http://www.flickr.com/photos/25114327@N04/2390364637/"><img src="http://farm4.static.flickr.com/3113/2390364637_0e0675cc1a_s.jpg" alt="rule_class_diagram" width="75" height="75" /></a> <a title="configuration_class_diagram by 72miles, on Flickr" href="http://www.flickr.com/photos/25114327@N04/2391214086/"><img src="http://farm4.static.flickr.com/3205/2391214086_f91c1b24c8_s.jpg" alt="configuration_class_diagram" width="75" height="75" /></a></p>
<p>Based on the research that we have done, since the <tt>Configuration</tt> and <tt>Rule</tt> classes have no actionable methods &#8211; just setters, they are essentially POJOS &#8211;  we think it would be appropriate to chain those setters together, and that the resulting code would be no less readable or deceiving. We will include method chaining in <a href="architecture-rules-210-on-the-horizon">2.1.0</a>.</p>
<h4>Resources</h4>
<p><a href="http://martinfowler.com/dslwip/MethodChaining.html">http://martinfowler.com/dslwip/MethodChaining.html</a><br />
<a href="http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html">http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html</a><br />
<a href="http://kasparov.skife.org/blog/src/method_chaining.html">http://kasparov.skife.org/blog/src/method_chaining.html</a></div>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Fconfiguration-method-chaining%2F&amp;linkname=Configuration%20Method%20Chaining">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/architecture-rules-tutorial-101/" title="Architecture Rules Tutorial: 101">Architecture Rules Tutorial: 101</a></li><li><a href="http://blog.architecturerules.org/xml-report-prototype/" title="XML Report Prototype">XML Report Prototype</a></li><li><a href="http://blog.architecturerules.org/hudson/" title="Hudson">Hudson</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/configuration-method-chaining/">Permalink</a> |
<a href="http://blog.architecturerules.org/configuration-method-chaining/#comments">2 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/configuration-method-chaining/&amp;title=Configuration Method Chaining">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/configuration/" rel="tag">configuration</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/configuration-method-chaining/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Architecture Rules Tutorial: 101</title>
		<link>http://blog.architecturerules.org/architecture-rules-tutorial-101/</link>
		<comments>http://blog.architecturerules.org/architecture-rules-tutorial-101/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 00:55:43 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=87</guid>
		<description><![CDATA[A short sweet tutorial to get you started with a simple XML configuration.]]></description>
			<content:encoded><![CDATA[<p>How about a short, sweet introduction to <a href="http://architecturerules.org">Architecture Rules</a>.</p>
<h3>The Basics</h3>
<ul>
<li>Java.</li>
<li><a href="http://www.apache.org/licenses/LICENSE-2.0">Open Source</a>.</li>
<li>Asserts architectural rules via unit tests.</li>
<li>Write your rules in <a href="http://wiki.architecturerules.org/index.php?title=SampleConfiguration">XML</a>.</li>
<li>Run your tests with junit, <a href="http://architecturerules.googlecode.com/svn/docs/run.html#ant-task">ant</a>, or a continuous integration server.</li>
</ul>
<h3>Your Rules</h3>
<p>You define your rules. For example, if you are developing n-tiered software, you probably have three layers. A DAO/integration layer, a service/business layer, and a presentation layer. Generally, the presentation layer does not interact directly with the integration layer. You could describe this rule as:  <tt>com.company.project.presentation</tt> can not depend on the <tt>com.company.project.integration</tt> package.  Its that easy.</p>
<h3>The XML</h3>
<p>The XML is in <em>architecture-rules.xml</em> and contains two section: <tt>&lt;configuration&gt;</tt> and <tt>&lt;rules&gt;</tt>. Configuration describes where your files are, and the rules simply describe a package, and one or more packages that it can not depend on.</p>
<pre class="brush: xml;">
&lt;architecture&gt;

&lt;configuration&gt;
&lt;sources&gt;
&lt;source&gt;targetclasses&lt;/source&gt;
&lt;/sources&gt;
&lt;/configuration&gt;

&lt;rules&gt;

&lt;rule id=&quot;dao&quot;&gt;
&lt;packages&gt;
&lt;package&gt;
com.company.project.presentation
&lt;/package&gt;
&lt;/packages&gt;
&lt;violations&gt;
&lt;violation&gt;
com.company.project.integration
&lt;/violation&gt;
&lt;/violations&gt;
&lt;/rule&gt;

&lt;/rules&gt;

&lt;/architecture&gt;
</pre>
<p>Thats it. You have a simple <em>architecture-rules.xml.</em></p>
<h3>The Unit Test</h3>
<p>Just extend and run your tests.</p>
<pre class="brush: java;">
public class SimpleArchitectureTest
extends AbstractArchitectureRulesConfigurationTest {

public String getConfigurationFileName() {
return &quot;architecture-rules.xml&quot;;
}

public void testArchitecture() {
assertTrue(doTests());
}
}
</pre>
<h3>More Features</h3>
<p>In Architecture Rules 201, we&#8217;ll show you how to check for cycles (<a href="http://wiki.architecturerules.org/index.php?title=CyclicDependencies">cyclic dependencies</a>), write more action-packed rules, and describe how to handle source paths that can&#8217;t be found.  We can also take a gander at the various <a href="http://wiki.architecturerules.org/index.php?title=Exceptions">Exceptions</a> that can be thrown when rules are broken.</p>
<h3>Go Get It</h3>
<p>The next thing to do, is to go get it and try it out. <a href="http://wiki.architecturerules.org/index.php?title=DownloadFromGoogle">Download</a>, <a href="http://wiki.architecturerules.org/index.php?title=SVN">svn checkout</a>, or put it in your pom.xml. Just add this repository:</p>
<pre class="brush: xml;">
&lt;repository&gt;
&lt;id&gt;architect-rules-repo&lt;/id&gt;
&lt;name&gt;
architecture-rules hosted by code.google.com
&lt;/name&gt;
&lt;layout&gt;default&lt;/layout&gt;
&lt;url&gt;

http://architecturerules.googlecode.com/svn/maven2/

&lt;/url&gt;
&lt;releases&gt;
&lt;checksumPolicy&gt;ignore&lt;/checksumPolicy&gt;
&lt;/releases&gt;
&lt;snapshots&gt;
&lt;checksumPolicy&gt;ignore&lt;/checksumPolicy&gt;
&lt;/snapshots&gt;
&lt;/repository&gt;
</pre>
<p>And this dependency:</p>
<pre class="brush: xml;">
&lt;dependency&gt;
&lt;groupId&gt;com.seventytwomiles&lt;/groupId&gt;
&lt;artifactId&gt;architecture-rules&lt;/artifactId&gt;
&lt;version&gt;2.0.3&lt;/version&gt;
&lt;/dependency&gt;
</pre>
<p><a title="architecture rules xml by 72miles, on Flickr" href="http://www.flickr.com/photos/25114327@N04/2383685309/"><img src="http://farm4.static.flickr.com/3234/2383685309_6fb415ca1e_m.jpg" alt="architecture rules xml" width="210" height="160" /></a> <a title="architecture rules java by 72miles, on Flickr" href="http://www.flickr.com/photos/25114327@N04/2384515078/"><img src="http://farm3.static.flickr.com/2138/2384515078_6124049618_m.jpg" alt="architecture rules java" width="210" height="160" /></a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Farchitecture-rules-tutorial-101%2F&amp;linkname=Architecture%20Rules%20Tutorial%3A%20101">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/architecture-rules-tutorial-102/" title="Architecture Rules Tutorial: 102">Architecture Rules Tutorial: 102</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/architecture-rules-tutorial-101/">Permalink</a> |
<a href="http://blog.architecturerules.org/architecture-rules-tutorial-101/#comments">2 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/architecture-rules-tutorial-101/&amp;title=Architecture Rules Tutorial: 101">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/tutorial/" rel="tag">tutorial</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/architecture-rules-tutorial-101/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Architecture-Rules 2.1.0 on the Horizon</title>
		<link>http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/</link>
		<comments>http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 00:56:23 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2.1.1]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=89</guid>
		<description><![CDATA[Architecture Rules has been progressing. After 5 releases under 2.0.x, we have a tentative road map for the next release, slated to to hold the 2.1.0 tag. Here are some of the upcoming features you can look for.]]></description>
			<content:encoded><![CDATA[<p><a href="http://architecturerules.org" target="_blank">Architecture Rules</a> has been progressing. After <a href="http://wiki.architecturerules.org/index.php?title=Release:2.0.3" target="_blank">5 releases under 2.0.x</a>, we have a tentative road map for the next release, slated to to hold the 2.1.0 tag.  Here are some of the upcoming features you can look for.</p>
<h3>Maven Plugin</h3>
<p>Mykola has been working hard on the <a href="http://code.google.com/p/architecturerules/source/browse/trunk/maven-architecture-rules-plugin/" target="_blank">maven-architecture-rules-plugin</a>. With it, you will no longer even need to write a unit test. Just write your <a href="http://wiki.architecturerules.org/index.php?title=SampleConfiguration" target="_blank">architecture-rules.xml</a>, and attach the appropriate goal to Maven&#8217;s test phase.  He has been tackling multi project projects recently. This is sure to make asserting your architecture even easier for Maven users.</p>
<h3>Maven repository</h3>
<p>Speaking of Maven users, development of Architecture Rules relies on Maven. Today, to use Architecture Rules, you&#8217;d have to <a href="http://wiki.architecturerules.org/index.php?title=DownloadFromGoogle" target="_blank">download the Architecture Rules jar</a> and put it on your own repository, or your <em>lib </em>directory. This is too much work and we shouldn&#8217;t expect you to have to do that. We are going to get the jars and sources up into a Google Code hosted repository so you can just declare the dependency and repository in your pom.xml and <a href="http://wiki.architecturerules.org/index.php?title=GettingStarted" target="_blank">get started even faster</a>. In fact, we already have it up, its just not documented yet. Here is the first public mention of it.</p>
<p>Just add this repository:</p>
<pre class="brush: xml;">
&lt;repository&gt;
&lt;id&gt;architect-rules-repo&lt;/id&gt;
&lt;name&gt;architecture-rules repository&lt;/name&gt;
&lt;layout&gt;default&lt;/layout&gt;
&lt;url&gt;http://architecturerules.googlecode.com/svn/maven2&lt;/url&gt;
&lt;releases&gt;
&lt;checksumPolicy&gt;ignore&lt;/checksumPolicy&gt;
&lt;/releases&gt;
&lt;snapshots&gt;
&lt;checksumPolicy&gt;ignore&lt;/checksumPolicy&gt;
&lt;/snapshots&gt;
&lt;/repository&gt;
</pre>
<p>And this dependency:</p>
<pre class="brush: xml;">
&lt;groupId&gt;com.seventytwomiles&lt;/groupId&gt;
&lt;artifactId&gt;architecture-rules&lt;/artifactId&gt;
&lt;version&gt;2.0.3&lt;/version&gt;
</pre>
<h3>Java 5</h3>
<p>We think its pretty safe to assume our users are up to Java 5 now, so we are going to update the code base to Java 5. This also makes it easier for us to integrate the maven-architecture-rules-plugin. If you are not up to Java 5, the greatest version you will be able to use is 2.0.3, which is a good release and should do the trick for you.</p>
<h3 id="chaining">Configuration Chaining</h3>
<p>Finally, rather trivial in the whole scheme of things, but if you opted to use the programmatic configuration over the recommended XML configuration, then we&#8217;re going to slightly modify the Configuration class to allow for chaining. So instead of:</p>
<pre class="brush: java;">
Configuration configuration = new Configuration();
configuration.addRule(rule1);
configuration.addRule(rule2);
configuration.addRule(rule3);
</pre>
<p>You can use:</p>
<pre class="brush: java;">
Configuration configuration = new Configuration()
.addRule(rule1)
.addRule(rule2)
.addRule(rule3);
</pre>
<p>This is going to be great once you see an example where you add all of your rules, add all the package locations, and set up the other options.</p>
<p>So thats what we have been working on at <a href="http://architecturerules..org">Architecture Rules</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Farchitecture-rules-210-on-the-horizon%2F&amp;linkname=Architecture-Rules%202.1.0%20on%20the%20Horizon">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/architecture-rules-211-release/" title="Architecture-Rules 2.1.1 Release">Architecture-Rules 2.1.1 Release</a></li><li><a href="http://blog.architecturerules.org/architecture-rules-210-release/" title="Architecture-Rules 2.1.0 Release">Architecture-Rules 2.1.0 Release</a></li><li><a href="http://blog.architecturerules.org/wildcard-support/" title="Wildcard Support">Wildcard Support</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/">Permalink</a> |
<a href="http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/&amp;title=Architecture-Rules 2.1.0 on the Horizon">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/211/" rel="tag">2.1.1</a>, <a href="http://blog.architecturerules.org/tag/release/" rel="tag">release</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Architecture-Rules 2.0.3</title>
		<link>http://blog.architecturerules.org/architecture-rules-203/</link>
		<comments>http://blog.architecturerules.org/architecture-rules-203/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 00:57:10 +0000</pubDate>
		<dc:creator>MikeNereson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2.0.3]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://blog.architecturerules.org/?p=91</guid>
		<description><![CDATA[2.0.3 release announcement and Mykola joins the project.]]></description>
			<content:encoded><![CDATA[<p>We released <a href="http://wiki.architecturerules.org/index.php?title=Release:2.0.3" target="_blank">architecture-rules-2.0.3</a> last month.</p>
<h3><strong>Changes</strong></h3>
<ul class="changes">
<li id="issue-23"> <a href="http://code.google.com/p/architecturerules/issues/detail?id=23"> issue-23 </a> determine which dependencies are optional <span>usability</span></li>
<li id="issue-24"> <a href="http://code.google.com/p/architecturerules/issues/detail?id=24"> issue-24 </a> slashes in unix and windows are different, paths can not be read                 <span>usability</span></li>
<li id="issue-25"> <a href="http://code.google.com/p/architecturerules/issues/detail?id=25"> issue-25 </a> cycles test not run with XML configuration <span>usability</span></li>
<li id="issue-25"><span><a href="http://architecturerules.googlecode.com/svn/docs/downloads.html#release-2.0.3" target="_blank">release notes</a></span></li>
</ul>
<p>We have already fixed a couple of issue for the next release, and completed a handful of tasks that have made improvements to the library. We have been getting a lot of help from <a href="http://code.google.com/p/architecturerules/issues/detail?id=34">mykola.nickishov</a>. Since he was submitting so many quality patches, we invited him to join the project as a committer. He he accepted. Thanks Mykola.</p>
<p>We&#8217;ll make a release soon which will describe how to setup your pom.xml to pull down Architecture-Rules automatically, and enhance the CyclicReduendencyException message to point out the exact classes that are involved in the cycles, rather that just reporting on the package. If you can&#8217;t wait until the next release for these features, the subversion trunk has historically been stable, so you can <a href="http://wiki.architecturerules.org/index.php?title=SVN" target="_blank">checkout the project</a> from source.</p>
<p><a href="http://architecturerules.org">Architecture-Rules</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.architecturerules.org%2Farchitecture-rules-203%2F&amp;linkname=Architecture-Rules%202.0.3">Share/Save</a><h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.architecturerules.org/architecture-rules-211-release/" title="Architecture-Rules 2.1.1 Release">Architecture-Rules 2.1.1 Release</a></li><li><a href="http://blog.architecturerules.org/architecture-rules-210-release/" title="Architecture-Rules 2.1.0 Release">Architecture-Rules 2.1.0 Release</a></li><li><a href="http://blog.architecturerules.org/architecture-rules-210-on-the-horizon/" title="Architecture-Rules 2.1.0 on the Horizon">Architecture-Rules 2.1.0 on the Horizon</a></li></ul><hr />
<p><small>&copy; MikeNereson for <a href="http://blog.architecturerules.org">Architecture Rules - Blog</a>, 2008. |
<a href="http://blog.architecturerules.org/architecture-rules-203/">Permalink</a> |
<a href="http://blog.architecturerules.org/architecture-rules-203/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://blog.architecturerules.org/architecture-rules-203/&amp;title=Architecture-Rules 2.0.3">del.icio.us</a>
<br/>
Post tags: <a href="http://blog.architecturerules.org/tag/203/" rel="tag">2.0.3</a>, <a href="http://blog.architecturerules.org/tag/release/" rel="tag">release</a><br/>
</small></p>
<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.architecturerules.org/architecture-rules-203/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
