<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Plastic/Blog</title>
	
	<link>http://blog.codiceplastico.com</link>
	<description>Code Elegance</description>
	<pubDate>Thu, 26 Jun 2008 17:36:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/emablog" type="application/rss+xml" /><item>
		<title>Little action, big revenue</title>
		<link>http://feeds.feedburner.com/~r/emablog/~3/320695908/</link>
		<comments>http://blog.codiceplastico.com/?p=144#comments</comments>
		<pubDate>Thu, 26 Jun 2008 17:36:33 +0000</pubDate>
		<dc:creator>emanuele</dc:creator>
		
		<category><![CDATA[Project Management]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=144</guid>
		<description><![CDATA[Brussel Airlines have announced that they reduce the velocity of his flies to consume less fuel. Stand to their calculus, if they increase a little bit the duration of their flight the expense to gas up the plane will be reduced by 1,1 Million of Euro per year. In addition to the money ease there [...]]]></description>
			<content:encoded><![CDATA[<p>Brussel Airlines have announced that they reduce the velocity of his flies to consume less fuel. Stand to their calculus, if they increase a little bit the duration of their flight the expense to gas up the plane will be reduced by 1,1 Million of Euro per year. In addition to the money ease there will be an ecological benefit for the reduced emission of gas.
<p>&nbsp;
<p>Last week I went to a customer that is about to release a quite big web application composed by various modules and services. I worked with them to resolve some issues and close the development cycle.
<p>The thing that let me a little bit disappointed is the way they work: they don&#8217;t have unit tests (and this sadly, in Italy, is quite normal) so to &#8220;test&#8221; the application they have to run it and navigate to the interested page.
<p>The problem is that from the moment that I press F5 it takes about 2 minutes to the moment that the Login page is available, to this adds a bunch of seconds to do the login and another bunch to arrive to&nbsp; the page that I want to test (in total about 3 minutes).
<p>Let&#8217;s do some computation:
<p>They are in the final phase of development so they do little modifications to the code and some bug fixing, so the F5 key is pressed a lot of times during the day, let&#8217;s say 50-60 times a day. So:
<p>3 minutes * 50 times = 150 minutes = 2,5h
<p><strong>This mean about 2,5 hours a day spent in doing nothing</strong>
<p>Without introducing unit tests that in this final stage will be a loss of time, what about a script that speed-up the Build&amp;Run phase? And maybe an &#8220;#ifdef debug&#8221; then don&#8217;t ask me for username and password but go directly to&nbsp; the home page? And if we take off from the main solution the projects that are not subjected to modification? And if we will do pair programming so I can avoid to press F5 if my pair see that I make a visible mistake?
<p>These are only some of little actions that helps the team to save some seconds at every debug session, that in a day will be hours!&nbsp;
<p>&nbsp;</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a6b29303-899a-40a6-bfcd-ec16ea898f77" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Project%20Management" rel="tag">Project Management</a>,<a href="http://technorati.com/tags/Agile" rel="tag">Agile</a></div>
<img src="http://feeds.feedburner.com/~r/emablog/~4/320695908" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/?feed=rss2&amp;p=144</wfw:commentRss>
		<feedburner:origLink>http://blog.codiceplastico.com/?p=144</feedburner:origLink></item>
		<item>
		<title>Windsor Castle Factory Support</title>
		<link>http://feeds.feedburner.com/~r/emablog/~3/313770146/</link>
		<comments>http://blog.codiceplastico.com/?p=143#comments</comments>
		<pubDate>Tue, 17 Jun 2008 12:41:53 +0000</pubDate>
		<dc:creator>emanuele</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[IoC]]></category>

		<category><![CDATA[Style]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=143</guid>
		<description><![CDATA[Most of us know Windsor Castle the (most?) famous IoC container. Not everybody knows that you can use Castle with some extensions (facility) useful in some circumstances.
I would like to talk about the Factory Support.
The default mode for an object registered in the configuration file to be constructed is by the new operator that calls [...]]]></description>
			<content:encoded><![CDATA[<p>Most of us know Windsor Castle the (most?) famous IoC container. Not everybody knows that you can use Castle with some extensions (facility) useful in some circumstances.</p>
<p>I would like to talk about the Factory Support.</p>
<p>The default mode for an object registered in the configuration file to be constructed is by the new operator that calls the constructor in which, if necessary, the container inject the parameters. But sometimes we need to create an object using a factory class.</p>
<p>Castle support this construction mode using the Factory Support Facility that means configure it in the right way. Suppose that you need to use Windsor container to get an instance of an NHibernate Session, that, like you know, it cannot be created using the new operator but it must be constructed using a SessionFactory class. </p>
<p>Sometimes this SessionFactory is encapsulated in a NHibernateHelper class:</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:8b1b43e1-cdb5-458f-bbbe-881cbe35ae8b" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> NHibernateHelper
{
    </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">readonly</span><span style="color: #000000;"> ISessionFactory sessionFactory;

    </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> NHibernateHelper()
    {
        Configuration cfg </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Configuration();
        cfg.Configure();
        sessionFactory </span><span style="color: #000000;">=</span><span style="color: #000000;"> cfg.BuildSessionFactory();
    }

    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> ISession GetNewSession()
    {
        </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> sessionFactory.OpenSession();
    }

    </span><span style="color: #008000;">//</span><span style="color: #008000;"> ...</span><span style="color: #008000;">
</span><span style="color: #000000;">}</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>This class has a static method GetNewSession that return a new instance of ISession. I want to use this class (and the GetNewSession method) to obtain the session using the IoC container and I want to inject this session in a repository:</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:0bee854c-9ce6-4833-b4cd-fa6121579a4a" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> UserRepository : IUserRepository
{
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> UserRepository(ISession session)
    {
        </span><span style="color: #008000;">//</span><span style="color: #008000;">...</span><span style="color: #008000;">
</span><span style="color: #000000;">    }
}</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>The only things that I need to do is to configure Castle in this way:</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:87efad49-415e-441b-a77e-1c10e0d38391" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #000000;">&lt;</span><span style="color: #000000;">castle</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
    </span><span style="color: #000000;">&lt;</span><span style="color: #000000;">facilities</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
        </span><span style="color: #000000;">&lt;</span><span style="color: #000000;">facility id</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">factorysupport</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> type</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Castle.Facilities.FactorySupport.FactorySupportFacility, Castle.Microkernel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">/&gt;</span><span style="color: #000000;">
    </span><span style="color: #000000;">&lt;/</span><span style="color: #000000;">facilities</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
    </span><span style="color: #000000;">&lt;</span><span style="color: #000000;">components</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
        </span><span style="color: #000000;">&lt;</span><span style="color: #000000;">component id</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">session</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
            type</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">NHibernate.ISession, NHibernate</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
            factoryId</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">sessionFactory</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
            factoryCreate</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">GetNewSession</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">/&gt;</span><span style="color: #000000;">

        </span><span style="color: #000000;">&lt;</span><span style="color: #000000;">component id</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">sessionFactory</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
            type</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">NHibernateHelper, CodicePlastico.Samples</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">/&gt;</span><span style="color: #000000;">

        </span><span style="color: #000000;">&lt;</span><span style="color: #000000;">component id</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">userRepository</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
            service</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">CodicePlastico.Samples.Repositories.IUserRepository, CodicePlastico.Samples</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
            type</span><span style="color: #000000;">=</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">CodicePlastico.Samples.UserRepository, CodicePlastico.Samples</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">/&gt;</span><span style="color: #000000;">
    </span><span style="color: #000000;">&lt;/</span><span style="color: #000000;">components</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
</span><span style="color: #000000;">&lt;/</span><span style="color: #000000;">castle</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">
</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>The first block (facilities) add to Windsor the necessary support to use the factory facility after that there&#8217;s the components registration:</p>
<p>The first (session) is the object that will be created using a factory, I specified the type (ISession) and the Id of the component that works as a factory (sessionFactory) and the method (factoryCreate) that should be called for the construction of ISession (GetNewSession).</p>
<p>Obviously you must register the factory class (sessionFactory component) and the IUserRepository (userRepository) using the usual syntax.</p>
<p>What happen when I request an object of type IUserRepository?</p>
<p>The container sees that the concrete type is UserRepository and see that the constructor receive an instance of ISession. Then it goes to see how to build an ISession object, and see that it needs to use the GetNewSession method of NHibernateHelper.</p>
<p>This is a quite useful technics to use when you cannot use the constructor to build an object but still want to use an IoC container.</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:bb1e7e55-325e-4bca-8caf-be2919a39e32" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Castle" rel="tag">Castle</a>,<a href="http://technorati.com/tags/Windsor%20Container" rel="tag">Windsor Container</a>,<a href="http://technorati.com/tags/IoC" rel="tag">IoC</a></div>
<img src="http://feeds.feedburner.com/~r/emablog/~4/313770146" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/?feed=rss2&amp;p=143</wfw:commentRss>
		<feedburner:origLink>http://blog.codiceplastico.com/?p=143</feedburner:origLink></item>
		<item>
		<title>Good code at a glance</title>
		<link>http://feeds.feedburner.com/~r/emablog/~3/294238675/</link>
		<comments>http://blog.codiceplastico.com/?p=133#comments</comments>
		<pubDate>Tue, 20 May 2008 11:41:23 +0000</pubDate>
		<dc:creator>emanuele</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[Style]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=133</guid>
		<description><![CDATA[I like readable code. I like well written code. I like ordered code.
Sometimes this characteristics are measurable giving just a fast look at a piece of code. Here an example: which one of this two snipped do you think is better?








 
Even if you can&#8217;t read the code (I applied a blur effect) you can see [...]]]></description>
			<content:encoded><![CDATA[<p>I like readable code. I like well written code. I like ordered code.</p>
<p>Sometimes this characteristics are measurable giving just a fast look at a piece of code. Here an example: which one of this two snipped do you think is better?</p>
<table border="0" cellspacing="0" cellpadding="2" width="100">
<tbody>
<tr>
<td width="50" valign="top"><a href="http://blog.codiceplastico.com/wp-content/uploads/2008/05/bad1.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.codiceplastico.com/wp-content/uploads/2008/05/bad-thumb1.jpg" border="0" alt="bad" width="296" height="462" /></a></td>
<td width="50" valign="top"><a href="http://blog.codiceplastico.com/wp-content/uploads/2008/05/good3.jpg"><img style="border: 0px;" src="http://blog.codiceplastico.com/wp-content/uploads/2008/05/good-thumb1.jpg" border="0" alt="good" width="296" height="462" /></a></td>
</tr>
</tbody>
</table>
<p><a href="http://blog.codiceplastico.com/wp-content/uploads/2008/05/good3.jpg"></a> </p>
<p>Even if you can&#8217;t read the code (I applied a blur effect) you can see at a glance which one seems better.</p>
<p>The first contains a lot of executable path, nested if and one long method, (it smells!). The second is more linear and well-organized.</p>
<p>The problem with the first one is that is hard to read. Consider the following image which shows the path that my eye has to do to read them:</p>
<p> </p>
<table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td width="200" valign="top"><a href="http://blog.codiceplastico.com/wp-content/uploads/2008/05/bad-lines1.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.codiceplastico.com/wp-content/uploads/2008/05/bad-lines-thumb1.jpg" border="0" alt="bad_lines" width="296" height="466" /></a></td>
<td width="200" valign="top"><a href="http://blog.codiceplastico.com/wp-content/uploads/2008/05/good-lines1.jpg"><img style="border: 0px;" src="http://blog.codiceplastico.com/wp-content/uploads/2008/05/good-lines-thumb1.jpg" border="0" alt="good_lines" width="296" height="467" /></a></td>
</tr>
</tbody>
</table>
<p> </p>
<p>To read the first one I have to continually enter in a new context (code block), this because the <a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity" target="_blank">McCabe index</a> is quite high for this method.</p>
<p>This doesn&#8217;t mean that the first piece of block is absolutely better than the second, it&#8217;s just a quick evaluation based on what the code look like (remember that readability is a quality of good code).</p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:7f0bd844-8242-493e-b80e-b662f134f45a" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Code%20Elegance">Code Elegance</a>,<a rel="tag" href="http://technorati.com/tags/McCabe">McCabe</a>,<a rel="tag" href="http://technorati.com/tags/Design">Design</a></div>
<img src="http://feeds.feedburner.com/~r/emablog/~4/294238675" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/?feed=rss2&amp;p=133</wfw:commentRss>
		<feedburner:origLink>http://blog.codiceplastico.com/?p=133</feedburner:origLink></item>
		<item>
		<title>New podcasts from the ALT.NET World</title>
		<link>http://feeds.feedburner.com/~r/emablog/~3/290294801/</link>
		<comments>http://blog.codiceplastico.com/?p=123#comments</comments>
		<pubDate>Wed, 14 May 2008 08:24:08 +0000</pubDate>
		<dc:creator>emanuele</dc:creator>
		
		<category><![CDATA[ALT.NET]]></category>

		<category><![CDATA[podcast]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=123</guid>
		<description><![CDATA[A new web site is born and it publsh podcast on ALT.NET. The first one is about Continuous improvement, you can find it here: http://altnetpodcast.com/
]]></description>
			<content:encoded><![CDATA[<p>A new web site is born and it publsh podcast on ALT.NET. The first one is about Continuous improvement, you can find it here: <a href="http://altnetpodcast.com/">http://altnetpodcast.com/</a></p>
<img src="http://feeds.feedburner.com/~r/emablog/~4/290294801" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/?feed=rss2&amp;p=123</wfw:commentRss>
		<feedburner:origLink>http://blog.codiceplastico.com/?p=123</feedburner:origLink></item>
		<item>
		<title>Second Italian ALT.NET (medium) conference</title>
		<link>http://feeds.feedburner.com/~r/emablog/~3/286316355/</link>
		<comments>http://blog.codiceplastico.com/?p=122#comments</comments>
		<pubDate>Thu, 08 May 2008 19:59:23 +0000</pubDate>
		<dc:creator>emanuele</dc:creator>
		
		<category><![CDATA[ALT.NET]]></category>

		<category><![CDATA[Conference]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=122</guid>
		<description><![CDATA[It&#8217;s official, fix the date: 14-06-2008, fix the location: Milan.
That&#8217;s the day of the second ALT.NET Conference, if you want to join us you can take a look here (sorry the page is in Italian :-&#124;).
The day is focused on developing a blog engine using the agile methodologies, the ASP.NET MVC, IoC and all the [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s official, fix the date: 14-06-2008, fix the location: Milan.</p>
<p>That&#8217;s the day of the second ALT.NET Conference, if you want to join us you can take a look <a href="http://www.facebook.com/event.php?eid=13361168300">here </a>(sorry the page is in Italian :-|).</p>
<p>The day is focused on developing a blog engine using the agile methodologies, the ASP.NET MVC, IoC and all the others things that we like.</p>
<p>During this days, we are planning to write some stories that we will implement at the conf, so you can help us if you want on the mailing list of italian ALT.NET movement (<a href="http://tech.groups.yahoo.com/group/ugialtnet/?yguid=328066325">here</a>).</p>
<img src="http://feeds.feedburner.com/~r/emablog/~4/286316355" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/?feed=rss2&amp;p=122</wfw:commentRss>
		<feedburner:origLink>http://blog.codiceplastico.com/?p=122</feedburner:origLink></item>
		<item>
		<title>New italian blogger</title>
		<link>http://feeds.feedburner.com/~r/emablog/~3/280879032/</link>
		<comments>http://blog.codiceplastico.com/?p=120#comments</comments>
		<pubDate>Wed, 30 Apr 2008 16:07:46 +0000</pubDate>
		<dc:creator>emanuele</dc:creator>
		
		<category><![CDATA[TDD]]></category>

		<category><![CDATA[blogs]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=120</guid>
		<description><![CDATA[Claudio has joined the blogosphere opening a new blog here:
http://testdrivendevelopment.wordpress.com/
The name speak for himself.
]]></description>
			<content:encoded><![CDATA[<p>Claudio has joined the blogosphere opening a new blog here:</p>
<p><a href="http://testdrivendevelopment.wordpress.com/">http://testdrivendevelopment.wordpress.com/</a></p>
<p>The name speak for himself.</p>
<img src="http://feeds.feedburner.com/~r/emablog/~4/280879032" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/?feed=rss2&amp;p=120</wfw:commentRss>
		<feedburner:origLink>http://blog.codiceplastico.com/?p=120</feedburner:origLink></item>
		<item>
		<title>My Geek Code</title>
		<link>http://feeds.feedburner.com/~r/emablog/~3/275980404/</link>
		<comments>http://blog.codiceplastico.com/?p=119#comments</comments>
		<pubDate>Wed, 23 Apr 2008 07:30:29 +0000</pubDate>
		<dc:creator>emanuele</dc:creator>
		
		<category><![CDATA[ALT.NET]]></category>

		<category><![CDATA[GeekCode]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=119</guid>
		<description><![CDATA[IOC(SM):IOC(CW):MOC(RM):TDD(NU):TDD(Mb):SCC(Svn):SCC(TFS):ORM(NH):ORM(L2S):XPP(-):XPP(++):DDD(T+):DDD(B+):DDD(+):JSL(Jq):JSL(MS):CIS(CC):CIS(TC):GoF(++)
]]></description>
			<content:encoded><![CDATA[<div class="altnetgeekcode"><a href="http://www.hanselman.com/altnetgeekcode/default.aspx?q=IOC(SM):IOC(CW):MOC(RM):TDD(NU):TDD(Mb):SCC(Svn):SCC(TFS):ORM(NH):ORM(L2S):XPP(-):XPP(++):DDD(T+):DDD(B+):DDD(+):JSL(Jq):JSL(MS):CIS(CC):CIS(TC):GoF(++)">IOC(SM):IOC(CW):MOC(RM):TDD(NU):TDD(Mb):SCC(Svn):SCC(TFS):ORM(NH):ORM(L2S):XPP(-):XPP(++):DDD(T+):DDD(B+):DDD(+):JSL(Jq):JSL(MS):CIS(CC):CIS(TC):GoF(++)</a></div>
<img src="http://feeds.feedburner.com/~r/emablog/~4/275980404" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/?feed=rss2&amp;p=119</wfw:commentRss>
		<feedburner:origLink>http://blog.codiceplastico.com/?p=119</feedburner:origLink></item>
		<item>
		<title>Addicted to Resharper</title>
		<link>http://feeds.feedburner.com/~r/emablog/~3/267737381/</link>
		<comments>http://blog.codiceplastico.com/?p=118#comments</comments>
		<pubDate>Thu, 10 Apr 2008 14:09:48 +0000</pubDate>
		<dc:creator>emanuele</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Resharper]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=118</guid>
		<description><![CDATA[You know that you are addicted to Resharper when while writing a document with MS Word you press ALT-Enter to correct a grammar error!
]]></description>
			<content:encoded><![CDATA[<p>You know that you are addicted to <a title="R#" href="http://www.jetbrains.com/resharper/" target="_blank"><span><span>Resharper</span></span></a> when while writing a document with <a title="Word" href="http://office.microsoft.com/word/default.aspx">MS Word </a>you press ALT-Enter to correct a grammar error!</p>
<img src="http://feeds.feedburner.com/~r/emablog/~4/267737381" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/?feed=rss2&amp;p=118</wfw:commentRss>
		<feedburner:origLink>http://blog.codiceplastico.com/?p=118</feedburner:origLink></item>
		<item>
		<title>Stored Procedure or not?</title>
		<link>http://feeds.feedburner.com/~r/emablog/~3/265850297/</link>
		<comments>http://blog.codiceplastico.com/?p=117#comments</comments>
		<pubDate>Mon, 07 Apr 2008 19:28:15 +0000</pubDate>
		<dc:creator>emanuele</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[Stored Procedure]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=117</guid>
		<description><![CDATA[In these days I&#8217;m having a discussion with some DBAs about the pros&#38;cons on using stored procedure to access the database.
I don&#8217;t like stored procedure for various reasons. The main one it tight to code maintainability. If you begin with one SP you end up you application with thousand of SPs that extract data from [...]]]></description>
			<content:encoded><![CDATA[<p>In these days I&#8217;m having a discussion with some DBAs about the pros&amp;cons on using stored procedure to access the database.</p>
<p>I don&#8217;t like stored procedure for various reasons. The main one it tight to code maintainability. If you begin with one SP you end up you application with thousand of SPs that extract data from database in multiple forms (the customers ordered by name, the customers filtered by country, filtered by company, filtered by whatever).</p>
<p>What happen when I need to add a new field to the customer table? A mess!</p>
<p>Another reason is about business logic location. In my opinion the user request &quot;I want to view all the customers filtered by Country&quot; is a business rule, and as a business rule I want to code that in the business layer of my application. So I don&#8217;t want to code that in T-SQL but I want to code that in a high level, object oriented, strongly typed, debuggable, testable, manageable, readable language: C#, Java,&#8230;</p>
<p>One of the arguments that DBA take in favor of SP is performance. Apart that I&#8217;m not so sure that the SP give more performance (read <a href="http://weblogs.asp.net/fbouma/archive/2003/11/18/38178.aspx" target="_blank">here</a>), are performance always the most important thing?</p>
<p>I agree if we talk of reporting applications, or application that have a HUGE database that has to be responsive in milliseconds (automation industry for example), but most of the application are used by humans that count in seconds, not milliseconds. So performance in not a real issue, you can get the same with ORM (if it&#8217;s rightly tuned).</p>
<p>Maybe the solution will came when the database vendors fill the gap between application world and database world making database more abstract from the physical representation of data. </p>
<p><strong>I want to think in objects not in bytes. Instead the DBA still today has to think in bytes!</strong></p>
<p>I talk some months ago about T-SQL like an assembly language for database, you can read it <a title="SQL is the new Assembly?" href="http://blog.codiceplastico.com/?p=70" target="_blank">here</a>.</p>
<p>&#160;</p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:19a5058e-4a2f-40b6-8165-8efd436f0006" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Stored%20Procedure" rel="tag">Stored Procedure</a>,<a href="http://technorati.com/tags/Design" rel="tag">Design</a>,<a href="http://technorati.com/tags/Coding" rel="tag">Coding</a></div>
<img src="http://feeds.feedburner.com/~r/emablog/~4/265850297" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/?feed=rss2&amp;p=117</wfw:commentRss>
		<feedburner:origLink>http://blog.codiceplastico.com/?p=117</feedburner:origLink></item>
		<item>
		<title>The enviromentalist code: Reduce, Reuse, Recycle</title>
		<link>http://feeds.feedburner.com/~r/emablog/~3/262611569/</link>
		<comments>http://blog.codiceplastico.com/?p=116#comments</comments>
		<pubDate>Wed, 02 Apr 2008 07:21:16 +0000</pubDate>
		<dc:creator>emanuele</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[Style]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=116</guid>
		<description><![CDATA[The famous three R of the Reduce Reuse Recycle motto are very much used in the enviroment field, but they can also be applied to the programming world.
A good programmer takes care of the ecology of his own application, since the code of the application is the enviroment where he spends a lot of his [...]]]></description>
			<content:encoded><![CDATA[<p>The famous three <span style="color: #99cc00;"><strong>R</strong></span> of the <span style="color: #99cc00;"><strong>Reduce Reuse Recycle</strong></span> motto are very much used in the enviroment field, but they can also be applied to the programming world.<br />
A good programmer takes care of the ecology of his own application, since the code of the application is the enviroment where he spends a lot of his working time. If the application is developed respecting the enviroment where it runs, it is surely an advantage for the whole virtual ecosystem.</p>
<p><span style="color: #99cc00;"><strong>Reduce:</strong></span> reducing the code. It seems strange, but it is often more difficult cancelling some code than adding some new one. Adding too much code is often due to overengineering, by implementing functions that are not stricly necessay, and that do not give an additional value to the final customer. It just contribute to pollute the application, making it difficult to maintain. Therefore reduce the code dimension brings to remarkable results: simplification of codebase, ease of maintainance, and in general an improvement of performance.</p>
<p><span style="color: #99cc00;"><strong>Reuse:</strong></span> do not invent the WHEEL every time. Writing classes that can be used again or using library of third parts that already do the requested task, is a good habit. Using a class, that was already writtne, brings advantages boths in terms of realization time than in terms of debugging time (hoping that the class you are reusing is bug free&#8230;)</p>
<p><span style="color: #99cc00;"><strong>Recycle:</strong></span> it may sometime happen that a class could be reused, but it is not exactly as we need. So, sometimes by using CTRL-C, CTRL-V you just introduce duplications and polluted code. If you do some refactoring you could reuse a part of the code already written adapting it to the new application. Also in this case the advantages are a lot: the quantity of the code we are adding is lower, we avoid to create classes that are too alike (or even identical) and of course we spare time and we do not pollute.</p>
<p>I like this idea of the enviromentalist code, as in general all the enviromentalist attitude.</p>
<p>What do you think about it? Do you feel code enviromentalist?</p>
<img src="http://feeds.feedburner.com/~r/emablog/~4/262611569" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/?feed=rss2&amp;p=116</wfw:commentRss>
		<feedburner:origLink>http://blog.codiceplastico.com/?p=116</feedburner:origLink></item>
	</channel>
</rss>
