<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.crowehorwath.com/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Crowe Solutions Architecture Blog : maintainability</title><link>http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/maintainability/default.aspx</link><description>Tags: maintainability</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>Value of Guidance Solutions / Frameworks</title><link>http://www.crowehorwath.com/cs/blogs/solutions/archive/2008/01/02/value-of-guidance-solutions-frameworks.aspx</link><pubDate>Wed, 02 Jan 2008 15:27:00 GMT</pubDate><guid isPermaLink="false">733c1265-83be-4492-a5ff-7e2be949a514:64</guid><dc:creator>Mark Strawmyer</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.crowehorwath.com/cs/blogs/solutions/rsscomments.aspx?PostID=64</wfw:commentRss><comments>http://www.crowehorwath.com/cs/blogs/solutions/archive/2008/01/02/value-of-guidance-solutions-frameworks.aspx#comments</comments><description>&lt;p&gt;I was recently engaged in discussions about the use of design patterns that resulted in my reflecting on projects I&amp;#39;ve seen where I judge design patterns to have been used successfully.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Design patterns can indeed add significant value to a solution and its long term viability and success.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;They can also add a great deal of complexity based upon the pattern in question.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The more main stream the more likely the code will pass the maintenance test where another developer can pick up the code and successfully make modifications or additions that properly adhere to the pattern in play.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The more obscure the pattern the less likely another developer can easily maintain.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;/span&gt;As I reflected on times where I&amp;#39;ve seen patterns be successful I kept coming back to a commonality of what I refer to as a guidance solution or guidance framework being in place early on.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;This boils down to work being done up front to put in place a detailed example of how code will be written.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;It involves items such as creating a solution, putting stubs for various code projects that will hold the UI, data layer, business logic, etc, Enterprise Library or other core components included, and then building out some portion of the solution that hits the database or performs some other item of functionality that will be fairly common within the code base.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;An ASP.NET web project example would be getting the solution setup, establishing multiple projects to hold different tiers of code, getting the authorization provider up and going, and building a secured maintenance page that retrieves and allows updates of data from a data source.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Plugging in the use of data retrieval, error handling, audit trail, and logging, and demonstrated use of design patterns such as MVC, MVP, factory, etc to provide a concrete example.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;This stubbed out solution then serves as a working example for other developers to emulate in writing their code so they aren&amp;#39;t starting from scratch themselves.&lt;/p&gt;
&lt;p&gt;Guidance Solutions / Frameworks certainly don&amp;#39;t guarantee success by any means, but the times I&amp;#39;ve seen them in play from the start other developers have been able to roll on to the project and contribute fairly rapidly without an extreme learning curve.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;The key being that it needs to be done up front to maximize the value and serve as an example for consistency from the start.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Otherwise there is an inevitable part of the project where refactoring is forced to take place to bring consistency to a code base riddled with inconsistency as many of the developers chose different approaches to common items such as database access, logging, and exception handling.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Having the guidance framework in place from the start helps avoid this what can be time consuming and costly quality issue phase on projects.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Even better is if the up front work is done with more common practices that are well known and will require less education within the team and a higher chance it will be willingly adopted over having to force adoption.&lt;/p&gt;&lt;img src="http://www.crowehorwath.com/cs/aggbug.aspx?PostID=64" width="1" height="1"&gt;</description><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/maintainability/default.aspx">maintainability</category><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/architecture/default.aspx">architecture</category><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/guidance/default.aspx">guidance</category><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/patterns/default.aspx">patterns</category><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/framework/default.aspx">framework</category></item><item><title>Code Reviews and Maintainability</title><link>http://www.crowehorwath.com/cs/blogs/solutions/archive/2007/12/26/code-reviews-and-maintainability.aspx</link><pubDate>Wed, 26 Dec 2007 15:06:00 GMT</pubDate><guid isPermaLink="false">733c1265-83be-4492-a5ff-7e2be949a514:43</guid><dc:creator>Mark Strawmyer</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.crowehorwath.com/cs/blogs/solutions/rsscomments.aspx?PostID=43</wfw:commentRss><comments>http://www.crowehorwath.com/cs/blogs/solutions/archive/2007/12/26/code-reviews-and-maintainability.aspx#comments</comments><description>&lt;p&gt;Its continually amazing to me how discipline can go a long way to helping ensure a solution has long term maintainability.&amp;nbsp; Making sure you set&amp;nbsp;parameters and agreed upon standards at the start of a project and then having the mettle to ensure that regardless of how tirelessly you&amp;#39;re having to write code you take the time to stay within the parameters.&amp;nbsp; More often than not when I&amp;#39;m reviewing a solution I see a lack of standards or consistency and excuses such as &amp;quot;there isn&amp;#39;t time for it&amp;quot; is almost always the explanation offered or implied.&amp;nbsp; Or even more shockingly you find an experienced developer that is coding with discipline, but not caring that others aren&amp;#39;t and not sharing their best practices.&amp;nbsp; Open forum peer reviews and discussion of code is something I am a big proponent of in projects especially early on.&amp;nbsp; It helps ensure that folks are on the same page in terms of style, practices, and that the solution is getting off to the right start.&amp;nbsp; This is great for reviewing key and common elements of a solution even if it is only practiced early in the project and then abandoned as the project is more mature in the lifecycle.&amp;nbsp;&amp;nbsp;The downside though is that it isn&amp;#39;t realistic to expect that all code can be reviewed by such a process as there is often way too much code.&lt;/p&gt;
&lt;p&gt;Enter tools.&amp;nbsp; Even if there are no explicit standards being followed, there are code analysis and metric tools that can be a big help to making sure the overall solution is more maintainable and performant.&amp;nbsp; Code analysis will examine the code and look for situations where items may be less than optimal or could be done another way for better performance, maintainability, security, etc.&amp;nbsp; Common situations are things such as over use of string concatenation where specially designed and class library provided string building objects would be better or inconsistent use of naming conventions.&lt;/p&gt;
&lt;p&gt;Code metric tools will examine things such as the overall number of lines of code, depth of inheritence, and cyclomatic complexity which is the number of branches that can be taken within a specific block of code.&amp;nbsp; The higher the cyclomatic complexity the harder it will be to unit test the code as there are more conditions to test.&lt;/p&gt;
&lt;p&gt;There are a number of tools out&amp;nbsp;from vendors such as IBM (Rational), Compuware (DevPartner), and Microsoft (VSTS).&amp;nbsp; Microsoft recently released the Developer edition of its Visual Studio Team Suite that now includes code metrics and analysis.&amp;nbsp; I&amp;#39;ve been experimenting with it and using it to look at a bunch of different code and I&amp;#39;ve been pretty happy with it and its ease of use and understanding so far.&lt;/p&gt;
&lt;p&gt;I highly recommend that developers and development teams adopt a tool to help automate code reviews and perform code analysis and metrics if you&amp;#39;re not already.&amp;nbsp; Even the most disciplined developer will benefit from having an automated review of their code.&amp;nbsp; It only takes a couple of minutes based on the tool and size of the code base and the results can give you plenty to think about and decide to take action on or not.&amp;nbsp; Its a great way to learn additional best practices you may not have been aware of by examining the output of the automated review.&amp;nbsp; Each developer should be responsible for running such as tool against their code and remediating issues prior to having flagged an item as complete.&amp;nbsp; Again, it is a decision making process as you won&amp;#39;t want to blindly make all changes suggested, but such a process prior to turning in code&amp;nbsp;will go a long way to helping overall maintainability.&lt;/p&gt;&lt;img src="http://www.crowehorwath.com/cs/aggbug.aspx?PostID=43" width="1" height="1"&gt;</description><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/performance/default.aspx">performance</category><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/code+analysis/default.aspx">code analysis</category><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/code+metrics/default.aspx">code metrics</category><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/maintainability/default.aspx">maintainability</category><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/tuning/default.aspx">tuning</category><category domain="http://www.crowehorwath.com/cs/blogs/solutions/archive/tags/architecture/default.aspx">architecture</category></item></channel></rss>