<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Caught By .Net! - OODesign</title>
    <link>http://blog.stoneskins.com/</link>
    <description>Stoneskin's Notes</description>
    <language>en-us</language>
    <copyright>SunStone Solutions &amp; C LLC</copyright>
    <lastBuildDate>Thu, 04 Oct 2012 05:15:33 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.12105.0</generator>
    <managingEditor>stoneskin@gmail.com</managingEditor>
    <webMaster>stoneskin@gmail.com</webMaster>
    <item>
      <trackback:ping>http://blog.stoneskins.com/Trackback.aspx?guid=60af0a76-d026-4cbe-abf7-3af5b714ef52</trackback:ping>
      <pingback:server>http://blog.stoneskins.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.stoneskins.com/PermaLink,guid,60af0a76-d026-4cbe-abf7-3af5b714ef52.aspx</pingback:target>
      <dc:creator>stoneskin</dc:creator>
      <wfw:comment>http://blog.stoneskins.com/CommentView,guid,60af0a76-d026-4cbe-abf7-3af5b714ef52.aspx</wfw:comment>
      <wfw:commentRss>http://blog.stoneskins.com/SyndicationService.asmx/GetEntryCommentsRss?guid=60af0a76-d026-4cbe-abf7-3af5b714ef52</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Notes of read book "clean code"  by Robert C. Martin<br /><br />
SRP: Single responsibility<br />
DRY: Don't repeat yourself<br />
OCP: open close principle<br /><br />
ex: 
<br />
1. Switch break the SRP and OCP, should limit it in bottom and factory.<br />
2. Try catch should keep it small ,and no code after try catch block<br />
3. Use exception in stand of ErrorCode<br />
4. Each function should has only one return...try avoid  break, continue, never
use goto<br />
5. one parameter is better than two parameters and better than three or more<br />
6. Make sense Name and comments<br />
7. First write the code as you think, then refactor to follow the principle<br />
8. Don't return or pass null, empty list is much better<br />
9. Put Error handle code out side the main logic<br /><br />
Something in the book I don't agree is for Name convention, 
<br />
he don't like name interface with prefix 'I', and don't like put the type in classname
such as AbstractProduct or Iproduct. 
</p>
        <p>
But I think that make our life easier when we code...if you need a interface, 
With the help of Intelli come with VS or ReSharper ,you type 'I', it
will jump out, if you need a Enum...type Enum..all Enum named start with Enum will
list for you to choice.<br /></p>
        <p>
        </p>
        <img width="0" height="0" src="http://blog.stoneskins.com/aggbug.ashx?id=60af0a76-d026-4cbe-abf7-3af5b714ef52" />
      </body>
      <title>Clean Code rules</title>
      <guid isPermaLink="false">http://blog.stoneskins.com/PermaLink,guid,60af0a76-d026-4cbe-abf7-3af5b714ef52.aspx</guid>
      <link>http://blog.stoneskins.com/2012/10/04/CleanCodeRules.aspx</link>
      <pubDate>Thu, 04 Oct 2012 05:15:33 GMT</pubDate>
      <description>&lt;p&gt;
Notes of read book "clean code"&amp;nbsp; by Robert C. Martin&lt;br&gt;
&lt;br&gt;
SRP: Single responsibility&lt;br&gt;
DRY: Don't repeat yourself&lt;br&gt;
OCP: open close principle&lt;br&gt;
&lt;br&gt;
ex: 
&lt;br&gt;
1. Switch break the SRP and OCP, should limit it in bottom and factory.&lt;br&gt;
2. Try catch should keep it small ,and no code after try catch block&lt;br&gt;
3. Use exception in stand of ErrorCode&lt;br&gt;
4. Each function should has only one return...try avoid&amp;nbsp; break, continue, never
use goto&lt;br&gt;
5. one parameter is better than two parameters and better than three or more&lt;br&gt;
6. Make sense Name and comments&lt;br&gt;
7. First write the code as you think, then refactor to follow the principle&lt;br&gt;
8. Don't return or pass null, empty list is much better&lt;br&gt;
9. Put Error handle code out side the main logic&lt;br&gt;
&lt;br&gt;
Something in the book&amp;nbsp;I don't agree is for Name convention, 
&lt;br&gt;
he don't like name interface with prefix 'I', and don't like put the type in classname
such as AbstractProduct or Iproduct. 
&lt;/p&gt;
&lt;p&gt;
But I think that make our life easier when we code...if you need a interface,&amp;nbsp;
With the help of&amp;nbsp;Intelli&amp;nbsp;come with VS or ReSharper&amp;nbsp;,you type 'I', it
will jump out, if you need a Enum...type Enum..all Enum named start with Enum will
list for you to choice.&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.stoneskins.com/aggbug.ashx?id=60af0a76-d026-4cbe-abf7-3af5b714ef52" /&gt;</description>
      <comments>http://blog.stoneskins.com/CommentView,guid,60af0a76-d026-4cbe-abf7-3af5b714ef52.aspx</comments>
      <category>Agile</category>
      <category>C#</category>
      <category>OODesign</category>
    </item>
    <item>
      <trackback:ping>http://blog.stoneskins.com/Trackback.aspx?guid=c0fc9862-3e2c-4c35-bba5-b956e03b9bf1</trackback:ping>
      <pingback:server>http://blog.stoneskins.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.stoneskins.com/PermaLink,guid,c0fc9862-3e2c-4c35-bba5-b956e03b9bf1.aspx</pingback:target>
      <dc:creator>stoneskin</dc:creator>
      <wfw:comment>http://blog.stoneskins.com/CommentView,guid,c0fc9862-3e2c-4c35-bba5-b956e03b9bf1.aspx</wfw:comment>
      <wfw:commentRss>http://blog.stoneskins.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c0fc9862-3e2c-4c35-bba5-b956e03b9bf1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I have some thoughts for making better
