<?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>Elegant Code &#187; Scott Nichols</title>
	<atom:link href="http://elegantcode.com/author/nichols/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 20 Jul 2010 12:52:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>RIA The Death of Server Page Development</title>
		<link>http://elegantcode.com/2009/03/26/ria-the-death-of-server-page-development/</link>
		<comments>http://elegantcode.com/2009/03/26/ria-the-death-of-server-page-development/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 06:34:01 +0000</pubDate>
		<dc:creator>Scott Nichols</dc:creator>
				<category><![CDATA[Esoterica]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2009/03/26/ria-the-death-of-server-page-development/</guid>
		<description><![CDATA[A good friend of mine and fellow Elegant Coder forwarded me an article the other day, Silverlight 3 might kill Windows Presentation Foundation, and wanted to know my opinion.&#160;&#160; This article is interesting but I think they have it slightly wrong.&#160; I do not believe people fully understand the technologies and how they stack up [...]]]></description>
			<content:encoded><![CDATA[<p>A good friend of mine and fellow Elegant Coder forwarded me an article the other day, <a href="http://www.sdtimes.com/link/33355" target="_blank">Silverlight 3 might kill Windows Presentation Foundation</a>, and wanted to know my opinion.&#160;&#160; This article is interesting but I think they have it slightly wrong.&#160; I do not believe people fully understand the technologies and how they stack up together or should I say work together because they do work together quite well!&#160;&#160;&#160;&#160; </p>
<p>There are clear distinctions and usages for both WPF and Silverlight with a clear roadmap from the product teams.&#160; But do not take my word for it. Here are two very good videos from Microsoft about these technologies:&#160;&#160; </p>
<p>The first from <a href="http://channel9.msdn.com/posts/Charles/Scott-Guthrie-Inside-Silverlight-3/" target="_blank">Scott Guthrie Inside Silverlight 3</a> and the second from Jeff Wilcox <a href="http://videos.visitmix.com/MIX09/T87F" target="_blank">Sharing Skills and Code with Silverlight &amp; WPF</a>&#160; </p>
<p>Now, before I jump on my soapbox on Server Page development and its demise it is probably important to clarify a few more distinctions between Silverlight 3 and WPF.&#160;&#160; First, I am ecstatic that Microsoft is doing everything in their power to make the programming experience between their two XAML based platforms more seamless. But there are some big differences that help a developer decide between the two. </p>
<p>Silverlight 3 is an RIA (rich internet application) platform product and as such means that it has certain limitations by design, mainly the browser security sandbox. Yes, Silverlight 3 can run outside of the browser now, but it still has the same security restrictions applied, it cannot run as a full trust app, it cannot take advantage of ClinkOnce, which is very important for certain business needs.&#160; The Silverlight framework is lean and mean which is awesome and needed for an RIA based application that has to compete and utterly destroy FLEX/AIR (that is the goal right).&#160; However, these lean frameworks come at a price.&#160; Silverlight or FLEX cannot achieve the same performance levels as WPF running under the full .Net framework in full trust mode.&#160; Complex engineering/manufacturing/etc. systems will run much more performant, with a greater set of capabilities under WPF.&#160;&#160; </p>
<p>At my particular place of employment almost all the systems we build are expert systems that at some point will require modules which need to import large amounts of data from other systems for local manipulation and processing.&#160; We also find ourselves having to have local data stores with sync capabilities against the master DB i.e. our engineers and power users can work in the field for days at a time before reconnecting.&#160; WPF has to be used for these scenarios. </p>
<p>All other scenarios Silverlight is more than adequate to handle and is preferred.&#160;&#160; This is a total guess on my part but I bet it is at least a 20 to 1 ratio between Silverlight vs. full WPF in terms of applications produced. </p>
<p>My company has a very successful Adobe FLEX development team.&#160; I have seen first hand how powerful the RIA FLEX/AIR platform has become.&#160; They have successfully met all their deadlines and under budget.&#160; More importantly, the quality of the applications produced by our FLEX team has been outstanding.&#160; FLEX has not been able to replace any of the more complicated think client expert systems (as no RIA can) but our web apps are a whole other store.&#160; They replaced all there classic Server Page based applications (JSP and PHP) with much more capable and performant FLEX apps.&#160; </p>
<p>As the .Net team lead at my company I HAD grounds to be nervous.&#160; These are not successes an old .Net programmer wants to see from the competition so to speak.&#160; </p>
<p>What my team is actually doing at work is NOT choosing between the Silverlight and WPF platforms.&#160; We build both a WPF and Silverlight client using the PrismV2 or I should say <a href="http://www.codeplex.com/CompositeWPF" target="_blank">Composite WPF and Silverlight Guidance</a> as well as the <a href="http://www.lhotka.net/Default.aspx" target="_blank">CSLA Business Object</a> framework to make the job even easier when working between these products.&#160; </p>
<p>We start with the WPF project.&#160; That is where all the base classes and lower level API stuff is created, i.e. the Model(s), Controller(s), ViewModel(s) and Services.&#160; Then we create the Silverlight project and reference all the libs from the WPF side of the solution.&#160; In some cases we can even share the same XAML Views but in most each project will need its own set of views.&#160; Using Prism and CSLA we can bridge the shortcomings of Silverlight, i.e. its commanding, tunnel eventing and data binding models do not quite match up with WPFs power.&#160; Prism and CSLA make these differences negligible.&#160; At the end of the day, I would say I am getting almost 85% to 90% code reuse between our WPF client app and its Silverlight counter part.&#160; Our clients get the best of both worlds with very little extra expense.&#160; </p>
<p>As unfortunate as it is, ASP.Net does not stand a chance in my case with competing with the FLEX/AIR power house.&#160; However, with Microsoft&#8217;s two very powerful XAML based products WPF and Silverlight 3 I not only stand a chance but can out perform the Adobe counter part quite easily.&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p>
<p>With Silverlight 3 I have already told our director that we will never build another Server Page anything (thin client) again.&#160; No offense to our JQuery and AJAX friends but it has totally been obsoleted with Silverlight 3 and FLEX/AIR.&#160; In my future, I do not see a need for ASP.Net developers.&#160; I only want XAML developers to build me Silverlight (lots of them) and WPF (less of a ratio) apps. </p>
<p>I&#8217;ll admit these are bold words, but in a shop like mine where corporate LOB (line of business) app development is the norm RIA platforms have become the new King of the Hill with the occasional thick client counter part.&#160;&#160;&#160; </p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2009/03/26/ria-the-death-of-server-page-development/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Importance of a Personal Development Plan</title>
		<link>http://elegantcode.com/2008/08/20/importance-of-a-personal-development-plan/</link>
		<comments>http://elegantcode.com/2008/08/20/importance-of-a-personal-development-plan/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 06:02:24 +0000</pubDate>
		<dc:creator>Scott Nichols</dc:creator>
				<category><![CDATA[Esoterica]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/08/20/importance-of-a-personal-development-plan/</guid>
		<description><![CDATA[I first need to mention, this post is intended to be and interactive one as I will be posting a question to all the readers at the end, looking for some good feedback to help me with my training plan at work.
I am always amazed at the lack of personal responsibility many (the large majority) [...]]]></description>
			<content:encoded><![CDATA[<p>I first need to mention, this post is intended to be and interactive one as I will be posting a question to all the readers at the end, looking for some good feedback to help me with my training plan at work.
<p>I am always amazed at the lack of personal responsibility many (the large majority) developers display.&nbsp; Obviously skills that are learned act like building blocks and will carry you a long way.&nbsp; The problem is that our industry is one of the most dynamic and rapid changing of any out there.&nbsp; If you do not keep up with the ongoing industry innovations you can quickly find yourself being left behind and unmarketable.&nbsp; It is nice when you work for a company that is training minded and helps develop their employees but that is not the norm, and even then you still need to make a personal effort to progress your development skills.&nbsp; The only person that is going to truly look after your well being and future marketability is yourself.&nbsp;
<p>It has been interesting to observe over the past year or so how many open mid to senior level software engineer/developer positions are available.&nbsp; Many of these positions have been open for quite some time too.&nbsp; I have spoken to a few of these employers to ask how their recruiting efforts are going.&nbsp; I consistently hear the same echo, we have plenty of applicants just not finding people with the skill set we are looking for. Sure enough, the skills they are looking for are technologies and methodologies that are relatively new to our industry.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p>Some good news for the readers of this blog.&nbsp; By the sole fact that you are reading this post means you are among the top 10% to 15% of developers who are actively engaged in developing your craft.&nbsp; One of the departments I worked for had 68 software engineers.&nbsp; Of that group I only knew of 9 (13%) that were active BLOG readers, attend user groups or local geek events,&nbsp; frequently reviewed or read software books/journals/magazines,&nbsp; earnestly downloaded and experiment with beta software just because they wanted to, not because you were required to, or was part of some open source project giving time to make something cool to better our industry.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p>You can probably tell by now I am a strong advocate of employing people who are self motivated and will personally take charge of developing their skills.&nbsp; I hire people for what they know not what I can teach them (entry level positions excluded from that). Unfortunately I still have to work with and manage the other 85% to 90% who need to be told what to do.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p>NOW TO MY PLAN:
<p>I changed companies several months back.&nbsp; My new employer is training minded and very supportive, the unfortunate part is they have no formal training direction or requirements for the members of the IT department.&nbsp; As one of the companies Solution Architects I am seeing huge discrepancies and lack of standards throughout our department.&nbsp; One of the first things I want to implement is a mandatory book reading list.&nbsp; There will be three (sounds like a good number) books that every engineer will be required to read and signed off on.&nbsp; There will be an accompanying class/lab that goes along with each book to give some hands on reinforcement.
<p>First Book:
<p>Needs to target programming style and software construction.&nbsp; I have already chosen this one, I could not think of anything better then&nbsp; “Code Complete 2” by Steven McConnell, I am currently working on the class lab material for this book now.&nbsp;&nbsp; I am hoping this book and accompanying lab material will help get the developers on the same page regarding software construction standards.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p>Second Book:
<p>Will be on Design Patterns.&nbsp; I have not solidified my choice here yet only the category.&nbsp; There are lots of good titles to choice from here. Obviously there is the original design pattern book “Gang of Four” and newer pattern books like ”Head First Design Patterns”.&nbsp; What are your thoughts here?
<p>Third Book:
<p>I have nothing slated here yet.
<p>The question for you all is, if you were going to have three books with accompanying lab/presentation material which was going to be mandatory for all developers to read what would they be?&nbsp; Like many corporations we are multi platform so the books do not necessarily need to target a particular language but we are striving to standardized most our systems/applications on the Microsoft development stack so .Net is going to be a big part of our future.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p>Thanks
<p>Scott Nichols</p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/08/20/importance-of-a-personal-development-plan/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Unity 1.0 EventBroker Sample CAB Style</title>
		<link>http://elegantcode.com/2008/04/09/unity-10-eventbroker-sample-cab-style/</link>
		<comments>http://elegantcode.com/2008/04/09/unity-10-eventbroker-sample-cab-style/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 06:55:52 +0000</pubDate>
		<dc:creator>Scott Nichols</dc:creator>
				<category><![CDATA[Esoterica]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Tools and Utilities]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/09/unity-10-eventbroker-sample-cab-style/</guid>
		<description><![CDATA[Ok so Unity 1.0 has shipped, or should I say the “Unity Application Block” as Microsoft is terming it now. However, in this post I am not going to talk about the Unity IoC contain but a pretty cool peace of code that comes bundled with Unity’s QuickStart samples, the Event Broker Extension.
The Event Broker [...]]]></description>
			<content:encoded><![CDATA[<p>Ok so <a href="http://www.codeplex.com/unity">Unity 1.0</a> has shipped, or should I say the “Unity Application Block” as Microsoft is terming it now. However, in this post I am not going to talk about the Unity <a href="http://en.wikipedia.org/wiki/Inversion_of_Control">IoC</a> contain but a pretty cool peace of code that comes bundled with Unity’s QuickStart samples, the Event Broker Extension.</p>
<p>The Event Broker Extension QuickStart demonstrates how you can extend the Unity container by adding a custom extension. The QuickStart implements an Event Broker for the container as a container extension and demonstrates the new extension using the StopLight QuickStart application sample.</p>
<p>The Event Broker Extension QuickStart contains three projects:</p>
<ul>
<li><strong>EventBroker</strong>. This project implements a simple publish and subscribe mechanism that supports multiple event publishers and multiple subscribers.</li>
<li><strong>EventBrokerExtension</strong>. This project implements the custom container extension that allows applications to publish and subscribe to events using attributes or explicitly using code.</li>
<li><strong>StopLight</strong>. This project is basically the same as that described in the Unity StopLight QuickStart, but it uses the custom container extension to manage the publishing of, and subscription to, two events within the application.</li>
</ul>
<p>Now, why is this Unity EventBroker interesting? Well, if you have ever worked with <a href="http://www.cabpedia.com/index.php?title=Composite_UI_Application_Block">CAB</a> (Composite UI Application Block) or <a href="http://www.cabpedia.com/index.php?title=Smart_Client_Software_Factory">SCSF</a> (Smart Client Software Factory) then you know one of its main pillars was the implementation of a nice Pub/Sub event subscription framework which Microsoft called Event Broker. This was one of the best things about CAB. Unfortunately with CAB it is an all or nothing deal. You really cannot use the CAB Event Broker without using the rest of the CAB underpinnings.</p>
<p>The Unity implementation of the Event Broker is similar to CABs so you should feel right at home if you have any experience with CAB or SCSF. The one huge benefit is that the Unity Event Broker can easily be integrated into any existing WinForm or WPF application where you would like an easy to manage Event bus to handle all your event traffic.</p>
<p>It really is easy to implement, lets take a look at what you need to do in order to integrate the Unity based Event Broker into your application.</p>
<p>1) Download <a href="http://www.codeplex.com/unity">Unity 1.0</a> install it and unzip the “Unity QuickStart” package found in the Unity start menu installation path.</p>
<p>2) Compile the EventBrokerExtention and SimpleEventBroker projects.  Then grab the following DLLs found in the EventBrokerExtention bin folder and reference them in your application.<br />
  EventBrokerExtension.dll<br />
  SimpleEventBroker.dll<br />
  Microsoft.Practices.ObjectBuilder2.dll<br />
  Microsoft.Practices.Unity.dll</p>
<p>3) Now open your WinForm application and modify your entry point usually the Program.cs file which in my demo calls the FormMain.cs using a Unity Container like so.</p>
<pre class="csharpcode"><span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.Collections.Generic;
<span class="kwrd">using</span> System.Linq;
<span class="kwrd">using</span> System.Windows.Forms;
<span class="kwrd">using</span> EventBrokerExtension;
<span class="kwrd">using</span> Microsoft.Practices.Unity; 

<span class="kwrd">namespace</span> SampleWinApp
{
    <span class="kwrd">static</span> <span class="kwrd">class</span> Program
    {
        <span class="rem">/// &lt;summary&gt;</span>
        <span class="rem">/// The main entry point for the application.</span>
        <span class="rem">/// &lt;/summary&gt;</span>
        [STAThread]
        <span class="kwrd">static</span> <span class="kwrd">void</span> Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(<span class="kwrd">false</span>); 

            <span class="rem">// Create parent container</span>
            IUnityContainer mainContainer = <span class="kwrd">new</span> UnityContainer()
                  .AddNewExtension&lt;EventBrokerBusExtension&gt;(); 

            Application.Run(mainContainer.Resolve&lt;FormMain&gt;());
        }
    }
}</pre>
<p>The important thing to notice is that I have wired up the EventBrokerExtention class through the Unity AddNewExtention method.  This will cause all the Events that are properly decorated with the correct attributes to be automatically registered in the EventBroker or SimpleEventBroker class.</p>
<p>You will also want to go and modified all the areas in your code where you are opening other forms to use a Unity container as well.  Here is an example opening a Form called FromA.cs </p>
<pre class="csharpcode"><span class="rem">//Create container</span>
IUnityContainer myContainer = <span class="kwrd">new</span> UnityContainer()
           .AddNewExtension&lt;EventBrokerBusExtension&gt;();
<span class="rem">//Open Form</span>
FormA newForm = myContainer.Resolve&lt;FormA&gt;();
newForm.Show();</pre>
<style type="text/css">    .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt   {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p>Oh, make sure you import the proper libraries on all your forms.</p>
<pre class="csharpcode"><span class="kwrd">using</span> Microsoft.Practices.Unity;
<span class="kwrd">using</span> EventBrokerExtension;
<span class="kwrd">using</span> SimpleEventBroker;</pre>
<p>Now you need to setup all the Event publications and triggers. Let’s start simple, say we have a button on our FormMain that is used to force a data refresh in your application. You would need to add a publish event to your page like so.</p>
<pre class="csharpcode"><span class="rem">//Using an attribute register an event in the EventBroker</span>
[Publishes(<span class="str">"RefreshData"</span>)]
<span class="kwrd">public</span> <span class="kwrd">event</span> EventHandler RefreshData ;
<span class="rem">//Method you will call to trigger the event in the EventBroker </span>
<span class="kwrd">public</span> <span class="kwrd">virtual</span> <span class="kwrd">void</span> OnRefreshDataChange(<span class="kwrd">object</span> sender, EventArgs ea)
{
    EventHandler handlers = RefreshData ;
    <span class="kwrd">if</span> (handlers != <span class="kwrd">null</span>)
    {
        handlers(<span class="kwrd">this</span>, EventArgs.Empty);
    }
}</pre>
<p>On your button click trigger the event like so.</p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">void</span> buttonRefresh_Click(<span class="kwrd">object</span> sender, EventArgs e)
{
    <span class="rem">//Trigger your event </span>
    OnRefreshDataChange(<span class="kwrd">this</span>, e);
}</pre>
<p>Now you need to setup all your Event subscriptions, this is supper easy.  You will need to create a method on all the forms in your application that will handle your refresh command i.e. implements the functionality you wish for each form or control in your application.  So far in this contrived example I have two forms FormMain and FormA.  You would add a method like so to each page.    </p>
<pre class="csharpcode">[SubscribesTo(<span class="str">"RefreshData"</span>)]
<span class="kwrd">public</span> <span class="kwrd">void</span> OnRefreshDataFired(<span class="kwrd">object</span> sender, EventArgs e)
{
         <span class="rem">//Do something, we need to do a data refresh</span>
}</pre>
<style type="text/css">    .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt   {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p>Now anytime the RefreshData button is pushed the event is fired and all objects subscribed to that event in the EventBroker will be triggered. </p>
<p>One important step you will want to do is unregister your subscribed events every time a modal form is closed.  Remember we are using the Unity IoC container to open a form which automatically registers all publisher and subscriber event handles on form_load (opened). </p>
<pre class="csharpcode"><span class="rem">// Unregister your subscription to help prevent runtime errors</span>
<span class="kwrd">private</span> <span class="kwrd">void</span> FormA_FormClosing(<span class="kwrd">object</span> sender, FormClosingEventArgs e)
{
     EventBroker myEB = <span class="kwrd">new</span> EventBroker();
     myEB.UnregisterSubscriber(<span class="str">"RefreshData"</span>, OnRefreshDataFired);
}</pre>
<p>That is about it, I used this to clean up an old legacy application that had Window events thrown everywhere.  The SimpleEventBroker class has several methods you can use to monitor what is going on inside the EventBroker such as GetPublisher, GetSubscribers, etc.</p>
<p>Oh, in my implementation I modified the Dictionary in the SimpleEventBroker class which holds the registered published events to be static, makes it easier if you have lots of modal forms, just make sure the Keys (string values) are unique.</p>
<pre class="csharpcode">

<span class="kwrd">public</span> <span class="kwrd">class</span> EventBroker
    {
        <span class="kwrd">private</span> <span class="kwrd">static</span> Dictionary&lt;<span class="kwrd">string</span>, PublishedEvent&gt; eventPublishers  

        = <span class="kwrd">new</span> Dictionary&lt;<span class="kwrd">string</span>, PublishedEvent&gt;();</pre>
<style type="text/css">    .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt   {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/09/unity-10-eventbroker-sample-cab-style/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inline XML Code Documentation using Sandcastle</title>
		<link>http://elegantcode.com/2008/04/01/inline-xml-code-documentation-using-sandcastle/</link>
		<comments>http://elegantcode.com/2008/04/01/inline-xml-code-documentation-using-sandcastle/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 05:12:11 +0000</pubDate>
		<dc:creator>Scott Nichols</dc:creator>
				<category><![CDATA[Esoterica]]></category>
		<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Open Source Software]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/01/inline-xml-code-documentation-using-sandcastle/</guid>
		<description><![CDATA[Is it me, or have many people/projects stopped creating good API documentation via Inline XML comments in their source code.  A couple of years ago when nDoc was in full swing it seemed to be taboo if you did not markup your source code with good XML Comments and generate accompanied API documents.
For those of [...]]]></description>
			<content:encoded><![CDATA[<p>Is it me, or have many people/projects stopped creating good API documentation via Inline XML comments in their source code.  A couple of years ago when nDoc was in full swing it seemed to be taboo if you did not markup your source code with good XML Comments and generate accompanied API documents.</p>
<p>For those of you who many be asking what is he talking about, Inline XML comments in your source?  Well, that would be (in C#) all those /// comments you see from time to time in source code like so.</p>
<pre style="width: 100%; height: 297px" class="csharpcode"><span class="kwrd">namespace</span> TestNamespace
{
<span class="rem">/// &lt;summary&gt; </span>
<span class="rem">///    Tests whether sandcastle can handle all c# tags as defined at </span>
<span class="rem">///    http://msdn2.microsoft.com/en-us/library/5ast78ax.aspx. </span>
<span class="rem">///    Comments of method "Increment (int step)" include almost all tags. </span>
<span class="rem">///    Method "Swap" is used to test generics tags, such as "typeparam". </span>
<span class="rem">///    &lt;threadsafety static="true" instance="false"/&gt; </span>
<span class="rem">/// &lt;/summary&gt; </span>
[Serializable()]
<span class="kwrd">public</span> <span class="kwrd">class</span> StoredNumber
{  

<span class="rem">/// &lt;summary&gt; </span>
<span class="rem">///    Initializes the stored number class with a starting value. </span>
<span class="rem">/// &lt;/summary&gt; </span>
<span class="kwrd">public</span> StoredNumber( <span class="kwrd">int</span> <span class="kwrd">value</span> )
{ number = <span class="kwrd">value</span>; }</pre>
<style type="text/css">    .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt   {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p>However today, I have noticed that many open source projects and a good share of commercial applications do not bother marking up their source code with XML comments. Maybe one contributing factor is that nDoc died, ok you can still download version 1.3 but it is over two years old now and Microsoft’s answer to this solution Sandcastle is not quite as snazzy as nDoc was i.e. Command-line interface, or maybe propel are just not aware of their options. </p>
<p>The following information outlines what you need to install so you can create proper Inline API (MSDN-style) documentation.  Here is a list of programs you need to install.</p>
<p><strong>Sandcastle:</p>
<p></strong>Microsoft home page for <a href="http://www.sandcastledocs.com/Wiki%20Pages/Home.aspx">Sandcastle</a></p>
<p>You can download it from CodePlex <a href="http://www.codeplex.com/Sandcastle">http://www.codeplex.com/Sandcastle</a></p>
<p>Sandcastle, created by Microsoft, is a free tool used for creating MSDN-style documentation from .NET assemblies and their associated XML comment files. It is command-line based and has no GUI front-end, project management features, or an automated build process</p>
<p><strong>SHFB (Sandcastle Help File Builder):</strong></p>
<p>You can download SHFB from CodePlex <a href="http://www.codeplex.com/SHFB">http://www.codeplex.com/SHFB</a></p>
<p>SHFB is a GUI interface that almost looks identical to the NDoc interface so anyone familiar with NDoc should be quite comfortable using it.  It uses the underlining Sandcastle API to generate an HTML 1.x (.CHM) file, an HTML 2.x (.HxS) file, and/or a web site.</p>
<p>SHFB Requirements</p>
<p>In order to use SHFB you will need the following:</p>
<p>- The .NET 2.0 Framework</p>
<p>- The latest version of Sandcastle. <br />
- The HTML Help Workshop for building HTML Help 1.x (.CHM) help files</p>
<p>- The HTML 2.x compiler for building HTML Help 2.x (.HxS) help files</p>
<p>You can obtain the HTML builders by installing the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=30402623-93ca-479a-867c-04dc45164f5b&amp;displaylang=en">Visual Studio 2008 SDK</a> these are the latest builds.</p>
<p><strong>XML Documentation Comments Guide:</strong></p>
<p>Home page <a href="http://www.dynicity.com/downloads/default.aspx">http://www.dynicity.com/downloads/default.aspx</a></p>
<p>Download the “Windows Installer” at <a href="http://www.dynicity.com/downloads/XMLDocCommentsGuide.exe">http://www.dynicity.com/downloads/XMLDocCommentsGuide.exe</a></p>
<p>This is a help file with a very nice collection of information on how to use XML Comment tags properly in your source code, it has lots of links to some good tutorials and examples. </p>
<p><strong>DocProject for 2008:</strong></p>
<p>Home page from CodePlex for <a href="http://www.codeplex.com/DocProject/Release/ProjectReleases.aspx?ReleaseId=8231">DocProject</a></p>
<p>DocProject drives the Sandcastle help generation tools using the power of Visual Studio 2005/2008 and MSBuild. Choose from various project templates that build compiled help version 1.x or 2.x for all project references. DocProject facilitates the administration and development of project documentation with Sandcastle, allowing you to use the integrated tools of Visual Studio to customize Sandcastle&#8217;s output.</p>
<p><strong>Example Links</strong><strong>:</strong></p>
<p>.NET Documentation Guidelines (version 2.5)</p>
<p><a href="http://p3net.mvps.org/downloads/docs/DocGuidelines.doc">http://p3net.mvps.org/downloads/docs/DocGuidelines.doc</a> </p>
<p>XML Documentation in C# (Anson Horton, C# Compiler Program Manager)</p>
<p><a href="http://cyrino.members.winisp.net/9112006/XMLDocs.doc">http://cyrino.members.winisp.net/9112006/XMLDocs.doc</a></p>
<p>C# XML Documentation (Alan Dean)</p>
<p><a href="http://thoughtpad.net/alan-dean/cs-xml-documentation.html">http://thoughtpad.net/alan-dean/cs-xml-documentation.html</a></p>
<p><a href="http://www.codeproject.com/KB/XML/csharpcodedocumentation.aspx?df=100&amp;forumid=201254&amp;exp=0&amp;select=1237919">C# and XML Source Code Documentation</a></p>
<p><a href="http://www.winnershtriangle.com/w/Articles.XMLCommentsInCSharp.asp">Documenting C# source code with XML Comments</a></p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/01/inline-xml-code-documentation-using-sandcastle/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
