<?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>Legomaster Building and Coding &#187; travis</title>
	<atom:link href="http://legomaster.net/author/travis/feed/" rel="self" type="application/rss+xml" />
	<link>http://legomaster.net</link>
	<description>Building Better Code</description>
	<lastBuildDate>Thu, 23 Jun 2011 01:00:52 +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>MonoMobile.MVVM, Round 2</title>
		<link>http://legomaster.net/2011/06/monomobile-mvvm-round-2/</link>
		<comments>http://legomaster.net/2011/06/monomobile-mvvm-round-2/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 18:51:12 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[MonoMobile.MVVM]]></category>
		<category><![CDATA[MVVM]]></category>

		<guid isPermaLink="false">http://legomaster.net/?p=167</guid>
		<description><![CDATA[So, from part 1 with MonoMobile.MVVM we can add some controls to a screen. That has limited usefulness since rarely do you need just one page a few entry controls for any apps, even data driven apps. Now let&#8217;s make something that&#8217;s almost useful. We won&#8217;t persist data right now, but that can be tacked [...]]]></description>
			<content:encoded><![CDATA[<p>So, from <a href="/2011/06/monomobile-mvvm-round-1/">part 1</a> with <a href="https://github.com/RobertKozak/MonoMobile.MVVM">MonoMobile.MVVM</a> we can add some controls to a screen. That has limited usefulness since rarely do you need just one page a few entry controls for any apps, even data driven apps. </p>
<p>Now let&#8217;s make something that&#8217;s almost useful. We won&#8217;t persist data right now, but that can be tacked on later. </p>
<p>We&#8217;ll have to start with a new View. </p>
<pre class="brush: csharp; title: ; notranslate">
public class NotesView : View
{
	public NotesView ()
	{
		var dataModel = new NotesDataModel ();
		Notes = new ObservableCollection&lt;NoteViewModel&gt; ();
		foreach (var item in dataModel.Load ())
			Notes.Add (item);
	}
	[List(ViewType = typeof(NoteView))]
	public ObservableCollection&lt;NoteViewModel&gt; Notes { get; set; }
}
</pre>
<p>We apply the <code>[List]</code> attribute so that this property is the basis for this view.The constructor loads up a DataModel to generate some generic data. I wouldn&#8217;t worry about that part right now, it will change when we build in persistance later. </p>
<p>Just for completeness, here&#8217;s my DataModel</p>
<pre class="brush: csharp; title: ; notranslate">

public class NotesDataModel
{
	public IEnumerable&lt;NoteViewModel&gt; Load ()
	{
		return new List&lt;NoteViewModel&gt; {
				new NoteViewModel { Name = &quot;One&quot; },
				new NoteViewModel { Name = &quot;Two&quot; },
				new NoteViewModel { Name = &quot;Three&quot; },
				new NoteViewModel { Name = &quot;Four&quot; },
				new NoteViewModel { Name = &quot;Five&quot; },
				new NoteViewModel { Name = &quot;Six&quot; },
				new NoteViewModel { Name = &quot;Seven&quot; },
				new NoteViewModel { Name = &quot;Eight&quot; },
				new NoteViewModel { Name = &quot;Nine&quot; },
				new NoteViewModel { Name = &quot;Ten&quot; },
				new NoteViewModel { Name = &quot;Eleven&quot; },
				new NoteViewModel { Name = &quot;Dozen&quot; }
			};
	}
}
</pre>
<p>So we need the NoteViewModel since that&#8217;s what we&#8217;re binding to the front end&#8230; </p>
<pre class="brush: csharp; title: ; notranslate">
public class NoteViewModel : ViewModel
{
	public string Name {
		get { return Get (() =&gt; Name); }
		set { Set (() =&gt; Name, value); }
	}
	public string Text {
		get { return Get (() =&gt; Text); }
		set { Set (() =&gt; Text, value); }
	}

	public override string ToString ()
	{
		return Name;
	}
}
</pre>
<p>Note: See Robert&#8217;s comment below, but the <code>Get(() => ...)</code> and <code>Set(() => ...)</code> blocks are helpers for <code>INotifyPropertyChanged</code> implementations. </p>
<p>The <code>ToString()</code> override is important. This is what is used to define what appears in the list view for each item. Play around with the <code>ToString()</code> if you want to have some fun! The <code>Get</code> and <code>Set</code> overrides supports notifications between data bindings. </p>
<p>Last thing we need to add is the view referenced to display the actual note details</p>
<pre class="brush: csharp; title: ; notranslate">
public class NoteView : View
{
	[Section]
	[Entry]
	public string Name { get; set; }

	[Section(&quot;Note&quot;)]
	[Entry]
	[Multiline]
	[Caption(&quot;&quot;)]
	public string Text { get; set; }
}
</pre>
<p>Then from our last example, you&#8217;ll need to change the starting view. </p>
<pre class="brush: csharp; title: ; notranslate">
public class Application : MonoMobileApplication
{
	public static new void Main (string[] args)
	{
		Run (&quot;Sample&quot;, typeof(NotesView), args);
	}
}
</pre>
<p>This should get you to a working example. Nothing amazing. Next time we can consider persistance!</p>
]]></content:encoded>
			<wfw:commentRss>http://legomaster.net/2011/06/monomobile-mvvm-round-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Parsing Balsamiq Files</title>
		<link>http://legomaster.net/2011/06/parsing-balsamiq-files/</link>
		<comments>http://legomaster.net/2011/06/parsing-balsamiq-files/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 21:52:17 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Balsamiq]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://legomaster.net/?p=171</guid>
		<description><![CDATA[I had the joy of building out some stuff from Balsamiq. This was the first prototype I developed, around making sure a control hierarchy could be generated even though Balsamiq just considers everything as layers. It&#8217;s not amazing, but it&#8217;s a start if someone wants to understand the data from one of those files. You [...]]]></description>
			<content:encoded><![CDATA[<p>I had the joy of building out some stuff from <a href="http://www.balsamiq.com/">Balsamiq</a>. This was the first prototype I developed, around making sure a control hierarchy could be generated even though Balsamiq just considers everything as layers. It&#8217;s not amazing, but it&#8217;s a start if someone wants to understand the data from one of those files. </p>
<p><script src="https://gist.github.com/1027904.js?file=PageObjectHierarchy.cs"></script></p>
<p><script src="https://gist.github.com/1027904.js?file=PageObjectHierarchyExtentions.cs"></script></p>
<p><script src="https://gist.github.com/1027904.js?file=BalsamiqParser.cs"></script></p>
<p>You get a collection of <code>PageObjectHierarchy</code>s back from the parser in which you can do whatever you want. The collection should have all child objects as children and not part of the base collection. Have fun with it!</p>
]]></content:encoded>
			<wfw:commentRss>http://legomaster.net/2011/06/parsing-balsamiq-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MonoMobile.MVVM, Round 1</title>
		<link>http://legomaster.net/2011/06/monomobile-mvvm-round-1/</link>
		<comments>http://legomaster.net/2011/06/monomobile-mvvm-round-1/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 23:26:27 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[MonoMobile.MVVM]]></category>
		<category><![CDATA[MVVM]]></category>

		<guid isPermaLink="false">http://legomaster.net/?p=152</guid>
		<description><![CDATA[Robert Kozak has started MonoMobile.MVVM, a MVVM framework for Mono on iOS. What this provides, is a great and easy way to work with data-driven applications on the iOS platform. I&#8217;ll walk through setting up a simple application with a few elements on it. We&#8217;ll start with MonoDevelop, on the Mac. When the project loads, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/#!/RobertKozak">Robert Kozak</a> has started <a href="https://github.com/RobertKozak/MonoMobile.MVVM">MonoMobile.MVVM</a>, a MVVM framework for <a href="http://mono-project.com/Main_Page">Mono</a> on iOS. What this provides, is a great and easy way to work with data-driven applications on the iOS platform. I&#8217;ll walk through setting up a simple application with a few elements on it. </p>
<p>We&#8217;ll start with <a href="http://monodevelop.com/">MonoDevelop</a>, on the Mac. </p>
<p><a href="http://legomaster.net/wp-content/uploads/2011/06/new-project.png"><img src="http://legomaster.net/wp-content/uploads/2011/06/new-project-300x232.png" alt="" title="new project" width="300" height="232" class="alignnone size-medium wp-image-153" /></a></p>
<p>When the project loads, you&#8217;ll see a couple <code>.xib</code> files in the project. These you can safely ignore for now. Select the project, right click, and goto options. Here you&#8217;ll see an option to set the starter <code>.xib</code> file for the application. Go ahead and remove that. </p>
<p><a href="http://legomaster.net/wp-content/uploads/2011/06/remove-xib.png"><img src="http://legomaster.net/wp-content/uploads/2011/06/remove-xib-300x200.png" alt="" title="remove xib" width="300" height="200" class="alignnone size-medium wp-image-154" /></a> </p>
<p>Next we need to add a reference to MonoMobile.MVVM. If you already have downloaded a built the project, add a reference to the project, to the location of the built <code>MonoMoble.MVVM.dll</code>.</p>
<p><a href="http://legomaster.net/wp-content/uploads/2011/06/edit-references.png"><img src="http://legomaster.net/wp-content/uploads/2011/06/edit-references.png" alt="" title="edit references" width="265" height="246" class="alignnone size-full wp-image-155" /></a></p>
<p>Now, in Main.cs, you&#8217;ll find a small block of code. </p>
<pre class="brush: csharp; title: ; notranslate">
public class Application
{
	static void Main (string[] args)
	{
		UIApplication.Main (args);
	}
}
</pre>
<p>Now replace it with the following below. Make sure you add a <code>using MonoMobile.MVVM;</code> so the references work. </p>
<pre class="brush: csharp; title: ; notranslate">
public class Application : MonoMobileApplication
{
	public static new void Main (string[] args)
	{
		Run (&quot;Sample&quot;, typeof(BasicView), args);
	}
}

public class BasicView : View
{
	public bool TestOnOff { get; set; }

	[Button]
	public void PressDown()
	{
	}
}
</pre>
<p>Make sure it builds, then we have a working iPhone application. </p>
<p><a href="http://legomaster.net/wp-content/uploads/2011/06/iphone-simulator.png"><img src="http://legomaster.net/wp-content/uploads/2011/06/iphone-simulator.png" alt="" title="iphone simulator" width="396" height="744" class="alignnone size-full wp-image-156" /></a></p>
<p>Now how is the UI built you might ask? Why from <code>BasicView</code> class that we pasted in. It has two elements, a boolean value and a method we applied the button attribute to. So those are the elements that appeared in the UI when we ran it. The UI is generated based upon the data elements in this View Model. </p>
<p>Well, that&#8217;s interesting and all, but there&#8217;s not a lot going on there. What else can we do? Lots! (Check out the ReadMe in the project for some more ideas)&#8230;</p>
<pre class="brush: csharp; title: ; notranslate">
public class BasicView : View
{
	public bool TestOnOff { get; set; }

	[Caption(&quot;Why?&quot;)]
	[Entry]
	public string Why { get; set; }

	[Section(&quot;Actions&quot;)]
	[Button]
	public void PressDown()
	{
	}

	[NavbarButton]
	public void Done()
	{
	}
}
</pre>
<p><a href="http://legomaster.net/wp-content/uploads/2011/06/emulator-two.png"><img src="http://legomaster.net/wp-content/uploads/2011/06/emulator-two.png" alt="" title="emulator two" width="396" height="744" class="alignnone size-full wp-image-158" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://legomaster.net/2011/06/monomobile-mvvm-round-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cashbox for Mobile</title>
		<link>http://legomaster.net/2011/05/cashbox-for-mobile/</link>
		<comments>http://legomaster.net/2011/05/cashbox-for-mobile/#comments</comments>
		<pubDate>Tue, 24 May 2011 15:08:47 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Cashbox]]></category>
		<category><![CDATA[Document Store]]></category>
		<category><![CDATA[Moble]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://legomaster.net/?p=118</guid>
		<description><![CDATA[Cashbox now has a version that runs in WP7. This uses Isolated Storage instead of a file stream for storage and a slightly different JSON serializer that can run without codegen. This approach should work with other mobile platforms using mono once Xamarin has new .NET for platform ready. Setting up your app to use [...]]]></description>
			<content:encoded><![CDATA[<p><a href='https://github.com/Cashbox/Cashbox/' >Cashbox</a> now has a version that runs in <acronym title='Windows Phone 7'>WP7</acronym>. This uses Isolated Storage instead of a file stream for storage and a slightly different JSON serializer that can run without codegen. This approach should work with other mobile platforms using <a href='http://mono-project.org'>mono</a> once <a href='http://www.xamarin.com/'>Xamarin</a> has new .NET for <em>platform</em> ready. Setting up your app to use a <code>DocumentSession</code> is really easy. </p>
<p><script src="https://gist.github.com/988878.js?file=App.xaml.cs"></script></p>
<p>The API should be the same as the regular build of Cashbox. </p>
<p><script src="https://gist.github.com/988878.js?file=example.cs"></script></p>
<p><a href='https://github.com/Cashbox/Cashbox/downloads'>Download</a> for fun today! Post any <a href='https://github.com/Cashbox/Cashbox/issues'>issues on github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://legomaster.net/2011/05/cashbox-for-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cashbox v1.0</title>
		<link>http://legomaster.net/2011/03/cashbox-v1-0/</link>
		<comments>http://legomaster.net/2011/03/cashbox-v1-0/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 01:37:36 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Cashbox]]></category>
		<category><![CDATA[Document Store]]></category>
		<category><![CDATA[NoSQL]]></category>

		<guid isPermaLink="false">http://legomaster.net/?p=107</guid>
		<description><![CDATA[Cashbox 1.0 is ready! For all your document store needs. I think most of the important things are covered nicely in the comments of the code sample below. Know that every 100 writes (store/delete) a temp file is created to compact space. Currently this isn&#8217;t configurable but will likely be in the future. Get Cashbox [...]]]></description>
			<content:encoded><![CDATA[<p>Cashbox 1.0 is ready! For all your document store needs. I think most of the important things are covered nicely in the comments of the code sample below. Know that every 100 writes (store/delete) a temp file is created to compact space. Currently this isn&#8217;t configurable but will likely be in the future. <a href="https://github.com/Cashbox/Cashbox">Get Cashbox</a> from the &#8220;Downloads&#8221; button!</p>
<p><script src="https://gist.github.com/875510.js?file=cashboxexample.cs"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://legomaster.net/2011/03/cashbox-v1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing Topshelf 2.2</title>
		<link>http://legomaster.net/2011/02/announcing-topshelf-2-2/</link>
		<comments>http://legomaster.net/2011/02/announcing-topshelf-2-2/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 00:14:13 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Topshelf]]></category>
		<category><![CDATA[Windows Services]]></category>

		<guid isPermaLink="false">http://legomaster.net/?p=94</guid>
		<description><![CDATA[We have a new version of Topshelf ready for your consumption. So let&#8217;s see what&#8217;s new! Get it, from codebetter&#8217;s teamcity or from github. Issues? Let us know or reach out to us on the mailing list. Web based dashboard You can access a web-based dashboard showing the services that are running inside the host. [...]]]></description>
			<content:encoded><![CDATA[<p>We have a new version of Topshelf ready for your consumption. So let&#8217;s see what&#8217;s new!</p>
<p>Get it, from <a href="http://teamcity.codebetter.com/repository/download/bt48/22015:id/Topshelf.v2.2.0.0.zip">codebetter&#8217;s teamcity</a> or from <a href="https://github.com/downloads/Topshelf/Topshelf/Topshelf.v2.2.0.0.zip">github</a>.</p>
<p>Issues? <a href="https://github.com/Topshelf/Topshelf/issues">Let us know</a> or reach out to us on the <a href="http://groups.google.com/group/topshelf-discuss">mailing list</a>.</p>
<p><strong>Web based dashboard</strong><br />
You can access a web-based dashboard showing the services that are running inside the host. This feature is still in the experimental stage and might be subject to change as we finish flushing it out.</p>
<p><a href="http://legomaster.net/wp-content/uploads/2011/02/dashboard.png"><img src="http://legomaster.net/wp-content/uploads/2011/02/dashboard.png" alt="" title="dashboard" width="508" height="116" class="alignnone size-full wp-image-100" /></a></p>
<p><strong>Post Install/Uninstall custom actions</strong><br />
Thanks to Eric Lee for this implementation, you can configuration actions for things such as installing performance counters.</p>
<p><strong>Service interactions</strong><br />
<tt>myservice start</tt> and <tt>myservice stop</tt> now work, as well as <tt>myservice install start</tt></p>
<p><strong>Backend upgrade</strong><br />
The backend and configuration code got an upgrade. We will have a new configuration DSL with 3.0, it should appear to work as is now but much of the new configuration API is accessible.</p>
<p><strong>Windows service recovery options</strong><br />
We now show configuration for service recovery options but the calls to the win32 APIs aren&#8217;t working for us. If someone has some experience in this area and wants to fix it, please feel welcomed to do so.</p>
<p><strong>Bug fixes, etc</strong></p>
<ul>
<li>Installation without descriptions no longer fail</li>
<li>username/password accepted on command line</li>
<li>support for non-standard services folder in shelving</li>
<li>normal service hosting no longer spins up WCF pipes</li>
<li>unnamed WCF behaviors no longer break Topshelf</li>
<li><tt>--sudo</tt> option to show UAC if no admin when running</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://legomaster.net/2011/02/announcing-topshelf-2-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Announcing a Simple NoSQL/Document Store: Cashbox</title>
		<link>http://legomaster.net/2011/01/announcing-cashbox/</link>
		<comments>http://legomaster.net/2011/01/announcing-cashbox/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 14:36:21 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Cashbox]]></category>
		<category><![CDATA[Document Store]]></category>
		<category><![CDATA[NoSQL]]></category>

		<guid isPermaLink="false">http://legomaster.net/?p=90</guid>
		<description><![CDATA[I have been unable to find a completely managed, zero config document store. So I wrote one&#8230; The use case for this is&#8230; data only needed in a single process want zero configuration limited amount of data, millions of records will likely become slow want all managed code If you need something with higher performance, [...]]]></description>
			<content:encoded><![CDATA[<p>I have been unable to find a completely managed, zero config document store. So I wrote one&#8230;</p>
<p>The use case for this is&#8230;</p>
<ul>
<li>data only needed in a single process</li>
<li>want zero configuration</li>
<li>limited amount of data, millions of records will likely become slow</li>
<li>want all managed code</li>
</ul>
<p>If you need something with higher performance, multiple clients, or shared across many processes I would stick with other document stores out there. However, if you needs are simple, here you go. I am releasing this as a v0.9, &#8220;works on my box&#8221;/RC version. If someone has a need for it, please try it and provide feedback on the <a href="https://github.com/Cashbox/Cashbox">Cashbox Github page</a>. Just drop in an issue. </p>
<pre class="brush: csharp; title: ; notranslate">
using (Cashbox.DocumentSession session =
               Cashbox.DocumentSessionFactory.Create(storeFilename))
{
	for (int i = 0; i &lt;100; i++)
	{
		string key = i.ToString();
		session.Store&lt;TestDocument&gt;(key, new TestDocument(i));
	} // inserted some records, with a simple numeric key

	session.Delete&lt;TestDocument&gt;(55.ToString()); // delete a record

	session.Retrieve&lt;TestDocument&gt;(55.ToString()); // should be null

	session.Retrieve&lt;TestDocument&gt;(10).IntValue; // should be 10
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://legomaster.net/2011/01/announcing-cashbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Topshelf 2.1</title>
		<link>http://legomaster.net/2010/11/topshelf-2-1/</link>
		<comments>http://legomaster.net/2010/11/topshelf-2-1/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 14:51:11 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Topshelf]]></category>
		<category><![CDATA[Windows Services]]></category>

		<guid isPermaLink="false">http://legomaster.net/?p=88</guid>
		<description><![CDATA[Topshelf 2.1 has been released. See the github page and hit the downloads button to get a release. This is mostly a bug fix release and I would suggest all users upgrade. General better state handling better logging an exception handling [including issue #15] corrected bug in message handling fixed handling of instance command line [...]]]></description>
			<content:encoded><![CDATA[<p>Topshelf 2.1 has been released. See the <a href="https://github.com/Topshelf/Topshelf">github</a> page and hit the downloads button to get a release. This is mostly a bug fix release and I would suggest all users upgrade. </p>
<h3>General</h3>
<ul>
<li>better state handling</li>
<li>better logging an exception handling [including <a href="https://github.com/Topshelf/Topshelf/issues/closed#issue/15">issue #15</a>]</li>
<li>corrected bug in message handling</li>
<li>fixed handling of instance command line argument [<a href="https://github.com/Topshelf/Topshelf/issues/closed#issue/13">issue #13</a>, thanks Ramon]</li>
</ul>
<h3>Shelving</h3>
<ul>
<li>host, by default, will not crash when a unhandled exception happens</li>
<li>host has an icon</li>
<li>log4net should unload when the app domain does</li>
</ul>
<p>Some things I think should be addressed shortly&#8230;</p>
<ul>
<li>ignore folders starting with underscore in shelving</li>
<li>auto discovery of bootstrapper in shelving</li>
</ul>
<p>Please, submit any bugs on the github <a href="https://github.com/Topshelf/Topshelf/issues">issues</a> page or hit us up on the mailing list. </p>
]]></content:encoded>
			<wfw:commentRss>http://legomaster.net/2010/11/topshelf-2-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MassTransit Distributor (Load Balancing)</title>
		<link>http://legomaster.net/2010/08/masstransit-distributor-load-balancing/</link>
		<comments>http://legomaster.net/2010/08/masstransit-distributor-load-balancing/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 14:20:06 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[Load Balancing]]></category>
		<category><![CDATA[MassTransit]]></category>
		<category><![CDATA[Messaging]]></category>

		<guid isPermaLink="false">http://legomaster.net/?p=82</guid>
		<description><![CDATA[<a href="http://masstransit-project.com/">MassTransit</a> has a distributor built in now (actually for some time...). I'll try to explain what it does and how to use it. 

What is the distributor? It provides the ability to load balancing across multiple endpoints for a given message.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://masstransit-project.com/">MassTransit</a> has a distributor built in now (actually for some time&#8230;). I&#8217;ll try to explain what it does and how to use it. </p>
<p>What is the distributor? It provides the ability to load balancing across multiple endpoints for a given message.</p>
<h2>Distributor Setup</h2>
<p>For setting up the distributor, when doing the service bus configuration, call <code>UseDisttributorFor<T>(IEndpointFactory endpointFactory)</code> on <code>IServiceBusConfigurator</code>. An instance of the endpoint factory is required. </p>
<p>For setting up the worker(s), when doing the service bus configuration, call <code>ImplementDistributorWorker<T>(Action<T> consumeAction) </code>on <code>IServiceBusConfigurator</code>. </p>
<h2>Default <code>IWorkerSelectionStrategy</code> Implementation</h2>
<p>The default worker selection strategy simple looks at the current message count in queue vs. the message count limits. It selects the worker with the smallest number of messages pending or in progress. </p>
<p>The data used to identify which worker is busy might be out of date. There is additional message traffic to keep this data in sync and it can fall behind when the system is under load. </p>
<h2>Custom <code>IWorkerSelectionStrategy</code></h2>
<p>For setting up the distributor, when doing the service bus configuration, call <code>UseDisttributorFor<T>(IEndpointFactory endpointFactory, IWorkerSelectionStrategy<T> workerSelectionStrategy)</code> on <code>IServiceBusConfigurator</code>. </p>
<p>This requires a custom implementation of the <code>IWorkerSelectionStrategy<T></code> interface. There are two methods to implement.</p>
<ul>
<li><code>HasAvaiableWorker </code>- Using the list of candidate workers, indicates if one is available</li>
<li><code>SelectWorker </code>- Using the list of candidate workers, find the best candidate available</li>
</ul>
<h2>Sample</h2>
<p>Okay, so I know you&#8217;re now asking if I&#8217;ll get to any real code. There&#8217;s a sample in the MT solution <a href="http://github.com/MassTransit/MassTransit/tree/master/src/Samples/Grid.Distributor/">Grid.Distributor</a> that shows the basics of using the Distributor. </p>
<p>There are two parts, the activator (who sends commands) and the workers (who completes the commands). You can spin up multiple workers to work on the commands. </p>
]]></content:encoded>
			<wfw:commentRss>http://legomaster.net/2010/08/masstransit-distributor-load-balancing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Topshelf 2.0 Released!</title>
		<link>http://legomaster.net/2010/08/topshelf-2-0-released/</link>
		<comments>http://legomaster.net/2010/08/topshelf-2-0-released/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 23:13:00 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Topshelf]]></category>
		<category><![CDATA[Windows Services]]></category>

		<guid isPermaLink="false">http://legomaster.net/?p=78</guid>
		<description><![CDATA[Topshelf 2.0 was released today! You can get it at Topshelf&#8217;s github. 2.0.1 was also released today! A bugfix release&#8230; Shelving: renamed events no longer cause exceptions Shelving: less likely for a service to start up then re-start again right away There are a couple known issues though&#8230; Some log4net log events seem to be [...]]]></description>
			<content:encoded><![CDATA[<p>Topshelf 2.0 was released today! You can get it at <a href="http://github.com/Topshelf/Topshelf/downloads">Topshelf&#8217;s github</a>. </p>
<p>2.0.1 was also released today! A bugfix release&#8230;</p>
<ul>
<li>Shelving: renamed events no longer cause exceptions</li>
<li>Shelving: less likely for a service to start up then re-start again right away</li>
</ul>
<p>There are a couple known issues though&#8230;</p>
<ul>
<li>Some log4net log events seem to be squelched. This might be related to ilmerging we started doing for releases. When it&#8217;s run from source I don&#8217;t see this behavior but I am looking into it.</li>
<li>When shutting down you might see an exception about a pipe not being open. There are a lot of threads &#8216;doing&#8217; stuff to keep everything going right. When shutting down it seems possible for them to not shut down in the right order. I have spent some time trying to pin it down exactly and I haven&#8217;t gotten it yet. I haven&#8217;t seen any negative side effects from it yet though.</li>
</ul>
<p>Thanks to everyone who&#8217;s tried it out so far!</p>
]]></content:encoded>
			<wfw:commentRss>http://legomaster.net/2010/08/topshelf-2-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

