<?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>Pathfinder Software &#187; Karega Scott</title>
	<atom:link href="http://pathfindersoftware.com/author/karega-scott/feed/" rel="self" type="application/rss+xml" />
	<link>http://pathfindersoftware.com</link>
	<description>The Fastest Way to Launch Successful Software</description>
	<lastBuildDate>Thu, 19 Jan 2012 16:31:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>UI Views &#8211; Include or Exclude from Code Coverage</title>
		<link>http://pathfindersoftware.com/2009/08/ui-views-include-exclude-code-coverage/</link>
		<comments>http://pathfindersoftware.com/2009/08/ui-views-include-exclude-code-coverage/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 20:06:11 +0000</pubDate>
		<dc:creator>Karega Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Pure MVC]]></category>
		<category><![CDATA[PureMVC]]></category>
		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=3534</guid>
		<description><![CDATA[My post today comes after watching the code coverage hover just over 70%, constantly asking myself is it possible to get 100% coverage and a discuss with a few internal colleagues on the subject. Interesting to know is if I exclude the views from code coverage,  I hit a high of just over 90%.  So, ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F08%2Fui-views-include-exclude-code-coverage%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F08%2Fui-views-include-exclude-code-coverage%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>My post today comes after watching the code coverage hover just over 70%, constantly asking myself is it possible to get</p>
<div style="float:right;padding:10px;"><img class="alignright" title="NCover Code Coverage" src="http://pathfindersoftware.com/wp-content/uploads/build_server_introduction_1.png" alt="" width="260" height="221" /></div>
<p>100% coverage and a discuss with a few internal colleagues on the subject. Interesting to know is if I exclude the views from code coverage,  I hit a high of just over 90%.  So, is not testing your UI the end of the world? Not at all, as long as you use good development practices and aim to make your UI as slim as possible, without any  business processing, branching or conditional type logic.</p>
<p>I&#8217;ve been very pleased with using the PureMVC framework on my current project, and haven&#8217;t running into any Ah! Ha! I gotcha scenarios yet and frankly can&#8217;t envision any as we continue to add new features to this application.  In fact using PureMVC has helped me think more about testability of our code and its single messaging bus has been just what the doctor ordered in terms of eliminating Publishing/Subscribing to events between the various components of the system, namely Mediators, Proxies and Commands.  But with great power comes great responsibility.</p>
<p>One could easily access the Singleton Facade of the PureMVC framework directly from your view and send a system wide message to any component interested in that message. The problem here is testability of the UI event required to trigger that system notification.</p>
<p>For instance in the code snippet below you would have to create an instance of the UpgradeView and simulate a click of the download button in order to test sending this notification.<br />
<span id="more-3534"></span><br />
public parital class UpgradView :Form, IUpgradeView<br />
{<br />
&#8230;</p>
<p>private void DownloadButton_Click(object sender, EventArgs e)<br />
{<br />
Facade.SendNotificaiton(&#8220;DownloadUpgrade&#8221;);<br />
}<br />
}</p>
<p>A better approach here is to allow your view to publish events that its mediator can subscribe to. This way you could add more logic before/after sending the notification and makes your code more testable.</p>
<p>public parital class UpgradView :Form, IUpgradeView<br />
{<br />
&#8230;</p>
<p>public event EventHandler OnDownLoad;</p>
<p>private void DownloadButton_Click(object sender, EventArgs e)<br />
{<br />
if(OnDownload != null)<br />
OnDownload(this, e);<br />
}<br />
}</p>
<p>public class UpgradMediator : Mediator<br />
{</p>
<p>public UpgradeMediator(IUpgradeView view)<br />
{<br />
view.OnDownload += Download;<br />
}</p>
<p>private void Download(object sender, EventArgs e)<br />
{<br />
// Add more logic here,<br />
Facade.SendNotificaiton(&#8220;DownloadUpgrade&#8221;);<br />
}<br />
}</p>
<p>[TestFixture]<br />
public class UpgradMediatorTest()<br />
{<br />
&#8230;</p>
<p>public void HandleNotification(INotification notification)<br />
{<br />
switch (notification.Name)<br />
{<br />
case Notification.DownloadNewVersion:<br />
Assert.IsNull(notification.Body);<br />
break;<br />
default:<br />
Assert.Fail();<br />
break;<br />
}<br />
}</p>
<p>[Test]<br />
public void DownloadUpgradeTest()<br />
{<br />
upgradeView.BackToRecord();<br />
upgradeView.Expect(x =&gt; x.CloseView()).Repeat.Once();<br />
upgradeView.OnDownloadUpgrade += null;</p>
<p>IEventRaiser eventRaiser = LastCall.IgnoreArguments().GetEventRaiser();<br />
upgradeView.Replay();</p>
<p>UpgradeMediator mediator = new UpgradeMediator(upgradeView);<br />
eventRaiser.Raise(this, EventArgs.Empty);</p>
<p>upgradeView.VerifyAllExpectations();<br />
}</p>
<p>}</p>
<p>So its it possible to get 100% coverage or is 100% just some pie in the sky that we aim for. Frankly, 90%+ code coverage aint bad, especially when my views are lean mean fighting machines.  Ok one last thing I&#8217;m sure your wondering  is why not 100%  coverage now that the views are excluded. Well, smarty pants, I can&#8217;t test external third party APIs code that we include, nor do I want to.</p>
<p>Related Services:  <a href="http://www.pathf.com/services/technology-expertise/.net-development/">.Net Application Development</a>,<br />
 <a href="http://www.pathf.com/services">Custom Software Development</a>
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F08%2Fui-views-include-exclude-code-coverage%2F&amp;linkname=UI%20Views%20%26%238211%3B%20Include%20or%20Exclude%20from%20Code%20Coverage" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F08%2Fui-views-include-exclude-code-coverage%2F&amp;linkname=UI%20Views%20%26%238211%3B%20Include%20or%20Exclude%20from%20Code%20Coverage" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F08%2Fui-views-include-exclude-code-coverage%2F&amp;linkname=UI%20Views%20%26%238211%3B%20Include%20or%20Exclude%20from%20Code%20Coverage" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F08%2Fui-views-include-exclude-code-coverage%2F&amp;linkname=UI%20Views%20%26%238211%3B%20Include%20or%20Exclude%20from%20Code%20Coverage" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F08%2Fui-views-include-exclude-code-coverage%2F&amp;linkname=UI%20Views%20%26%238211%3B%20Include%20or%20Exclude%20from%20Code%20Coverage" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F08%2Fui-views-include-exclude-code-coverage%2F&amp;linkname=UI%20Views%20%26%238211%3B%20Include%20or%20Exclude%20from%20Code%20Coverage" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F08%2Fui-views-include-exclude-code-coverage%2F&amp;linkname=UI%20Views%20%26%238211%3B%20Include%20or%20Exclude%20from%20Code%20Coverage" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F08%2Fui-views-include-exclude-code-coverage%2F&amp;title=UI%20Views%20%26%238211%3B%20Include%20or%20Exclude%20from%20Code%20Coverage" id="wpa2a_2">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2009/08/ui-views-include-exclude-code-coverage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WinForms Development Made Simple with PureMVC</title>
		<link>http://pathfindersoftware.com/2009/07/winforms-development-made-simple-with-puremvc/</link>
		<comments>http://pathfindersoftware.com/2009/07/winforms-development-made-simple-with-puremvc/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 15:09:14 +0000</pubDate>
		<dc:creator>Karega Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Pure MVC]]></category>
		<category><![CDATA[PureMVC]]></category>
		<category><![CDATA[WinForms]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=3288</guid>
		<description><![CDATA[PureMVC is open source framework that allows creation of application using Model, View and Controller pattern, and was original designed for Flex, Air and Flash application. It has since been port to various languages include the .NET C# language. So when I first heard about it, several months ago, I was working on a pretty ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwinforms-development-made-simple-with-puremvc%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwinforms-development-made-simple-with-puremvc%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>PureMVC is open source framework that allows creation of application using Model, View and Controller pattern, and was original designed for Flex, Air and Flash application. It has since been port to various languages include the .NET C# language. So when I first heard about it, several months ago, I was working on a pretty large WinForm application design around the MVP &#8211; Model, View and Presenter pattern.</p>
<p>Our presenters were responsible for handling the user interaction coming from the views by subscribing to events published by the views, and coordinating these actions with changes needs from the models such that these changes are then reflected back in the views themselves.</p>
<p>Although this approached work, it requires a lot of wiring and unwiring of events from the various presenters to views, presenters to model, and presenters to presenters. So the code quickly begins to look like the following:</p>
<p style="margin: 0in 0in 0pt;">
<p style="margin: 0in 0in 0pt;">
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public class presenter1 </span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span>public event EventHandler&lt;EventArgs&gt; SomethingHappened;</span></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public presenter1()</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span><span style="mso-tab-count: 1;"> </span>_model = new Model();</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;">_model.StateChanged += OnModelChange;</span></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span><span style="mso-tab-count: 1;"> </span>_model.DocumentSaved += OnModelSaved;</span></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span><span style="mso-tab-count: 1;"> </span>_view = new View();</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;">_view.OnMouseDown += OnMouseDown;</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;">_view.OnMouseUp += OnMouseUp;</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;">_view.OnMouseMove += OnMouseMove;</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;">_view.OnMouseEnter += OnMouseEnter;</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;">}<span style="mso-tab-count: 1;"> </span></span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">…</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">…</span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p>As you can see, for every user interaction on the view or model change a particular presenter is interested in, you must subscribe to an event, and if other presenters are interested in particular actions from views they are not responsible for, well, I’m sure you can get the picture. So act II, introduction of PureMVC framework for WinForms.</p>
<p>So exploring the capabilities of PureMVC framework, uncovered a simplification of our code. At its core, it consists of four singleton objects Model, View, Controller and Façade. The Model, View and Controller contain literal string references to Proxies which are data model, Mediators which provide and manage the user interface, and Commands which interact with the Proxies and Mediators or other commands.</p>
<p>But the simplification revolves around the Façade which is responsible to provide messaging throughout the core framework using an Observer notification scheme. So now our code quickly begins to look like the following:</p>
<p style="margin: 0in 0in 0pt;">
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public class presenter1 : Mediator </span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public presenter1()</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;">{</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;">}<span style="mso-tab-count: 1;"> </span></span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public override void ListNotificationOfInterest()</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-family: Times New Roman; font-size: small;">return new List&lt;string&gt; { Nofication.ViewMouseClick, Notification.ModelChange,};</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">}</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public override void HandleNofication(INofication notification)</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-family: Times New Roman; font-size: small;">switch(nofication.Name)</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span>case Notification.ViewMouseClick: </span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 2;"> </span>Dosomething();</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span><span style="mso-tab-count: 1;"> </span>break;</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-family: Times New Roman; font-size: small;">}</span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span>}</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">…</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">…</span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public class presenter2 : Mediator </span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public presenter2()</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;">{</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;">}<span style="mso-tab-count: 1;"> </span></span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public override void ListNotificationOfInterest()</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-family: Times New Roman; font-size: small;">return new List&lt;string&gt; { Nofication.ViewMouseClick,};</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">}</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public override void HandleNofication(INofication notification)</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-family: Times New Roman; font-size: small;">switch(nofication.Name)</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span>case Notification.ViewMouseClick: </span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 2;"> </span>DoSomethingFun();</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span><span style="mso-tab-count: 1;"> </span>break;</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt 0.5in;"><span style="font-family: Times New Roman; font-size: small;">}</span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span>}</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">…</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">…</span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">public partial class view1 : Page</span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span>…</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">…</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">protected void view_mouseclicked(object sender, MouseEventArgs e)</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">{</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-size: small;"><span style="font-family: Times New Roman;"><span style="mso-tab-count: 1;"> </span>Façade.NotifyObserver(new PureMVC.Pattern.Notification(Notification.Name));</span></span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">}</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">…</span></p>
<p style="text-indent: 0.5in; margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;">…</span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-family: Times New Roman; font-size: small;"> </span></p>
<p>Both presenter1 and presenter2 state they are interested in Notication.MouseClick event, and view1 uses the Façade to notify both presenters that the user has clicked the mouse button. No need to publish and subscribe to any events outside what’s naturally needed in the view.</p>
<p>The only thing I dislike is the name references, but as long as we are using constants you should be fine.</p>
<p>Related Services:  <a href="http://www.pathf.com/services/technology-expertise/.net-development/">.Net Application Development</a>, <a href="http://www.pathf.com/services">Custom Software Development</a>
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwinforms-development-made-simple-with-puremvc%2F&amp;linkname=WinForms%20Development%20Made%20Simple%20with%20PureMVC" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwinforms-development-made-simple-with-puremvc%2F&amp;linkname=WinForms%20Development%20Made%20Simple%20with%20PureMVC" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwinforms-development-made-simple-with-puremvc%2F&amp;linkname=WinForms%20Development%20Made%20Simple%20with%20PureMVC" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwinforms-development-made-simple-with-puremvc%2F&amp;linkname=WinForms%20Development%20Made%20Simple%20with%20PureMVC" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwinforms-development-made-simple-with-puremvc%2F&amp;linkname=WinForms%20Development%20Made%20Simple%20with%20PureMVC" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwinforms-development-made-simple-with-puremvc%2F&amp;linkname=WinForms%20Development%20Made%20Simple%20with%20PureMVC" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwinforms-development-made-simple-with-puremvc%2F&amp;linkname=WinForms%20Development%20Made%20Simple%20with%20PureMVC" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F07%2Fwinforms-development-made-simple-with-puremvc%2F&amp;title=WinForms%20Development%20Made%20Simple%20with%20PureMVC" id="wpa2a_4">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2009/07/winforms-development-made-simple-with-puremvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Migration Tools for .NET</title>
		<link>http://pathfindersoftware.com/2009/05/database-migration-tools-for-net/</link>
		<comments>http://pathfindersoftware.com/2009/05/database-migration-tools-for-net/#comments</comments>
		<pubDate>Tue, 19 May 2009 13:48:27 +0000</pubDate>
		<dc:creator>Karega Scott</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2475</guid>
		<description><![CDATA[For the past several months, I was working on a Windows desktop application that didn&#8217;t require any connection to a database, and now that this project is coming to an end and my next assignment is Web application with database connection. I wanted to see what my options are for database migration tools. In the ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F05%2Fdatabase-migration-tools-for-net%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F05%2Fdatabase-migration-tools-for-net%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>For the past several months, I was working on a Windows desktop application that didn&#8217;t require any connection to a database, and now that this project is coming to an end and my next assignment is Web application with database connection. I wanted to see what my options are for database migration tools. In the past I&#8217;ve used dbsetup.vbs script, created by Alek Davis, and although it worked it did require some modification to the underline script. So I&#8217;m currently looking at several alternatives that could serve as a suitable replacement.</p>
<p>RikMigrations<br />
Migrator.NET<br />
Subsonic Migrations<br />
dbDeploy.NET</p>
<p>Here are some useful links I&#8217;ve found to help determine which toy, I mean, tool, I plan to use next.</p>
<p>http://www.infoq.com/news/2009/01/migrations_dotnet</p>
<p>http://flux88.com/blog/net-database-migration-tool-roundup/</p>
<p>http://alekdavis.blogspot.com/2008/07/database-installer-revised.html</p>
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F05%2Fdatabase-migration-tools-for-net%2F&amp;linkname=Database%20Migration%20Tools%20for%20.NET" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F05%2Fdatabase-migration-tools-for-net%2F&amp;linkname=Database%20Migration%20Tools%20for%20.NET" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F05%2Fdatabase-migration-tools-for-net%2F&amp;linkname=Database%20Migration%20Tools%20for%20.NET" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F05%2Fdatabase-migration-tools-for-net%2F&amp;linkname=Database%20Migration%20Tools%20for%20.NET" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F05%2Fdatabase-migration-tools-for-net%2F&amp;linkname=Database%20Migration%20Tools%20for%20.NET" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F05%2Fdatabase-migration-tools-for-net%2F&amp;linkname=Database%20Migration%20Tools%20for%20.NET" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F05%2Fdatabase-migration-tools-for-net%2F&amp;linkname=Database%20Migration%20Tools%20for%20.NET" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F05%2Fdatabase-migration-tools-for-net%2F&amp;title=Database%20Migration%20Tools%20for%20.NET" id="wpa2a_6">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2009/05/database-migration-tools-for-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Before your Code Mildews &#8212; Refactor!</title>
		<link>http://pathfindersoftware.com/2009/04/before-your-code-mildews-refactor/</link>
		<comments>http://pathfindersoftware.com/2009/04/before-your-code-mildews-refactor/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 14:52:29 +0000</pubDate>
		<dc:creator>Karega Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[Refactor]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1812</guid>
		<description><![CDATA[photo credit: erix! In my last post, See the Code, Be the Code, I compared agile development to the game of golf. But how does one truly &#8220;see the code&#8221; as the software grows in size and complexity? On one hand, you could ignore the fact that software is developed over many iterations and try ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fbefore-your-code-mildews-refactor%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fbefore-your-code-mildews-refactor%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div style="float:right;padding:10px">
<a href="http://www.flickr.com/photos/68387408@N00/473704186/" title="Squeeze?" target="_blank"><img src="http://pathfindersoftware.com/wp-content/uploads/473704186_7fbe7bc579_m.jpg" alt="Squeeze?" border="0" /></a><br /><small><a href="http://creativecommons.org/licenses/by/2.0/" title="Attribution License" target="_blank"><img src="http://pathfindersoftware.com/wp-content/uploads/cc1.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/68387408@N00/473704186/" title="erix!" target="_blank">erix!</a></small>
</div>
<p>In my last post, <a href="http://www.pathf.com/blogs/2009/03/see-the-code-be-the-code/" target="_blank">See the Code, Be the Code</a>, I compared agile development to the game of golf. But how does one truly &#8220;see the code&#8221; as the software grows in size and complexity? On one hand, you could ignore the fact that software is developed over many iterations and try to build a very complex system all at once that does everything under the sun, or you can keep the design simple and focus on the iteration at hand knowing that as our understanding increases we will refactor the code.</p>
<p>Refactoring is the process by which you modify the behavior and appearance of the code to ensure that code is up-to-date with current system requirements or changes in the system environment. It gives the development team an opportunity to continuously improve code quality for long term readability and maintainability. The easier the code is to follow, the less time it will take for current and future development teams to make changes as the system matures. It can also help the development team take advantages of improvements to existing frameworks and other software used to develop the application. These improvements can be realized through better performance and reusability of existing and future code. In short, it helps keep your code from become stale and mildewy.<br />
<span id="more-1812"></span><br />
So we are developing a custom desktop application that utilities a third party PDF library. Our team has developed the core tools for marking up documents using simple shapes &#8211; lines, rectangles, circles and polygons, calibration of a document to a specific scale &#8211; 1/4 in = 1 ft, and more complex shapes that using the scale to compute the shapes length, area, perimeter, etc. Now we are working on hole 10 of the software development golf course and one of the user stories requires multiple scales per document.</p>
<p>Upon inspection of our code base, we decided that we could meet the user requirement by restructuring the code contained within the <code>ViewPort</code> class. This class was originally designed to allow a single scale for the entire document, and contains methods for setting and updating the scale and basic properties for accessing the scale information for use by markup that requires calibration.  The <code>ViewPort</code> still needs a single, default scale that&#8217;s used for entire document but should support scales for specific areas/zones of the document.  Below shows the current and proposed refactored <code>ViewPort</code> class and new <code>ScaleZone</code> class.</p>
<p style="text-align: center;"><img class="size-full wp-image-1837 aligncenter" src="http://pathfindersoftware.com/wp-content/uploads/photo2.jpg" alt="photo" width="389" height="306" /></p>
<p>Now that we have an idea of how we want to refactor the code, we need some unit tests.</p>
<p>Unit Testing is just as important as refactoring because it helps to ensure unchanged code isn&#8217;t affect by improvements to other parts of the applications,  it helps document how to use new or updated functionality, and confirms the accuracy of our changes. So before we start changing the coding, we create a few  Unit Test. For example <code>AddScaleZone</code> method: we want to test calibrating a blank document and adding a new scale zone. We should save the document and reopen and assert that new scale zone exist with the correct data.</p>
<pre lang="csharp">[Test]
public void AddScaleZoneTest()
{
  string fileLocation = FileUtil.GetFileLocation(FileUtil.BlankDocument);
  docModel = new DocumentModel(fileLocation);

  CreateDefaultCalibrationViewPort(docModel.Document);

  docModel.SaveAs(savedFileLocation);
  docModel.Close();

  MeasurementProperty scaleZoneMeasurementProperty = GetScaleZoneMeasurementProperty();

  savedDocModel = new DocumentModel(savedFileLocation);

  // Create the scale zone and add to viewport
  ScaleZone scaleZone = new ScaleZone(new RectangleInfo(25, 25, 425, 425), 1);
  scaleZone.SetScaleZone(scaleZoneMeasurementProperty, "ScaleZoneUnitTest");
  savedDocModel.AddScaleZone(scaleZone);

  int scaleZoneCount = savedDocModel.GetScaleZoneCount();
  savedDocModel.SaveAs(savedFileLocation);
  savedDocModel.Close();

  ValidateCalibrationViewPortSaved(savedFileLocation);
  ValidateScaleZoneSaved(savedFileLocation, scaleZoneMeasurementProperty, new RectangleInfo(30, 30, 90, 90), 1, scaleZoneCount, scaleZone);
}</pre>
<p>We know the project won&#8217;t compile until we add the new <code>ScaleZone</code> class and refactor the <code>ViewPort</code> class. Let&#8217;s also not forget that our existing unit tests can become stale and out-of-date; it&#8217;s just as important to update the existing <code>ViewPort</code> Unit Tests base on the new requirement.</p>
<p>The point here is that code regardless of purpose needs refreshing. Don&#8217;t let it mildew! Refactor your code!
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fbefore-your-code-mildews-refactor%2F&amp;linkname=Before%20your%20Code%20Mildews%20%26%238212%3B%20Refactor%21" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fbefore-your-code-mildews-refactor%2F&amp;linkname=Before%20your%20Code%20Mildews%20%26%238212%3B%20Refactor%21" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fbefore-your-code-mildews-refactor%2F&amp;linkname=Before%20your%20Code%20Mildews%20%26%238212%3B%20Refactor%21" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fbefore-your-code-mildews-refactor%2F&amp;linkname=Before%20your%20Code%20Mildews%20%26%238212%3B%20Refactor%21" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fbefore-your-code-mildews-refactor%2F&amp;linkname=Before%20your%20Code%20Mildews%20%26%238212%3B%20Refactor%21" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fbefore-your-code-mildews-refactor%2F&amp;linkname=Before%20your%20Code%20Mildews%20%26%238212%3B%20Refactor%21" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fbefore-your-code-mildews-refactor%2F&amp;linkname=Before%20your%20Code%20Mildews%20%26%238212%3B%20Refactor%21" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F04%2Fbefore-your-code-mildews-refactor%2F&amp;title=Before%20your%20Code%20Mildews%20%26%238212%3B%20Refactor%21" id="wpa2a_8">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2009/04/before-your-code-mildews-refactor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>See the Code, Be the Code</title>
		<link>http://pathfindersoftware.com/2009/03/see-the-code-be-the-code/</link>
		<comments>http://pathfindersoftware.com/2009/03/see-the-code-be-the-code/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 22:32:28 +0000</pubDate>
		<dc:creator>Karega Scott</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technologies and Platforms]]></category>
		<category><![CDATA[Agile Development]]></category>
		<category><![CDATA[Golf]]></category>
		<category><![CDATA[Software Development Best Practices]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1694</guid>
		<description><![CDATA[photo credit: foxypar4 If you&#8217;ve every seen professional golfers drive the ball up the fairways, or putt the ball on the greens, they make it seem so easy. But for the vast army of us duffers out there, we know it is anything but. There are many variables to consider to ensure success on every ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fsee-the-code-be-the-code%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fsee-the-code-be-the-code%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div style="float:right;padding:10px"><a href="http://www.flickr.com/photos/43145783@N00/509539480/" title="Haywards Heath Mob # 5" target="_blank"><img src="http://pathfindersoftware.com/wp-content/uploads/509539480_911b2e09f5_m.jpg" alt="Haywards Heath Mob # 5" border="0" /></a><br /><small><a href="http://creativecommons.org/licenses/by/2.0/" title="Attribution License" target="_blank"><img src="http://pathfindersoftware.com/wp-content/uploads/cc.png" alt="Creative Commons License" border="0" width="16" height="16" align="absmiddle" /></a> <a href="http://www.photodropper.com/photos/" target="_blank">photo</a> credit: <a href="http://www.flickr.com/photos/43145783@N00/509539480/" title="foxypar4" target="_blank">foxypar4</a></small></div>
<p>If you&#8217;ve every seen professional golfers drive the ball up the fairways, or putt the ball on the greens, they make it seem so easy. But for the vast army of us duffers out there, we know it is anything but.</p>
<p>There are many variables to consider to ensure success on every hole you play. There&#8217;s the distance from the tee to the greens, the natural elements  &#8212; wind, rain and sun &#8211;, the number of allotted strokes per hole, the vexing choice among various woods and irons, the hazards dotting the course, and the mental and physical aspect of dealing with this humbling game. But there is one answer to these challenges: practice, practice and more practice to fine tune your craft. Well, developing software is similar in many respects.</p>
<p>Software development has it&#8217;s own thicket of variables to consider. There are the many functional and non-functional requirements that you must contend with, the different users involved (stakeholders, development team, system users, and the army of user persona&#8217;s) for the project, the changing requirements, resources and time that can impact the project, and various tools, technologies and platforms thrown into the mix as well.<br />
<span id="more-1694"></span><br />
Applying agile to the mix helps brings order and focus to our round of software development. Just as in golf we don&#8217;t play the whole course at once, but one hole at a time in 18 iterations. Success can be determined quickly through client feedback in those short iterations, just like each shot in golf tells you right away whether you&#8217;ve succeeded or failed.</p>
<p>Agile embraces changing requirement, fosters open communication between the customer and project team, minimizes the impact of resource juggling on the project by utilizing pair programming, and highlights the team accomplishments and removes obstacles using daily scrums. And last but not least, it takes practice, practice, practice and process refinement over the life of the project using retrospective session.</p>
<p>With practice and the right approach, we agile software developers can make developing software seem as easy as a Tiger Woods drive.
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fsee-the-code-be-the-code%2F&amp;linkname=See%20the%20Code%2C%20Be%20the%20Code" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fsee-the-code-be-the-code%2F&amp;linkname=See%20the%20Code%2C%20Be%20the%20Code" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fsee-the-code-be-the-code%2F&amp;linkname=See%20the%20Code%2C%20Be%20the%20Code" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fsee-the-code-be-the-code%2F&amp;linkname=See%20the%20Code%2C%20Be%20the%20Code" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fsee-the-code-be-the-code%2F&amp;linkname=See%20the%20Code%2C%20Be%20the%20Code" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fsee-the-code-be-the-code%2F&amp;linkname=See%20the%20Code%2C%20Be%20the%20Code" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fsee-the-code-be-the-code%2F&amp;linkname=See%20the%20Code%2C%20Be%20the%20Code" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2009%2F03%2Fsee-the-code-be-the-code%2F&amp;title=See%20the%20Code%2C%20Be%20the%20Code" id="wpa2a_10">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2009/03/see-the-code-be-the-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ADO.NET Entity Framework</title>
		<link>http://pathfindersoftware.com/2008/07/adonet-entity-framework/</link>
		<comments>http://pathfindersoftware.com/2008/07/adonet-entity-framework/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 15:10:20 +0000</pubDate>
		<dc:creator>Karega Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technologies and Platforms]]></category>
		<category><![CDATA[ADO.NET Entity Framework]]></category>
		<category><![CDATA[Logical Model and Conceptual Model]]></category>
		<category><![CDATA[Object Relation Mapping (ORM)]]></category>
		<category><![CDATA[Object-Oriented]]></category>
		<category><![CDATA[References]]></category>
		<category><![CDATA[XML Metadata]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1060</guid>
		<description><![CDATA[ADO.NET Entity Framework is an object relationship mapping (ORM) tool. It was designed to provide a layer of abstraction between the logical schema and concept schema of an application, and to decrease the amount code need for a data centric application. Some benefits of the Entity framework: Data storage engine and schema independence: Due to ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Fadonet-entity-framework%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Fadonet-entity-framework%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>ADO.NET Entity Framework is an object relationship mapping (ORM) tool. It was designed to provide a layer of abstraction between the logical schema and concept schema of an application, and to decrease the amount code need for a data centric application.</p>
<p>Some benefits of the Entity framework:</p>
<ul>
<li><strong>Data storage engine and schema independence: </strong>Due to the layer of abstraction between the logical and conceptual schema of your application, you no-longer need to know and hard cord the application to a specific data storage engine or schema.</li>
<li><strong>More expressive conceptual model: </strong>Entity types can inherit from other entity types and allows the creation of more complex types  in addition  to the standard scalar types support by  the database.</li>
<li><strong>Access to multiple database system: </strong>Because the application is free from hard code data storage dependencies, the developer has the ability to access data from multiple storages using a consistent application object model</li>
<li><strong>LINQ: </strong>Language Integrated query support that offers compile time syntax checking for queries against the conceptual model.</li>
</ul>
<p>The Entity Framework works by allow the developers to hand code or use code generation tools to create the XML metadata for the conceptual entity data model, a storage entity model, and a mapping specification between the two. The XML file created for the conceptual entity data model is then stored in the <a href="http://msdn.microsoft.com/en-us/library/bb399292.aspx">conceptual schema definition file (.csdl)</a>, the storage entity model is stored in the <a href="http://msdn.microsoft.com/en-us/library/bb399559.aspx">storage schema definition file (.ssdl)</a>, and mapping between the two in the <a href="http://msdn.microsoft.com/en-us/library/bb399202.aspx">mapping specification language file (.msl)</a>. These XML file are then loaded into the metadata workspace of the entity framework, and a set of classes are generated to allow the developer to work directly with the conceptual model and indirectly with the logical model.</p>
<p><a href="http://pathfindersoftware.com/wp-content/uploads/articleimage1.gif"><img class="alignnone size-medium wp-image-1061" src="http://pathfindersoftware.com/wp-content/uploads/articleimage1.gif" alt="ADO.NET Entity Framework Architecture" width="696" height="580" /></a><br />
<a href="http://www.code-magazine.com/Article.aspx?quickid=0712042"><strong>Figure: ADO.NET Entity Framework Architecture</strong></a></p>
<p>So with these benefits design and built directly into the the framework and the logical approach used by framework to interact with various data providers, some experts in entity-based applications and software architectures on the .NET  platform still feel that the framework has some pretty large deficiencies.</p>
<p>They are concerned that the framework is&#8230;</p>
<ul>
<li>Inordinate focus on the data aspect of entities leads to degraded entity  architectures</li>
<li>Excess code needed to deal with lack of lazy loading</li>
<li>Share, canonical model contradicts software best practices</li>
<li>Lack of persistence ignorance causes business logic to be harder to read,  write, and modify, causing development and maintenance costs to increase at an  exaggerated rate.</li>
<li>Excessive merge conflicts with source control in team environments.</li>
</ul>
<p>Are these claim valid concerns to consider?</p>
<p>Sure, only if the framework is mature with several versions under its belt and its prohibits the productivity, maintainability and scalability of the application.</p>
<p>Isn&#8217;t the right approach to software development to deliver a subset of the full feature set right the first time than try to deliver everything at once with massive issues that prevent the usability of the tool?</p>
<p>You decide&#8230;</p>
<p>Below are some useful references to get you going with Entity Framework.</p>
<p><a href="http://msdn.microsoft.com/en-us/magazine/cc700331.aspx">Achieve Flexible Data Modeling With the Entity Framework</a><br />
<a href="http://msdn.microsoft.com/en-us/library/bb399572.aspx">ADO.NET Entity Framework Pre-release documents</a><br />
<a href="http://www.codeplex.com/adonetsamples/Wiki/View.aspx?title=RunningEFBeta3Samples&amp;referringTitle=Home">Microsoft ADO.NET Entity Framework Overview</a><br />
<a href="http://www.infoq.com/news/2008/06/entity-framework-heat">ADO.NET Entity Framework Taking Some Heat</a><br />
<a href="http://www.code-magazine.com/Article.aspx?quickid=0712042">Programming Against the ADO.NET Entity Framework</a><br />
<a href="http://efvote.wufoo.com/forms/ado-net-entity-framework-vote-of-no-confidence/">ADO .NET Entity Framework Vote of No Confidence</a>
<p><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Fadonet-entity-framework%2F&amp;linkname=ADO.NET%20Entity%20Framework" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Fadonet-entity-framework%2F&amp;linkname=ADO.NET%20Entity%20Framework" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Fadonet-entity-framework%2F&amp;linkname=ADO.NET%20Entity%20Framework" title="Digg" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Fadonet-entity-framework%2F&amp;linkname=ADO.NET%20Entity%20Framework" title="DZone" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Fadonet-entity-framework%2F&amp;linkname=ADO.NET%20Entity%20Framework" title="Reddit" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Fadonet-entity-framework%2F&amp;linkname=ADO.NET%20Entity%20Framework" title="Delicious" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Fadonet-entity-framework%2F&amp;linkname=ADO.NET%20Entity%20Framework" title="Evernote" rel="nofollow" target="_blank"><img src="http://pathfindersoftware.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F07%2Fadonet-entity-framework%2F&amp;title=ADO.NET%20Entity%20Framework" id="wpa2a_12">Share/Bookmark</a></p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2008/07/adonet-entity-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET 3.5 Linq to Sql and IBatis.NET</title>
		<link>http://pathfindersoftware.com/2008/03/net-35-rem/</link>
		<comments>http://pathfindersoftware.com/2008/03/net-35-rem/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 02:32:20 +0000</pubDate>
		<dc:creator>Karega Scott</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Technologies and Platforms]]></category>
		<category><![CDATA[Web/Tech]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2008/03/net-35-rem/</guid>
		<description><![CDATA[I've been looking at some of the new features in the .NET 3.5 framework and have found Object Relation Mapping (ORM) very similar to IBatis.NET and NHibernate. In .NET 3.5, they use attribute based mapping between the underlying data table...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F03%2Fnet-35-rem%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpathfindersoftware.com%2F2008%2F03%2Fnet-35-rem%2F&amp;source=PathSoft&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8a1154b608af9e55718b231fb0025d40&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;ve been looking at some of the new features in the .NET 3.5 framework and have found Object Relation Mapping (ORM) very similar to IBatis.NET and NHibernate. In .NET 3.5, they use attribute based mapping between the underlying data table and entity class (Domain Object). For instance</p>
<pre>using System.Data.Linq;
using System.Data.Linq.Mapping;
[Table="Books"]
public class Book {
    [Column="Name"]
    public string _Name;
    [Column="ISBNNo"]
    public string _isbn;
    ...
}</pre>
<p>What you notice is the the class Book is mapped to a table called Books using the Table attribute and particular table columns are mapped using the column attribute on the Book class instance fields. Compared with IBatis.NET XML files; you would have to:</p>
<ol>
<li>Reference the Book class using the &lt;typedalias type=&#8221;Namespace.Book, Namespace&#8221;/&gt;</li>
<li>Create a ResultMap that exposes the Book class internal fields using &lt;property name=&#8221;ISBN&#8221; Column=&#8221;ISBN&#8221;&gt;</li>
<li>Create the sql statement that references the resultmap for the Book class so IBatis.NET and hydrate the results. Below is sample sqlmap.xml file for Ibastis.net</li>
</ol>
<pre>&lt;sqlMap namespace="Surveys" xmlns="http://ibatis.apache.org/mapping"&gt;
    &lt;alias&gt;
        &lt;typeAlias alias="Book" type="Namespace.Books, AssemblyName"/&gt;
    &lt;/alias&gt;
    &lt;resultMaps&gt;
        &lt;resultMap id="BookMap" class="Book"&gt;
           &lt;result property="Name" column="Name"/&gt;
            &lt;result property="ISBN" column="ISBN"/&gt;
        &lt;/resultMap&gt;
    &lt;/resultMaps&gt;
    &lt;statements&gt;
        &lt;select id="GetBooks" parameterClass="map" resultMap="BookMap"&gt;
            select name, isbn from books
        &lt;/select&gt;
    &lt;/statements&gt;
&lt;/sqlMap&gt;</pre>
<p>Furthermore, much of the guesswork required to create the parameterizes queries used to pull information from the database and load a collection of Book objects has been added. Simply creating a new Linq DataContext object, passing the connection string to the database and calling the generic GetTable&lt;<em>T&gt;</em> (where T is class name. in this case Book) is all you need to get the results, versus creating the individual sql in the xml file and calling one of the QueryForObject or QueryForList methods found for IBatis.NET.</p>
<p>Last but not least, Linq provides the programmer with built-in sql like keywords used to build expressions that  sort, aggregate and limit the original result set to some more specific or limited result result set without going back to the underlying database.</p>
<p>Although, this is a very simplicity view of mapping a database table to .NET class. This does give you a good picture to the additional overhead required to using IBatis.NET xml file mapping versus Microsoft&#8217;s Linq to Sql attribute base mapping, and demonstrates how ORM is now built right into the .NET Framework. And, you be happy to know that your .NET 3.5 Linq to Sql applications will still run on .NET 2.0 because the new features are specific to the specific 3.5 .NET compiler.</p>
]]></content:encoded>
			<wfw:commentRss>http://pathfindersoftware.com/2008/03/net-35-rem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (User agent is rejected)
Page Caching using memcached (User agent is rejected)

Served from: pathfindersoftware.com @ 2012-02-09 19:32:39 -->
