<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Object Mentor Blog: Tag SRP</title>
    <link>http://blog.objectmentor.com/articles/tag/srp</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Parts 5 and 6 of the 4-part series</title>
      <description>&lt;p&gt;The title says it all. I was bothered by a few things in the Shunting Yard Algorithm (actually many more things), but I felt compelled to fix two of those things.&lt;/p&gt;


So if you have a &lt;a href="http://vimeo.com/album/210446"&gt;look at the album&lt;/a&gt;, you&amp;#8217;ll notice 2 more videos:
	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://vimeo.com/10979675"&gt;Video 5 of 4&lt;/a&gt;: Remove the need for spaces between tokens.&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10994492"&gt;Video 6 of 4&lt;/a&gt;: Remove duplication of operators in algorithm and tokenizer.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Hope these are interesting or at least entertaining.&lt;/p&gt;</description>
      <pubDate>Fri, 16 Apr 2010 20:57:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e2b52b26-ffe1-4953-8749-9f6987cb224a</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/04/16/parts-5-and-6-of-the-4-part-series</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>c</category>
      <category>TDD</category>
      <category>visual</category>
      <category>studio</category>
      <category>resharper</category>
      <category>shunting</category>
      <category>yard</category>
      <category>algorithm</category>
      <category>dry</category>
      <category>SRP</category>
      <category>don</category>
      <category>t</category>
      <category>repeat</category>
      <category>yourself</category>
      <category>single</category>
      <category>responsibility</category>
      <category>Principle</category>
      <category>refactoring</category>
    </item>
    <item>
      <title>Some Rough Draft TDD Demonstration Videos</title>
      <description>&lt;p&gt;I&amp;#8217;m doing a series of videos on &lt;span class="caps"&gt;TDD&lt;/span&gt;. The ultimate result will be a much more polished version with embedded slides, and such. But as a part of the development process, I&amp;#8217;m creating scratch videos.&lt;/p&gt;


	&lt;p&gt;Much of what you see in these videos will be in the final versions, but those are far in the future relative to this work.&lt;/p&gt;


	&lt;p&gt;Hope you find them interesting.&lt;/p&gt;


	&lt;p&gt;Comments welcome.&lt;/p&gt;


Here is what is already available:
	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://vimeo.com/10569751"&gt;Getting started&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://vimeo.com/10570537"&gt;Adding Operators&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


Next up:
	&lt;ul&gt;
	&lt;li&gt;Removing violation of Open/Closed principle&lt;/li&gt;
		&lt;li&gt;Removing duplication in operations with a combination of the Strategy pattern and the Template Method pattern&lt;/li&gt;
		&lt;li&gt;Adding new operators after the removal of duplication.&lt;/li&gt;
		&lt;li&gt;Reducing coupling by using the Abstract Factory pattern, Dependency Inversion and Dependency Injection&lt;/li&gt;
		&lt;li&gt;Adding a few more operations&lt;/li&gt;
		&lt;li&gt;Allowing the creation of complex &amp;#8220;programs&amp;#8221; or &amp;#8220;macros&amp;#8221; by using the Composite pattern &amp;#8211; and avoiding Liskov Substitution Principle inherent in the GoF version of the pattern&lt;/li&gt;
		&lt;li&gt;Driving the calculator via FitNesse + Slim&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Anyway, that&amp;#8217;s the plan. I&amp;#8217;ll try to add each of these videos over the next few weeks.&lt;/p&gt;</description>
      <pubDate>Tue, 30 Mar 2010 21:01:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:f9144f21-6bbf-4e5d-b525-9e526c000fe8</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2010/03/30/some-rough-draft-tdd-demonstration-videos</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>TDD</category>
      <category>bdd</category>
      <category>video</category>
      <category>demonstration</category>
      <category>design</category>
      <category>patterns</category>
      <category>SRP</category>
      <category>LSP</category>
      <category>OCP</category>
      <category>DIP</category>
    </item>
    <item>
      <title>Improving Testability of GUI Code, an Eample</title>
      <description>&lt;p&gt;Just finished first draft. More to come, questions/comments appreciated.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://schuchert.wikispaces.com/tdd.Refactoring.UiExample"&gt;http://schuchert.wikispaces.com/tdd.Refactoring.UiExample&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 10 Sep 2009 23:08:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:02584823-cab7-4003-8a06-87e6767455fb</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2009/09/10/improving-testability-of-gui-code-an-eample</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>test</category>
      <category>gui</category>
      <category>SRP</category>
      <category>welc</category>
      <category>refactoring</category>
      <category>legacy</category>
    </item>
    <item>
      <title>Are &amp;quot;else&amp;quot; blocks the root of all evil?</title>
      <description>&lt;p&gt;So, I&amp;#8217;m pair programming C++ code with a client today and he makes an observation that makes me pause.&lt;/p&gt;


	&lt;p&gt;&lt;i&gt;The well-structured, open-source code I&amp;#8217;ve looked at typically has very few &lt;code&gt;else&lt;/code&gt; blocks. You might see a conditional test with a return statement if the conditional evaluates to true, but not many &lt;code&gt;if/else&lt;/code&gt; blocks. 
&lt;/i&gt;&lt;/p&gt;


	&lt;p&gt;(I&amp;#8217;m quoting from memory&amp;#8230;) Now, this may seem crazy at first, but one of the principles we teach at Object Mentor is the &lt;a href="http://www.objectmentor.com/resources/articles/srp.pdf"&gt;Single Responsibility Principle&lt;/a&gt;, which states that a class should have only one reason to change. This principle also applies to methods. More loosely defined, a class or method should do only one thing.&lt;/p&gt;


	&lt;p&gt;So, if a method has an if/else block, is it doing two (or more) things and therefore violating the &lt;span class="caps"&gt;SRP&lt;/span&gt;?&lt;/p&gt;


	&lt;p&gt;Okay, so this is a bit too restrictive (and the title was a bit of an attention grabber&amp;#8230; ;). We&amp;#8217;re not talking about something &lt;i&gt;really&lt;/i&gt; evil, like &lt;a href="http://www.cookcomputing.com/blog/archives/000084.html"&gt;premature optimization&lt;/a&gt;, after all!&lt;/p&gt;


	&lt;p&gt;However, look at your own &lt;code&gt;if/else&lt;/code&gt; blocks and ask yourself if maybe your code would express its intent better if you refactored it to eliminate some of those &lt;code&gt;else&lt;/code&gt; blocks.&lt;/p&gt;


	&lt;p&gt;So, is there something to this idea?&lt;/p&gt;</description>
      <pubDate>Tue, 05 Jun 2007 14:42:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:ed9210a9-bfd3-4fec-b086-29ba4e1e9b77</guid>
      <author>Dean Wampler</author>
      <link>http://blog.objectmentor.com/articles/2007/06/05/are-else-blocks-the-root-of-all-evil</link>
      <category>Dean's Deprecations</category>
      <category>Design Principles</category>
      <category>design</category>
      <category>SRP</category>
      <category>else</category>
      <category>blocks</category>
    </item>
  </channel>
</rss>