code. I call it 3 rulers plus 2 sub rulers.<br /><br />
1 Readable : small function, single responsibility, straightforward name convention.<br />
2. Re-useable: clear and simple responsibility, DRY<br />
3. Testable : can be tested by UnitTest tools. Also I like write code that I can easily
put a break point there.<br /><br />
+<br /><br />
4. flexible :  Prepare for future change,  configurable, lower coupling.
using IoC.<br />
5. performance: improve code for better performance or user experience, Threading,
Cache, Ajax, Parallel LinQ,<br /><br /><br />
4 and 5 have lower priority than 123.   You should know why ;)<br /><p></p><img width="0" height="0" src="http://blog.stoneskins.com/aggbug.ashx?id=c0fc9862-3e2c-4c35-bba5-b956e03b9bf1" /></body>
      <title>My 3+2 rules in coding</title>
      <guid isPermaLink="false">http://blog.stoneskins.com/PermaLink,guid,c0fc9862-3e2c-4c35-bba5-b956e03b9bf1.aspx</guid>
      <link>http://blog.stoneskins.com/2012/09/16/My32RulesInCoding.aspx</link>
      <pubDate>Sun, 16 Sep 2012 06:47:36 GMT</pubDate>
      <description>I have some thoughts for making better code. I call it 3 rulers plus 2 sub rulers.&lt;br&gt;
&lt;br&gt;
1 Readable : small function, single responsibility, straightforward name convention.&lt;br&gt;
2. Re-useable: clear and simple responsibility, DRY&lt;br&gt;
3. Testable : can be tested by UnitTest tools. Also I like write code that I can easily
put a break point there.&lt;br&gt;
&lt;br&gt;
+&lt;br&gt;
&lt;br&gt;
4. flexible :&amp;nbsp; Prepare for future change,&amp;nbsp; configurable, lower coupling.
using IoC.&lt;br&gt;
5. performance: improve code for better performance or user experience, Threading,
Cache, Ajax, Parallel LinQ,&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
4 and 5 have lower priority than 123.&amp;nbsp;&amp;nbsp; You should know why ;)&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.stoneskins.com/aggbug.ashx?id=c0fc9862-3e2c-4c35-bba5-b956e03b9bf1" /&gt;</description>
      <comments>http://blog.stoneskins.com/CommentView,guid,c0fc9862-3e2c-4c35-bba5-b956e03b9bf1.aspx</comments>
      <category>C#</category>
      <category>OODesign</category>
    </item>
    <item>
      <trackback:ping>http://blog.stoneskins.com/Trackback.aspx?guid=78011257-92c9-4015-8948-f860d40111a5</trackback:ping>
      <pingback:server>http://blog.stoneskins.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.stoneskins.com/PermaLink,guid,78011257-92c9-4015-8948-f860d40111a5.aspx</pingback:target>
      <dc:creator>stoneskin</dc:creator>
      <wfw:comment>http://blog.stoneskins.com/CommentView,guid,78011257-92c9-4015-8948-f860d40111a5.aspx</wfw:comment>
      <wfw:commentRss>http://blog.stoneskins.com/SyndicationService.asmx/GetEntryCommentsRss?guid=78011257-92c9-4015-8948-f860d40111a5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://userpages.umbc.edu/~tarr/dp/lectures/OOPrinciples.pdf">http://userpages.umbc.edu/~tarr/dp/lectures/OOPrinciples.pdf</a>
        </p>
        <p>
 
</p>
        <p>
          <a href="http://c2.com/cgi/wiki?PrinciplesOfObjectOrientedDesign">http://c2.com/cgi/wiki?PrinciplesOfObjectOrientedDesign</a>
        </p>
        <img width="0" height="0" src="http://blog.stoneskins.com/aggbug.ashx?id=78011257-92c9-4015-8948-f860d40111a5" />
      </body>
      <title>O O Design Principles</title>
      <guid isPermaLink="false">http://blog.stoneskins.com/PermaLink,guid,78011257-92c9-4015-8948-f860d40111a5.aspx</guid>
      <link>http://blog.stoneskins.com/2008/04/08/OODesignPrinciples.aspx</link>
      <pubDate>Tue, 08 Apr 2008 15:53:09 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://userpages.umbc.edu/~tarr/dp/lectures/OOPrinciples.pdf"&gt;http://userpages.umbc.edu/~tarr/dp/lectures/OOPrinciples.pdf&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://c2.com/cgi/wiki?PrinciplesOfObjectOrientedDesign"&gt;http://c2.com/cgi/wiki?PrinciplesOfObjectOrientedDesign&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.stoneskins.com/aggbug.ashx?id=78011257-92c9-4015-8948-f860d40111a5" /&gt;</description>
      <comments>http://blog.stoneskins.com/CommentView,guid,78011257-92c9-4015-8948-f860d40111a5.aspx</comments>
      <category>OODesign</category>
    </item>
  </channel>
</rss>