<?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>//TODO: Create Blog Title &#187; Design Flaws</title>
	<atom:link href="http://DontForgetYourTODOs.com/tag/design-flaws/feed/" rel="self" type="application/rss+xml" />
	<link>http://DontForgetYourTODOs.com</link>
	<description></description>
	<lastBuildDate>Mon, 26 Jul 2010 03:20:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Creating too Big to Fail Apps</title>
		<link>http://DontForgetYourTODOs.com/2009/04/creating-too-big-to-fail-apps/</link>
		<comments>http://DontForgetYourTODOs.com/2009/04/creating-too-big-to-fail-apps/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 08:00:05 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Design Flaws]]></category>

		<guid isPermaLink="false">http://tucholski.wordpress.com/?p=243</guid>
		<description><![CDATA[I can&#8217;t help it. I read Steve&#8217;s post too big to fail on brip blap and I immediately apply its principle to life as a developer. The focus is about breaking down &#8220;too big to fail&#8221; life events into smaller more manageable components that are less likely to wreak havoc. How is this relevant to [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t help it. I read Steve&#8217;s post <a href="http://www.bripblap.com/2009/too-big-to-fail/">too big to fail</a> on brip blap and I immediately apply its principle to life as a developer. The focus is about breaking down &#8220;too big to fail&#8221; life events into smaller more manageable components that are less likely to wreak havoc.</p>
<p><a href="http://www.flickr.com/photos/cfamighetti/813128275/"><img src="http://tucholski.files.wordpress.com/2009/03/buckling_wall1.jpg?w=275&#038;h=192" alt="Too Big to Fail" title="Too Big to Fail" width="275" height="192" class="aligncenter size-thumbnail wp-image-266" /></a></p>
<p>How is this relevant to anything in the world of software development?</p>
<h3>1. System Design</h3>
<p>When designing systems, separate components by logic functionality. Systems that are responsible for continuous database queries, should not be tied to a web site that serves content, such as in <a href="http://www.codeproject.com/KB/aspnet/ASPNETService.aspx">Simulate a Windows Service using ASP.NET</a>. While this idea may be good in theory and for any shared hosting environment when you can&#8217;t install or run services on the server, the potential that a deadlock or frozen thread occurs will increase. If that occurs, you can kiss all of your active user sessions goodbye.</p>
<h3>2. Application Design</h3>
<p>Separate application logic out so that when one component gets changed, it doesn&#8217;t force a complete rewrite. Websites and web services should not tie directly to the data layer. Design N-layer systems (read the <a href="http://davidhayden.com/blog/dave/archive/2005/07/22/2401.aspx">differences between N-Tier and N-Layer applications</a>) so that there are no direct dependencies on lower-level technologies being used.</p>
<p>Maintainability in separate components increases as the number of layers does. Take this in moderation though, too much loose-coupling in your layers, leads to <strong>overkill and needless complexity</strong>.</p>
<h3>3. Class Design</h3>
<p>When designing classes, follow the <a href="http://en.wikipedia.org/wiki/Single_responsibility_principle">Single Responsibility Principle (SRP)</a> of the <a href="http://mmiika.wordpress.com/oo-design-principles/">S.O.L.I.D Class Design Principles</a>. If your class has more than one reason to change, then it may be &#8220;too big to fail&#8221;. The below example helps:</p>
<div style="font-family:Courier New;font-size:10pt;color:black;background:white;line-height:10px;border:thin dashed black;padding:10px;">
<p style="margin:0;"><span style="color:blue;">public</span> <span style="color:blue;">class</span> Worker</p>
<p style="margin:0;">{</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">string</span> GetTaxRate() { }</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">void</span> Save() { }</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; <span style="color:blue;">public</span> <span style="color:blue;">string</span> GetId() { }</p>
<p style="margin:0;">}</p>
</div>
<p>The above breaks the SRP because any minor change required to one of the three purposes of this class causes the whole class to change:</p>
<ol>
<li>The process to calculate the tax rate of the employee</li>
<li>Database Schema that matches to the Worker</li>
<li>Employee Id that is used. SSN today, numeric number tomorrow</li>
</ol>
<p>Any single change impacts the class which is responsible for three very different purposes. While this is not &#8220;too big to fail&#8221;, the class is &#8220;too big for its own good&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://DontForgetYourTODOs.com/2009/04/creating-too-big-to-fail-apps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dealing with a Poorly Designed Application</title>
		<link>http://DontForgetYourTODOs.com/2009/01/dealing-with-a-poorly-designed-application/</link>
		<comments>http://DontForgetYourTODOs.com/2009/01/dealing-with-a-poorly-designed-application/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 02:00:16 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Design Flaws]]></category>

		<guid isPermaLink="false">http://tucholski.wordpress.com/?p=15</guid>
		<description><![CDATA[Ever get stuck dealing with a project that seemed all wrong? Here are some ideas that we should take into consideration when trying to manage all of these sticky situations that we are constantly put into.]]></description>
			<content:encoded><![CDATA[<p><em>Auto Mechanic: </em>Sir, I&#8217;ve replaced the spark plug on your car.<br />
<em>Customer (sarcastically): </em>What&#8217;s the damage?<br />
<em>Auto Mechanic: </em>$600.<br />
<em>Customer:</em> $600?!!!! How? It was just a simple fix!<br />
<em>Auto Mechanic: </em>In theory, it should have been. But the way the engine  was built and the placement of the plug made it very difficult to fix. We had to  tear half of the front end off in order to get at it.</p>
<p><img class="alignnone size-full wp-image-17" title="Unintelligent Design" src="http://tucholski.files.wordpress.com/2008/12/poor_design.jpg" alt="Unintelligent Design" width="300" height="225" /></p>
<p>I hope this never occurs to any of you, but it definitely puts the problem of  inheriting a poorly written/design application into perspective. &#8220;If only things  had been done right the first time, changing it would be so much easier&#8221;. How  many times have you heard that mantra? Hindsight is 20/20. We should focus on  how we deal with these messy situations instead of complaining about them. Here  are a couple thoughts:</p>
<p><strong>1. Relax, look around, and determine what is going on.</strong><br />
Before you go haywire on your project manager and threaten to quit the  company, put a positive spin on it. Remember you were asked to be the expert and  fix someone else&#8217;s mistake. Make sure you really determine what the problem is.  Is the problem the fact that this was written poorly, or is the problem because  you have to maintain it?</p>
<p><strong>2. Recognize what you can change.<br />
</strong>If the application  that you were asked to fix is completely abysmal, make sure that you don&#8217;t dig  yourself into a deeper hole. You obviously don&#8217;t want to work on this  application longer than necessary (unless you are a glutton for punishment). At  the same time, question why things were done the way they were. Reasons may have  been entirely political and you may have absolutely no control over design.  Don&#8217;t focus on those scenarios, focus on situations where you can help the next  developer who needs to fix this.<br />
<strong><br />
3. Make sure you know what you are  talking about</strong><strong>.</strong><br />
Ensure that this is a poorly written application  because it uses bad design methodologies, not because someone else wrote it. In  explaining the problem to your peers and other developers, avoid a negative  attitude. They are just going to see you as someone who complains, not someone  who solves problems. When solving the problem, don&#8217;t create change for the sake  of it or because you think you can do it better. The time for design has passed,  this is development. Unless you were asked to do a rewrite, do a fix.<br />
<strong><br />
4. Lose your fear.</strong><br />
If you&#8217;ve got the last point  down and you know what you are talking about, lose your fear. Dive right in.  Express what is incorrect with the application to managers and see how they  respond with it.<br />
<strong><br />
5. Get away from it.</strong><br />
I solve my  most difficult problems away from the computer. Sometimes it happens at home,  sometimes during dinner, and even in the shower. You know the deal. If it isn&#8217;t  an urgent production issue, give yourself a 24 hour mental break. Think about  something else. This answer will come to you tomorrow and you will laugh that  the solution is not as complex as you expected. <br />
<strong><br />
6. Attack it in  units</strong><strong>.</strong><br />
Don&#8217;t bulldoze the whole project. Take notice of the  systems&#8217; components and break the problems down into smaller units. Ask yourself  how you can make these pieces perform more efficient. If you can&#8217;t get any more  juice out of it, then make the code more readable and understandable. As you  further break the code down into individual methods and components you can  create unit tests to ensure that each portion is acting as intended. This will  benefit future developers so that they can easily make changes and ensure that  they aren&#8217;t breaking existing functionality.<br />
<strong><br />
7. Use this as an  opportunity to educate others!<br />
</strong>Always come away from every  experience with something you have learned. It may be something you learned not  to do, but either way you know better. I will repeat, hindsight is 20/20. Use it  as the chance to help others know better too. Find a junior level developer and  challenge them. Ask them what they think the problem is and see if they are  capable of producing a better solution.</p>
<p>I read somewhere, developers have a high tolerance for working with ugly code  (as long as they were the one who wrote it). No one wants to openly admit that  they created a code catastrophe. However, really what we should do when we write  code is not put others in harms&#8217; way like we have been. In order to do that, we  should make sure that the code we write can be broken down into as many chunks  as possible. Complex problems require simple solutions. There is always the  developer with an ego problem who tends to believe the opposite. They think that  <em>complex problems require tricky coding. </em>Sometimes those developers are so  concerned for writing a generic solution to the problem that they go above and  beyond what the requirements ask for and in the end make it more difficult to  troubleshoot or fix the problem<em>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://DontForgetYourTODOs.com/2009/01/dealing-with-a-poorly-designed-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

