<?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>Barry Jones &#187;  &#8211; Barry Jones</title>
	<atom:link href="http://www.barryjones.me.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barryjones.me.uk</link>
	<description>General Ramblings</description>
	<lastBuildDate>Mon, 06 Sep 2010 10:05:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Useful MVC Resources</title>
		<link>http://www.barryjones.me.uk/2010/09/useful-mvc-resources/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=useful-mvc-resources</link>
		<comments>http://www.barryjones.me.uk/2010/09/useful-mvc-resources/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 08:00:03 +0000</pubDate>
		<dc:creator>Barry Jones</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Pattern]]></category>
		<category><![CDATA[Resources]]></category>

		<guid isPermaLink="false">http://www.barryjones.me.uk/?p=234</guid>
		<description><![CDATA[While learning anything new there are times when you stumble upon information on the Internet that really seems to help. Here a list of links and websites that have helped me get a better understanding of the Microsoft&#8217;s MVC .NET Framework, it&#8217;s architecture and how to use it. But first the pattern: Martin Fowlers Discussion [...]]]></description>
			<content:encoded><![CDATA[<p>While learning anything new there are times when you stumble upon information on the Internet that really seems to help. Here a list of links and websites that have helped me get a better understanding of the <em>Microsoft&#8217;s <acronym title="Model View Controller">MVC</acronym> .NET Framework</em>, it&#8217;s architecture and how to use it.<span id="more-234"></span></p>
<p>But first the pattern: <a title="MVC Pattern Description" href="http://martinfowler.com/eaaDev/uiArchs.html" target="_blank">Martin Fowlers Discussion of the MVC Pattern</a>.</p>
<h3>General MVC Resources</h3>
<p>These links are websites with lots of various information about <em><acronym title="Model View Controller">MVC</acronym></em>, with no specific focus.</p>
<ul>
<li><a title="Microsoft MVC Website" href="http://www.asp.net/mvc" target="_blank">Microsoft&#8217;s MVC Framework Website</a></li>
<li><a title="Scott Hanselman on MVC" href="http://www.hanselman.com/blog/CategoryView.aspx?category=ASP.NET+MVC" target="_blank">All of Scott Hanselman&#8217;s MVC Posts</a></li>
<li><a title="Scott Gu" href="http://weblogs.asp.net/Scottgu" target="_blank">Scott Guthrie for eveything .NET</a></li>
<li><a title="MSDN MVC Introduction" href="http://msdn.microsoft.com/en-us/magazine/cc337884.aspx" target="_blank">An introduction to MVC</a></li>
<li><a title="MSDN MVC Resources" href="http://msdn.microsoft.com/en-us/library/dd394709%28VS.100%29.aspx" target="_blank">A list of MSDN resources for learning the details of the MVC Framework</a></li>
</ul>
<h3>Architecture and Pipeline</h3>
<p>A very good description of the full request response pipeline in MVC.NET, this is for version 1.0 but the information is still useful.</p>
<ul>
<li><a title="MVC Architecture" href="http://dotnetslackers.com/articles/aspnet/AnArchitecturalViewOfTheASPNETMVCFramework.aspx" target="_blank">Architectural Overview of MVC Framework</a></li>
<li><a title="MVC Pipeline Lifecycle" href="http://blog.codeville.net/2007/11/20/aspnet-mvc-pipeline-lifecycle/" target="_blank">V1.0 Request/Response Pipeline Overview</a></li>
</ul>
<h3>Model Binding Information</h3>
<ul>
<li><a title="MVC Model Binders" href="http://blog.maartenballiauw.be/post/2008/10/02/Using-the-ASPNET-MVC-ModelBinder-attribute-Second-part.aspx" target="_blank">Creating a Model Binder</a></li>
<li><a title="IModelBinder implementation" href="http://panteravb.com/blog/posts/2008/10/2/imodelbinder-with-autobinder.ashx" target="_blank">IModelBinder Autobinding</a></li>
</ul>
<h3>Routing</h3>
<ul>
<li><a title="MSDN description of MVC Routing" href="http://msdn.microsoft.com/en-us/library/cc668201%28VS.100%29.aspx" target="_blank">MSDN Review of the MVC Routing Process</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.barryjones.me.uk/2010/09/useful-mvc-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Documentation in Live Documenter</title>
		<link>http://www.barryjones.me.uk/2010/07/net-documentation-in-live-documenter/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=net-documentation-in-live-documenter</link>
		<comments>http://www.barryjones.me.uk/2010/07/net-documentation-in-live-documenter/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 22:55:19 +0000</pubDate>
		<dc:creator>Barry Jones</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[CLR]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.barryjones.me.uk/?p=353</guid>
		<description><![CDATA[Today The Box Software released their .NET documentation tool the Live Documenter. There are certainly other tools to output static compiled help files. But the Live Documenter is different. After we have painstakingly entered all of that XML code comments in our source code. We need a nice way to see the fruits of our [...]]]></description>
			<content:encoded><![CDATA[<p>Today <a title="The Box Software" href="http://theboxsoftware.com" target="_blank">The Box Software</a> released their .NET documentation tool the <a title=".NET documentation tool Live Documenter" href="http://theboxsoftware.com/products/live-documenter/" target="_blank">Live Documenter</a>. There are certainly other tools to output static compiled help files. But the Live Documenter is different.</p>
<p>After we have painstakingly entered all of that XML code comments in our source code. We need a nice way to see the fruits of our labours. NDoc emerged years ago and provided a way to get your documentation in to a compiled CHM file, but crashed and burned when generics was released in .NET 2. Documentation tools/generators whatever have never kind of cut the mustard since then.<span id="more-353"></span></p>
<p>Lets have a look at the Live Documenter.</p>
<h2>.NET documentation has never looked so good</h2>
<p>The Live Documenter supports all currently available versions of the .NET framework, project and solution files. So when you want to view your documentation you can just simply point it at your current solution file. You will be greeted by the library view.</p>
<div id="attachment_354" class="wp-caption alignnone" style="width: 310px"><a href="http://www.barryjones.me.uk/wp-content/uploads/2010/07/ld-assemblies.png" rel="lightbox[353]"><img class="size-medium wp-image-354 " title="Assemblies" src="http://www.barryjones.me.uk/wp-content/uploads/2010/07/ld-assemblies-300x197.png" alt="View of libraries in the Live Documenter" width="300" height="197" /></a><p class="wp-caption-text">Assemblies in Live Documenter</p></div>
<p>You are presented with a list of all of the libraries in the solution. The black ones have XML comments the grey ones have not. When you select one of the libraries the list of namespaces is displayed in the reading panel on the right. Nice and simple.</p>
<p>Lets just jump in and see what a documented class looks like.</p>
<div id="attachment_358" class="wp-caption alignnone" style="width: 310px"><a href="http://www.barryjones.me.uk/wp-content/uploads/2010/07/ld-class.png" rel="lightbox[353]"><img class="size-medium wp-image-358" title="Classes in Live Documenter" src="http://www.barryjones.me.uk/wp-content/uploads/2010/07/ld-class-300x197.png" alt="A view of a class in the Live Documenter" width="300" height="197" /></a><p class="wp-caption-text">Classes in Live Documenter</p></div>
<p>The class is displayed as you expect. The remarks you entered are displayed, the see links you created are displayed AND they link through to the associated class, method, property. The inheritance tree is displayed and the see also links from the documentation. The tree view shows all the other classes, enumeration, interfaces in the same namespace.</p>
<pre class="code">/// &lt;summary&gt;
/// The AssemblyDef provides the top level information and entry point to
/// all types, methods etc reflected from a .NET executable.
/// &lt;/summary&gt;
/// &lt;remarks&gt;
/// &lt;para&gt;The AssemblyDef is the starting point for obtaining reflected information
/// about a .NET assembly. This information is obtained by parsing and discerning
/// information about &lt;see cref="TypeDef"/&gt;s, &lt;see cref="MethodDef"/&gt;s etc from
/// the .NET metadata stored in the &lt;see cref="PeCoffFile"/&gt;.&lt;/para&gt;
/// &lt;para&gt;The assembly implements a mechanism for generating unique identifiers
/// that can be assigned to each of the elements reflected in this assembly. The
/// unique identifier is not really required but can help other applications to
/// store keys and find reflected elements more quickly and uses less memory than
/// string based unique identifiers.&lt;/para&gt;
/// &lt;example&gt;
/// &lt;code&gt;
/// // Instantiate from a full file path and name
/// AssemblyDef assembly = AssemblyDef.Create(myAssemblyPath);
///
/// // Instantiate from an already existing loaded metadata file
/// PeCoffFile peCoffFile = new PeCoffFile(myAssemblyPath);
/// AssemblyDef assembly = AssemblyDef.Create(peCoffFile);
/// &lt;/code&gt;
/// &lt;/example&gt;
/// &lt;/remarks&gt;
/// &lt;seealso cref="PeCoffFile"/&gt;
</pre>
<p>There is a full list of supported XML tags on the <a title="Available XML comment tags on MSDN" href="http://msdn.microsoft.com/en-us/library/5ast78ax.aspx" target="_blank">MSDN website</a>.</p>
<p>The method view is just as good. It displays the exceptions, type parameters, parameters, summaries and remarks as expected.</p>
<div id="attachment_364" class="wp-caption alignnone" style="width: 310px"><a href="http://www.barryjones.me.uk/wp-content/uploads/2010/07/ld-method.png" rel="lightbox[353]"><img class="size-medium wp-image-364" title="A generic method in Live Documenter" src="http://www.barryjones.me.uk/wp-content/uploads/2010/07/ld-method-300x197.png" alt="The live documenter shows a generic method" width="300" height="197" /></a><p class="wp-caption-text">Methods in the Live Documenter</p></div>
<p>You can also search the whole solution for methods, classes etc. The Live Documenter will show you an auto-complete search box with the results for you query.</p>
<div id="attachment_366" class="wp-caption alignnone" style="width: 310px"><a href="http://www.barryjones.me.uk/wp-content/uploads/2010/07/ld-searching.png" rel="lightbox[353]"><img class="size-medium wp-image-366" title="Searching in the Live Documenter" src="http://www.barryjones.me.uk/wp-content/uploads/2010/07/ld-searching-300x197.png" alt="Autocomplete searching in the live documenter" width="300" height="197" /></a><p class="wp-caption-text">Searching in the Live Documenter</p></div>
<p>It handily displays the summary text with each result to help you figure out which result you was actually looking for.</p>
<p>There is plenty more to get excited about with the Live Documenter, it&#8217;s super fast, really good looking and I suggest you download your FREE copy from <a title="Download The Live Documenter by the Box Software" href="http://theboxsoftware.com/products/live-documenter/" target="_blank">http://theboxsoftware.com/products/live-documenter/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryjones.me.uk/2010/07/net-documentation-in-live-documenter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Like Documentation!</title>
		<link>http://www.barryjones.me.uk/2009/12/i-like-documentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-like-documentation</link>
		<comments>http://www.barryjones.me.uk/2009/12/i-like-documentation/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 22:55:09 +0000</pubDate>
		<dc:creator>Barry Jones</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Documentation]]></category>

		<guid isPermaLink="false">http://www.barryjones.me.uk/?p=290</guid>
		<description><![CDATA[OK that probably does not leave me looking anything other than geeky, but never-the-less: I do. Why do I like it? Or should the question be why do you not? It can be an extremely efficient way of obtaining large amounts of information about a project in very little time. A visual representation of a [...]]]></description>
			<content:encoded><![CDATA[<p>OK that probably does not leave me looking anything other than geeky, but never-the-less: I do.</p>
<p>Why do I like it? Or should the question be why do you not? It <strong>can be</strong> an extremely efficient way of obtaining large amounts of information about a project in very little time. A visual representation of a system gives a better understanding of a project overall, than a long-winded contract or several hours of perusing code can ever do.</p>
<p>Well written, considered and thought out project documentation can be a huge time and money saver. Sounds good doesn&#8217;t it. So why do developers hate documentation? Why don&#8217;t we ever find the time to keep it up to date?</p>
<p>Well, from what I have seen project documentation doesn&#8217;t get updated because there is generally no one in the team who actually owns it. It is seen as a pain and a chore; because lets face it, most people like to jump in and hack the code and why would we want to sit and write about what we have just done; we have done it already! You should be able to read the code, blah, blah, blah. Excuses. Unfortunately, our colleagues don&#8217;t fully understand that their rushed implementations or their bag of buzz words, latest technologies, multiple levels of indirection, inversion and misunderstood pattern implementations, are not easy to understand. And frankly, in three months time they won&#8217;t understand it either. Rant over.</p>
<p>And just having documentation isn&#8217;t enough. I have seen documentation associated with development projects which is out of date, poorly written and of very little value to anyone. Occasionally, developers are required to update documentation that is actually intended as contractual business documentation; again unhelpful.</p>
<h3>What Constitues Good Documentation?</h3>
<p>OK. So what constitutes a good set of documentation in a project. One acronym &#8211; UML. A picture paints a thousand words and all that. Now don&#8217;t get me wrong, I don&#8217;t think you should document every inch of code in a project. But even a document giving a generalised overview of the project, its architecture, architectural intent and diagrams which show visually this information; is priceless.</p>
<div id="attachment_307" class="wp-caption aligncenter" style="width: 582px"><a href="http://www.barryjones.me.uk/wp-content/uploads/2009/12/uml-diagram.gif" rel="lightbox[290]"><img class="size-full wp-image-307  " title="UML Diagram" src="http://www.barryjones.me.uk/wp-content/uploads/2009/12/uml-diagram.gif" alt="UML Diagram" width="572" height="235" /></a><p class="wp-caption-text">Observer Pattern</p></div>
<p>Time to put my money where my mouth is. This is what I think you should seriously consider having as a basic documentation set.</p>
<ul>
<li>Architecture. A UML diagram showing the constituent parts of the architecture, a description of the system and its intended purpose.</li>
<li>System. You should document and diagram, with class diagrams, the major sections of the system. Again with a description of intent and purpose.</li>
<li>Document complex interactions. In larger systems there are at least one portion of the system that requires a little more thought because of that clever implementation. Make sure it is again documented. A sequence diagram showing the interaction between classes and again, description of intent and purpose.</li>
</ul>
<p>With this all developers will know how the system is architected, what it was supposed to be doing and how it is achieving it. This means that when they come to fix a bug or modify the system because of change requests that they understand what needs to be changed and how that effects the rest of the system. And of course they would update the documentation so that everyone else knows as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryjones.me.uk/2009/12/i-like-documentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Everynote, Everywhere: Evernote</title>
		<link>http://www.barryjones.me.uk/2009/11/everynote-everywhere-evernote/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=everynote-everywhere-evernote</link>
		<comments>http://www.barryjones.me.uk/2009/11/everynote-everywhere-evernote/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 13:11:16 +0000</pubDate>
		<dc:creator>Barry Jones</dc:creator>
				<category><![CDATA[Tip]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[evernote]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[workflow]]></category>
		<category><![CDATA[working]]></category>

		<guid isPermaLink="false">http://www.barryjones.me.uk/?p=281</guid>
		<description><![CDATA[We all make tons of notes, scrawls and scribbles while working on projects. Quite a lot of that information is useful. Why not get make that information more available?]]></description>
			<content:encoded><![CDATA[<p>We all make tons of notes, scrawls and scribbles while working on projects. Quite a lot of that information is useful. Why not get make that information more available?</p>
<p>I use <a title="Evernote for all you note taking needs" href="http://www.evernote.com" target="_blank">Evernote</a> to make that information available. I have been using it for work and play for about a year, and it is has become a tool I just can&#8217;t live without. Evernote is available on the Web, Desktop, iPhone and other mobile devices and systems. This is how I have been using Evernote.<span id="more-281"></span></p>
<h3>Project Information</h3>
<p>First of all, to get information about the project I am working on. Where I work at the moment, there are many projects, which I may not be continually assigned to. This makes it difficult to keep in mind all of the things you need to know. Server address, UAT connection details, information about the project, recent work carried out. In essence anything that I deem interesting or important about a project gets thrown in to Evernote.</p>
<p>Evernote makes it easier to get back up to speed on projects rather than having to review the somewhat dry read which is the technical documentation.</p>
<h3>Bug Fixes</h3>
<p>If I have found a fix to an error I get on a project it is good to record this in Evernote, as it makes the fix available to other projects. Granted this is not as useful for very specific bugs but when you have issues with the Microsoft Enterprise Library, that information is going to be useful again.</p>
<h3>To Do Lists</h3>
<p>If I am working on a large job. I record all of the elements of that task as a Note. I can then check of each item as I get it done and as new things crop up and I can extend the to do list. So now I don&#8217;t forget where I am up to or what I have left to do.</p>
<p>Have a look at <a title="Evernote for all you note taking needs" href="http://www.evernote.com" target="_blank">Evernote</a> and let me know how you end up using it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryjones.me.uk/2009/11/everynote-everywhere-evernote/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amy Wyke</title>
		<link>http://www.barryjones.me.uk/2009/11/amy-wyke/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=amy-wyke</link>
		<comments>http://www.barryjones.me.uk/2009/11/amy-wyke/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 14:14:40 +0000</pubDate>
		<dc:creator>Barry Jones</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.barryjones.me.uk/?p=44</guid>
		<description><![CDATA[I have always considered myself to be a developer. I have enjoyed other peoples designs, I want all of my software to look good and function well; to that end I make sure I keep my finger in the design pie (so to speak.) Sifting through Photoshop tutorials, reading web design blogs and websites. So [...]]]></description>
			<content:encoded><![CDATA[<p>I have always considered myself to be a developer. I have enjoyed other peoples designs, I want all of my software to look good and function well; to that end I make sure I keep my finger in the design pie (so to speak.) Sifting through Photoshop tutorials, reading web design blogs and websites.</p>
<p>So aside from making corporate sites, business web applications, sticking within UX guidelines and the basic principle of <a title="CRAP Acronym from The Non-Designer's Design Book" href="http://www.amazon.co.uk/Non-Designers-Design-Book-Non-Designers/dp/0321193857" target="_blank">CRAP</a> (Contrast, Repetition, Alignment and Proximity). My design skills have not really had much of run out. Until now.</p>
<p>My first real design for my first real client, and a very picky and strong willed one at that: the other half.</p>
<p>Amy has been writing songs and playing live for a couple of years now, recently she decided to get a band together and rock out like she has always wanted. So with that, a new website, a new look, a new start.</p>
<p>So today, it is unveiled; the many months of  &#8220;discussions&#8221; has resulted in <a title="Amy Wyke's Band and Music Website" href="http://www.amywyke.com" target="_blank">this very grungy looking website</a>.</p>
<p>Here are a couple of screen shots to give you an a look.</p>
<div id="attachment_226" class="wp-caption alignleft" style="width: 159px"><a href="http://www.barryjones.me.uk/wp-content/uploads/2009/11/amy-wyke-website-2.png" rel="lightbox[44]"><img class="size-thumbnail wp-image-226" title="Amy Wyke Website Home Page" src="http://www.barryjones.me.uk/wp-content/uploads/2009/11/amy-wyke-website-2-149x96.png" alt="Amy Wyke's Website" width="149" height="96" /></a><p class="wp-caption-text">Amy Wyke&#39;s Website</p></div>
<div id="attachment_225" class="wp-caption alignleft" style="width: 159px"><a href="http://www.barryjones.me.uk/wp-content/uploads/2009/11/amy-wyke-website-1.png" rel="lightbox[44]"><img class="size-thumbnail wp-image-225" title="Amy Wyke Website Gallery Page" src="http://www.barryjones.me.uk/wp-content/uploads/2009/11/amy-wyke-website-1-149x96.png" alt="Amy Wyke Gallery Page" width="149" height="96" /></a><p class="wp-caption-text">Amy Wyke Gallery Page</p></div>
<p><br style="clear: both" /></p>
<p>Amy is performing a number of <a title="A list of Amy's Gigs" href="http://www.amywyke.com/gigs/" target="_blank">gigs across England</a> at the moment, go take a look.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryjones.me.uk/2009/11/amy-wyke/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Route Debugging in MVC.NET</title>
		<link>http://www.barryjones.me.uk/2009/10/quick-route-debugging-in-mvc-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quick-route-debugging-in-mvc-net</link>
		<comments>http://www.barryjones.me.uk/2009/10/quick-route-debugging-in-mvc-net/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 10:26:43 +0000</pubDate>
		<dc:creator>Barry Jones</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.barryjones.me.uk/?p=141</guid>
		<description><![CDATA[Here is a quick way of getting detailed information about which route has been accepted and why in MVC.NET. The code below should be placed in your Application_EndRequest event handler in global.asax. By placing a break point in the code directly after evaluation you can see a collection of all the routes, if it matched [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick way of getting detailed information about which route has been accepted and why in MVC.NET.</p>
<p>The code below should be placed in your Application_EndRequest event handler in global.asax. By placing a break point in the code directly after evaluation you can see a collection of all the routes, if it matched the request and a reference to the RouteData to see more detailed information.</p>
<p>This code works by re-evaluating each of the Routes defined in your application against the current request. The first match in the collection is the match that MVC will have used to handle your request.<span id="more-141"></span></p>
<pre class="code">List&lt;object&gt; routes = new List&lt;object&gt;();
foreach (System.Web.Routing.Route current in System.Web.Routing.RouteTable.Routes) {
	System.Web.Routing.RouteData data = current.GetRouteData(
		new HttpContextWrapper(HttpContext.Current)
		);
	bool matches = data != null;
	routes.Add(new { Match=matches, Url=current.Url.ToString(), Data=data});
}</pre>
<p>For a better long term implementation try using <a title="Phil Haack's ASP.NET Routing Debugger" href="http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx" target="_blank">Phil Haack&#8217;s</a> debugging implementation or get the route debugging code from the <a title="ASP.NET MVC Unleased" href="http://www.informit.com/store/product.aspx?isbn=9780672329982" target="_blank">ASP.NET MVC Unleashed</a> book.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryjones.me.uk/2009/10/quick-route-debugging-in-mvc-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Current Work: Live Documenter</title>
		<link>http://www.barryjones.me.uk/2009/10/current-work-live-documenter/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=current-work-live-documenter</link>
		<comments>http://www.barryjones.me.uk/2009/10/current-work-live-documenter/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 21:43:47 +0000</pubDate>
		<dc:creator>Barry Jones</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[My Projects]]></category>
		<category><![CDATA[CLR]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[XML Comments]]></category>

		<guid isPermaLink="false">http://www.barryjones.me.uk/?p=48</guid>
		<description><![CDATA[I had nothing else to talk about so I thought I would give a little ramble on my current project. It has been &#8216;code named&#8217; Live Documenter, which will probably end up being its final name as well &#8211; if only I was more creative. OK, onward! Basically since NDoc curled up and died a [...]]]></description>
			<content:encoded><![CDATA[<p>I had nothing else to talk about so I thought I would give a little ramble on my current project. It has been &#8216;code named&#8217; Live Documenter, which will probably end up being its final name as well &#8211; if only I was more creative. OK, onward!</p>
<p>Basically since <a title="NDoc stagnating since 2005" href="http://ndoc.sourceforge.net/" target="_blank">NDoc</a> curled up and died a long time ago I have really wanted a nice xml comment documenter to read all those lovely comments I have been painstakingly hand crafting since , well, as long as I can remember. This has been curled up at the back of mind for ages. And a little while ago I decided I would start faffing around with the .NET meta-data and just try to learn a little more about how the <acronym title="Common Language Runtime">CLR</acronym> holds it&#8217;s data in <acronym title="Portable Executable">PE</acronym> files, what kind of data and well.. OK I can&#8217;t justify it really. Anyway; two thoughts collided and the rest is unwritten history.<span id="more-48"></span></p>
<h2>What it Does</h2>
<p>This documentor takes a solution, project or library and churns through all the internal gubbins of the built libraries for the <acronym title="Visual Studio">VS</acronym> files or itself for the DLL. It then locates the lovely XML comment files, mingles them together and spits out some nice legible information. I haven&#8217;t painted that in the most beautiful light but I am British so it remains understated.</p>
<ul>
<li>Reads VS Solution, Project and Library files</li>
<li>Parses XML comments (supports the basic <a href="http://msdn.microsoft.com/en-us/library/5ast78ax(VS.80).aspx" target="_blank">Microsoft set</a>) to produce documentation</li>
<li>Updates live the changes you make to the your source code</li>
<li>Allows searching of types, properties and methods</li>
<li>Supports code comments for generic types and methods</li>
<li>Provides syntax in C# or Visual Basic</li>
</ul>
<p>It was a real struggle getting information about the internal workings of PE files, the Internet is a little sparse in this regard, so I had to get the aid of two books <a title=".NET IL Assembler" href="http://www.amazon.co.uk/Inside-NET-IL-Assembler-Lidin/dp/0735615470/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1255037193&amp;sr=8-2" target="_blank">.NET IL Assembler</a> and <a title="Reversing - The secrets of reverse engineering" href="http://www.amazon.co.uk/Reversing-Secrets-Engineering-Eldad-Eilam/dp/0764574817/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1255037247&amp;sr=1-1" target="_blank">Reversing</a> to help me on the way. Whilst I was reinventing the wheel Microsoft released an open source reflection library (which I can no longer find a link to) which seems to do everything, ah well. However, I think I will in future posts, describe in a little more detail what I did and learnt while making this app.</p>
<h2>Appearances can be Deceiving</h2>
<p>This doesn&#8217;t look the best at the moment, but it&#8217;s still in development so bear with me! I really need to polish the front end up and apply some UX magic; so with that in mind lets have a look at some screenies.</p>
<div id="attachment_105" class="wp-caption alignleft" style="width: 160px"><a href="http://www.barryjones.me.uk/wp-content/uploads/2009/10/type-view.png" rel="lightbox[48]"><img class="size-thumbnail wp-image-105" title="Live Documentor - Type Page" src="http://www.barryjones.me.uk/wp-content/uploads/2009/10/type-view-150x102.png" alt="Live Documentor - Type Page" width="150" height="102" /></a><p class="wp-caption-text">View of a Class</p></div>
<div id="attachment_111" class="wp-caption alignright" style="width: 160px"><a href="http://www.barryjones.me.uk/wp-content/uploads/2009/10/namespace-view.png" rel="lightbox[48]"><img class="size-thumbnail wp-image-111" title="namespace view" src="http://www.barryjones.me.uk/wp-content/uploads/2009/10/namespace-view-150x102.png" alt="namespace view" width="150" height="102" /></a><p class="wp-caption-text">View of a Namespace</p></div>
<p>The class view has all of the information you would expect. Full namespace declaration, deceleration syntax, all your lovely comments, inheritance tree and by the powers of WPF lots of control over how you view the page. All of the param references, type references, exception information (for methods) is linked up from the comments. The UI currently allows you to view easily which libraries have comments and which don&#8217;t.</p>
<p>As you can see by the method view below, it supports generic types and methods. Type, method, property etc signatures are generated and can be changed to multiple languages; although I have only written code to support VB and C# at the moment.</p>
<div id="attachment_113" class="wp-caption alignleft" style="width: 160px"><a href="http://www.barryjones.me.uk/wp-content/uploads/2009/10/method-view-generic.gif" rel="lightbox[48]"><img class="size-thumbnail wp-image-113" title="Live Documentor - View of Generic Method" src="http://www.barryjones.me.uk/wp-content/uploads/2009/10/method-view-generic-150x107.gif" alt="View of a Method" width="150" height="107" /></a><p class="wp-caption-text">View of a Method</p></div>
<p>I all in all am pretty excited about where this is going at the moment and for the ideas I have about where it will be going on a more long term basis. One little thing I &#8211; in the long term &#8211; am hoping to get in there is dynamically creating <a title="Unified Modelling Language" href="http://en.wikipedia.org/wiki/Unified_Modeling_Language" target="_blank">UML</a> diagrams. The idea of being able to see a methods full sequence diagram, cant be anything but a help for people working on new projects or revisiting old ones!</p>
<p>Finally, the main idea behind this application is that it is used more like a live reference, an open book; which you would have open at the same time as a project. Because of this the application will continually update itself based on changes you make to your solutions, projects, code and comments. I thought that was a little different from your normal wait for application to generate static pages, currently event with a large 20 project solution this still opens quickly and is extremely usable. I hope that has made you interested and I will speak up again when I have something that I can throw out there.</p>
<p>This application will be made available from my company, <a href="http://www.theboxsoftware.com">The Box Software</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryjones.me.uk/2009/10/current-work-live-documenter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically Populate DTOs</title>
		<link>http://www.barryjones.me.uk/2009/10/automatically-populate-dtos/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automatically-populate-dtos</link>
		<comments>http://www.barryjones.me.uk/2009/10/automatically-populate-dtos/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 20:07:09 +0000</pubDate>
		<dc:creator>Barry Jones</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[DTO]]></category>
		<category><![CDATA[Pattern]]></category>

		<guid isPermaLink="false">http://carl.barryjones.me.uk/?p=15</guid>
		<description><![CDATA[The lowly DTO, a pattern described by Martin Fowler that enables you to reduce the number of API calls you make across a remote boundary; it allows this by grouping all the data in to a new data type and returning that instead. I have however found that this pattern can cause you to write [...]]]></description>
			<content:encoded><![CDATA[<p>The lowly <a title="DTO Pattern" href="http://martinfowler.com/eaaCatalog/dataTransferObject.html"><acronym title="Data Transfer Object">DTO</acronym></a>, a pattern described by <a title="Martin Fowler" href="http://martinfowler.com/" target="_blank">Martin Fowler</a> that enables you to reduce the number of API calls you make across a remote boundary; it allows this by grouping all the data in to a new data type and returning that instead. I have however found that this pattern can cause you to write a lot of code that is nothing more than property setting. The code provided in this post (<a href="http://www.barryjones.me.uk/wp-content/uploads/2009/10/BarryJones.DataTransferObjects.zip">here</a>) allows you to automate the population of these <acronym title="Data Transfer Object">DTO</acronym>s saving you time, so you can get on with something more important like drinking coffee.<span id="more-15"></span></p>
<h2>Automating DTO Population</h2>
<p>First of all grab yourself a copy of the <a href="http://www.barryjones.me.uk/wp-content/uploads/2009/10/BarryJones.DataTransferObjects.zip">source</a> code. A general overview of the process is; you specify — using attributes — the mappings between your business objects and your data transfer objects. These attributes can describe simple properties, complex properties and collections. After that is done, throw the object at the converter and Bob&#8217;s your uncle!</p>
<h3>Mapping DTO Properties with Attributes</h3>
<p>There are two attributes DTOSimpleMapper and DTOCollectionMapper; the basic signature of the attributes is shown below.</p>
<pre class="code">[DTOSimpleMapper(params string[] fields)]
[DTOCollectionMapper(Type ofType, string fromField)]</pre>
<pre class="code">[DTOSimpleMapper("FromProperty.Child.Identifier")]
public int ConvertedProperty;</pre>
<p>The ‘fields’ and ‘fromField’ parameters describe the property on the origin object that is to be converted. The destination for the conversion is always the property the attribute is decorating. The fields are represented as a string where the field is a child property the ‘.’ notation can be used to indicate this. I.e. &#8220;Parent.Child.Child&#8221;.<br />
The params string[] parameters on both attributes can be used to describe more complex conversions, when the converting types have multiple properties the conversion can be described by passing in an array of strings which define the from and to properties. I.e:</p>
<pre class="code">[DTOSimpleMapper("Prop1.Prop2=Identifier", "Prop2.Prop1=Name")]</pre>
<p>The first parameter on the DTOCollectionMapper tells the converter what the destination array elements are:</p>
<pre class="code">[DTOCollectionMapper(typeof(string), "FromProperty"]
public string[] ConvertedCollection;</pre>
<p>The converter will work with any collection that implements IEnumerable. As with the simple mapper, the property name can describe more complex conversions. This is useful where you have a generic <acronym title="Data Transfer Object">DTO</acronym> that is used to describe many elements:</p>
<pre class="code">[DTOCollectionMapper(typeof(IdentifiedElement), "FromPoperty", "Identifier=Identifier",
"Child.Name=Name")]
public List Children;</pre>
<p>Finally where the conversions are more complex the type for the property can describe its own conversion:</p>
<pre class="code">Public class RelatedChildDTO {
     [DTOSimpleMapper("Identifier")] public int Identifier;
     [DTOSimpleMapper("Name")] public string Name;
}
Public class ParentDTO {
     [DTOSimpleMapper("Child")]
     public RelatedChildDTO Child;
}</pre>
<p>With the above example the converter will check the type of instance it is creating and use the attributes described on that type to perform the conversion.</p>
<h2>Conditional Population</h2>
<p>Both of the attributes allow for Type conditional conversions as well, both are overloaded with a type property that is checked in the conversion process and only performed when the origin type is the same:</p>
<pre class="code">[DTOSimpleMapper(typeof(ConditionalBusinessObject), "FromProperty")]
public string ConvertedProperty;</pre>
<h2>Automatic Conversion</h2>
<p>Now you have described the way objects are converted we are left with actual conversion, the library has a Converter class with a simple static method called Convert. This method takes an instance of an origin object and a type for the destination object.</p>
<pre class="code">BusinessObject bus = new BusinessObject();
// set business properties
DTO dto = (DTO)Convertor.Convert(bus, typeof(DTO));</pre>
<p>The result of this method call is that the <acronym title="Data Transfer Object">DTO</acronym> is created and populated using the attributes, the conversion is done!<br />
Here is the <a href="http://www.barryjones.me.uk/wp-content/uploads/2009/10/BarryJones.DataTransferObjects.zip">source code</a>, it contains test classes which should give you a better idea of how it all works, enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryjones.me.uk/2009/10/automatically-populate-dtos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

