<?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"
	>

<channel>
	<title>flickdotnet.de &#187; 2008 &#187; March</title>
	<atom:link href="http://www.flickdotnet.de/index.php/2008/03/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flickdotnet.de</link>
	<description>Opinions, reviews and software for the Microsoft .NET Framework - focusing on Linq, ECO &#38; XPO</description>
	<pubDate>Thu, 06 May 2010 17:59:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Refactoring &#224; la carte - JetBrains ReSharper</title>
		<link>http://www.flickdotnet.de/index.php/2008/03/refactoring-la-carte-jetbrains-resharper/</link>
		<comments>http://www.flickdotnet.de/index.php/2008/03/refactoring-la-carte-jetbrains-resharper/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 17:57:00 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">f0630277-550d-4841-b505-bcad6784f9c4:470</guid>
		<description><![CDATA[<p>Two weeks ago, at EKON, Hadi Hariri (<a href="http://www.hadihariri.com/">www.hadihariri.com</a>) introduced me to a Visual Studio plugin called "JetBrains ReSharper". I never could associate anything with the name, so he offered to give me a quick demo of the feature set.  As I am a happy customer of Castalia in the CodeGear Delphi IDE (<a href="http://www.twodesk.com/">www.twodesk.com</a>) and really appreciate the time it saves me to write code, I missed quite a</p>]]></description>
			<content:encoded><![CDATA[<p>Two weeks ago, at EKON, Hadi Hariri (<a href="http://www.hadihariri.com/">www.hadihariri.com</a>) introduced me to a Visual Studio plugin called &#8220;JetBrains ReSharper&#8221;. I never could associate anything with the name, so he offered to give me a quick demo of the feature set.&nbsp; As I am a happy customer of Castalia in the CodeGear Delphi IDE (<a href="http://www.twodesk.com/">www.twodesk.com</a>) and really appreciate the time it saves me to write code, I missed quite a lot comfort when refactoring code in VS.&nbsp;Now&nbsp;I can say &#8220;Thankfully there was Hadi &#8230;&#8221; because ReSharper is definitely the tool to get if you need to write a lot of C# or VB code. Not only does it offer the usual refactoring options like renaming, moving code, extracting methods and the likes, no, it really &#8220;digs&#8221; into your code and makes suggestions about things you could change or that would make your code better. one of those things is the &#8220;null&#8221; check. Whenever you use a variable and you have not checked for null you can tell ReSharper to&nbsp;implement the &#8220;null&#8221;-check for you. One could think that if you write this piece of code:</p>
<p><code>if (myName.Equals("..."))</code> </p>
<p>Resharper will generate simply</p>
<p><code>if (myName != null ) { if ...</code> </p>
<p>Nope, it is not that stupid. It first analyses the usage of the variable and might even create a new code level (using { }) so that not only the one line is being properly checked, but also the following lines that depend on that variable. </p>
<p>The null-check is only a very easy example. ReSharper offers extensive anaylsis features that always take your code into account and I have not had a single case that my code did not compile or the code was not yielding the same result as before the transformation. Variable types are also handled perfectly by ReSharper so that you can invoke &#8220;type-safe code completion&#8221; (my personal term). If you call a method and it expects a certain type, code completion will not only list the types, but will also complete the line for you, if there is only one variable of the matching type in the current namespace available. It is just a huge time safer when writing code!</p>
<p>However, my favourite feature so far is that the software really knows usage patterns. E.g. if you write</p>
<p><code>List&lt;Customer&gt; customerList = getCustomerList();</code> </p>
<p>And you then write</p>
<p><code>foreach</code> </p>
<p>and press &lt;Tab&gt; it guesses (!)</p>
<p><code>foreach ( Customer customer in customerList )</code> </p>
<p>It would not be so amazing if you could not &#8220;toggle&#8221; the different variable names to be used. E.g. ReSharper offers you many possible variable names if you use camel case or another known way to name your variables. One thing is sure though: if you use ReSharper you definitely have to write a huge amount less code.</p>
<p>There is a trial edition available on <a href="http://www.jetbrains.com/">www.jetbrains.com</a> . Students get a really fair bargain and there are special licenses for educational institutions available.</p>
<p><img src="http://flickdotnet.de:8080/aggbug.aspx?PostID=470" width="1" height="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flickdotnet.de/index.php/2008/03/refactoring-la-carte-jetbrains-resharper/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How complex is my code? Ask NDepend!</title>
		<link>http://www.flickdotnet.de/index.php/2008/03/how-complex-is-my-code-ask-ndepend/</link>
		<comments>http://www.flickdotnet.de/index.php/2008/03/how-complex-is-my-code-ask-ndepend/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 17:30:00 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">f0630277-550d-4841-b505-bcad6784f9c4:469</guid>
		<description><![CDATA[<p>Analysis of source code has become quite a "business" topic in the last few years. Due to that a lot of software tools have been released to help the developer to analyse the source code. In the Delphi World there is the well-known product called Code Healer by Sock Software (<a href="http://www.socksoftware.com/codehealer.php">http://www.socksoftware.com/codehealer.php</a>). However, a product called NDepend has come to my attention which offers a way to really dive into your code! </p>
<p>You can use</p>]]></description>
			<content:encoded><![CDATA[<p>Analysis of source code has become quite a &#8220;business&#8221; topic in the last few years. Due to that a lot of software tools have been&nbsp;released to help the developer to analyse&nbsp;the source&nbsp;code. In the Delphi World&nbsp;there is&nbsp;the well-known product called Code Healer by Sock Software (<a href="http://www.socksoftware.com/codehealer.php">http://www.socksoftware.com/codehealer.php</a>). However, a product called NDepend has come to my attention which offers a way to really dive into your code! </p>
<p>You can use NDepend in association with many products. There is an IDE integration for Visual Studio and Lutz Röder&#8217;s Refelctor available, for example, but you can also start a seperate GUI that allows you to select the source you want to analyse. An analysis consists of two things: For one, a huge easily navigable report in html format will be generated. Furthermore, and this came as a surprise to me, as an earlier version of NDepend did not offer this tool, the GUI has been extended so that you can query and browse the results. This is actually what makes this tool so useful. We all have heard the principle of creating &#8220;loose couplings&#8221; between separate source code groups. E.g. you should encapsulate persistence, user interface and business logic seperately. Can a tool like NDepend help me to verify that I succeeded in doing so? You might have guessed that this is a rethorical question&#8230;so&#8230;yes. </p>
<p>Thus, I do not want to list all the fancy features that NDepend offers you (you can simply look them up here: <a href="http://www.ndepend.com/Features.aspx">http://www.ndepend.com/Features.aspx</a>), instead I want to offer an example why NDepend is something I do not want to miss anymore while developing applications.</p>
<p>So, let&#8217;s get started with the example.</p>
<p>People, who attend my sessions about ECO, will always hear: ECO will take care that you get a great basis for encapsulating your code properly. Fine. But does it really? Did I do something while writing my application that defies this princriple?</p>
<p>To verify this statement, I started the NDepend Graphical User Interface (aka VisualNDepend.exe) and selected the assemblies my application consisted of. Be aware, if you analyse an application that is built upon a framework, you should include the framework assemblies as well. After selecting my assemblies, I generated a report (it&#8217;s a click of a button)&nbsp;and directed my attention to the dependency matrix. Sounds geeky and complicated,&nbsp; but it is not. Every row and column are labeled with the name of&nbsp; a namespace. The numbers in the cells designate the number of&nbsp;types, members&nbsp; etc. (you can actually select that in a combo box) used by the other namespace. So, looking at the screenshot below, we want information about the number of types used in the different namespaces.</p>
<p>&nbsp;</p>
<p><img style="WIDTH:529px;HEIGHT:495px;" height=495 src="/gfx/complexity.png" width=529/></p>
<p>Interestingly, we can clearly see that any persistence operation is only being dealt with in the Eco Space as the Eco Space embodies the Persistence Mapper and the Data Connection Components. How can we see that? Look at the namespaces Eco.Persistence and its sub-namespaces. Any type from that namespace is only used by the EcoSpace namespace, but not by the business model, which is in the namespace marked with &#8220;.Model&#8221;. Same applies to any class from the System.Data namespace, which includes all the database-related classes in .NET. On the other hand, System.Windows.Forms, which contains all the GUI classes, is&nbsp;not being used by the EcoSpace or the business model. Thus, my encapsulation is perfect in this example and NDepend made it really easy to verify. </p>
<p>As the matrix is a tree you can&nbsp; drill down in any of the namespaces and get detailed information. You can also double click on any of the numbers in order to get a graphical representation in a state-machine-like fashion that allows you to quickly get a clear view on the structurre of your code.</p>
<p>This is just one brief example how NDepend can really make your life easier. If&nbsp;I encounter another useful result that also proves my points about what I say about ECO in my sessions (*ironical grin*), I will post it here asap.</p>
<p><img src="http://flickdotnet.de:8080/aggbug.aspx?PostID=469" width="1" height="1"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flickdotnet.de/index.php/2008/03/how-complex-is-my-code-ask-ndepend/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
