<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">

<channel>
	<title>PhatBoyG.com</title>
	
	<link>http://blog.phatboyg.com</link>
	<description>Software Developer, Husband, Father, Subaru Driver, Mac User, iPhone Flicker</description>
	<pubDate>Thu, 02 Jul 2009 00:14:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<geo:lat>35.992283</geo:lat><geo:long>-95.805426</geo:long><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/PhatBoyG" type="application/rss+xml" /><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FPhatBoyG" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FPhatBoyG" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FPhatBoyG" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><item>
		<title>I’m a Microsoft C# MVP!</title>
		<link>http://blog.phatboyg.com/2009/07/01/im-a-microsoft-c-mvp/</link>
		<comments>http://blog.phatboyg.com/2009/07/01/im-a-microsoft-c-mvp/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 00:14:00 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://blog.phatboyg.com/?p=784</guid>
		<description><![CDATA[Opening my Inbox this morning resulted in a pleasant surprise from Microsoft. I have been presented with the 2009 Microsoft&#174; MVP Award as a recognition for sharing my expertise in Visual C# with others. It is an honor to be recognized by Microsoft for doing something that I truly enjoy - building really cool software.


Microsoft [...]]]></description>
			<content:encoded><![CDATA[<p>Opening my Inbox this morning resulted in a pleasant surprise from Microsoft. I have been presented with the 2009 Microsoft&reg; MVP Award as a recognition for sharing my expertise in Visual C# with others. It is an honor to be recognized by Microsoft for doing something that I truly enjoy - building really cool software.</p>
<div style="text-align:center;"><img src="http://blog.phatboyg.com/wp-content/uploads/2009/07/mvpbanner.png" alt="MVPbanner.png" border="0" width="584" height="108" /></div>
<p style="text-align:center;">
<blockquote><em>Microsoft Most Valuable Professionals (MVPs) are exceptional technical community leaders from around the world who are awarded for voluntarily sharing their high quality, real world expertise in offline and online technical communities. Microsoft MVPs are a highly select group of experts that represents the technical community&#8217;s best and brightest, and they share a deep commitment to community and a willingness to help others.</em></p></blockquote>
<p>A community-based award like this would not be possible without the support of my peers, and I look forward to meeting up with some of those very peers at the next MVP Summit! In the meantime, congratulations to all the new and renewed MVPs!</p>
<img src="http://feeds.feedburner.com/~r/PhatBoyG/~4/FAIJnBpr_kg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.phatboyg.com/2009/07/01/im-a-microsoft-c-mvp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dallas TechFest 2009 Tomorrow</title>
		<link>http://blog.phatboyg.com/2009/06/18/dallas-techfest-2009-tomorrow/</link>
		<comments>http://blog.phatboyg.com/2009/06/18/dallas-techfest-2009-tomorrow/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 03:04:04 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[MassTransit]]></category>

		<category><![CDATA[Monads]]></category>

		<guid isPermaLink="false">http://blog.phatboyg.com/?p=781</guid>
		<description><![CDATA[It&#8217;s been a couple of busy weeks! The weekend before my presentations in Arkansas, I decided to forego sleep and go to Wakarusa! The Saturday lineup included two of my favorite electronica acts, Shpongle and Ott, and introduced to another band STS9. Staying up all night dancing to heavy techno music and getting no sleep [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a couple of busy weeks! The weekend before my presentations in Arkansas, I decided to forego sleep and go to <a href="http://www.wakarusa.com/">Wakarusa</a>! The Saturday lineup included two of my favorite electronica acts, <a href="http://www.twistedmusic.com/artists/shpongle">Shpongle</a> and <a href="http://www.ottsonic.com/">Ott</a>, and introduced to another band STS9. Staying up all night dancing to heavy techno music and getting no sleep was one heck of a prelude to the week. After the seriously fun times I stopped in on the Fort Smith and Northwest Arkansas .NET user groups and shared my thoughts on Event Driven Architecture. Both nights went well, with some great conversations afterwards about the how and why that took me towards that style of architectural system design.</p>
<p>Tomorrow morning at 9:00 AM (hey, if you aren&#8217;t first, you&#8217;re last &#8212; this is Texas after all) I&#8217;ll be presenting at Dallas TechFest on the same subject in the .NET track. If you want to learn more about Event Driven Architecture and how we are making it easier to implement with MassTransit, come by and check it out. I promise to deliver a demo that includes all sorts of cool things like NHibernate, FluentNHibernate, StructureMap, Castle, Topshelf, Magnum, and of course, MassTransit.</p>
<p>Also, if you&#8217;re in the Tulsa area and weren&#8217;t able to make it to Dallas TechFest, I&#8217;ll be presenting at the Tulsa .NET User Group on the 29th of June as well. If you do come by, be sure to stop afterwards and say hello. I&#8217;ll be at the event throughout the day and am more than happy to talk to anyone interested in learning more about <a href="http://code.google.com/p/masstransit/">MassTransit</a>. I&#8217;m sure I&#8217;ll be around the functional programming open space playing with crazy monadic parsers written in C#.</p>
<img src="http://feeds.feedburner.com/~r/PhatBoyG/~4/LSZ_z6cdNzM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.phatboyg.com/2009/06/18/dallas-techfest-2009-tomorrow/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Presenting on Event Driven Architecture and MassTransit</title>
		<link>http://blog.phatboyg.com/2009/05/27/presenting-on-event-driven-architecture-and-masstransit/</link>
		<comments>http://blog.phatboyg.com/2009/05/27/presenting-on-event-driven-architecture-and-masstransit/#comments</comments>
		<pubDate>Thu, 28 May 2009 02:57:06 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[MSMQ]]></category>

		<category><![CDATA[MassTransit]]></category>

		<guid isPermaLink="false">http://blog.phatboyg.com/?p=778</guid>
		<description><![CDATA[
Event Driven Architecture

Business applications no longer exist as isolated systems. In order to provide integrated solutions that add business value, applications must be connected. Modern approaches for enterprise application integration (EAI) such as Service Oriented Architecture (SOA) separate applications into services that can be accessed via a standard interface such as a web service. This [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;padding-bottom: 12px;">
<h3>Event Driven Architecture</h3>
</div>
<p>Business applications no longer exist as isolated systems. In order to provide integrated solutions that add business value, applications must be connected. Modern approaches for enterprise application integration (EAI) such as Service Oriented Architecture (SOA) separate applications into services that can be accessed via a standard interface such as a web service. This collection of services provides a platform on which new applications can be created that leverage the existing functionality.
</p>
<p>
However, as application complexity increases, the coupling of services becomes an impediment in adapting applications to meet the ever-changing goals of the business. Event Driven Architecture (EDA) is a method of designing and implementing systems where events are exchanged between highly decoupled components and services. EDA does not replace SOA, instead it compliments the request/response nature of SOA with a highly scalable event model for building and coordinating asynchronous transactions.
</p>
<p>
In this presentation, I will explain event driven architecture, describe the different types of events, demonstrate how events can be related and orchestrated, and provide a basic understanding of how this method can drive the architecture of enterprise systems. In addition to understanding the concepts of event driven architecture, we will explore a working sample built using an open-source .NET messaging framework called MassTransit.
</p>
<p>You can catch this presentation at the following events:</p>
<ul>
<li>On Monday, June 8th, I&#8217;ll be presenting at the <a href="http://www.fsdnug.org/">Fort Smith .NET User Group</a>.</li>
<li>On Tuesday, June 9th, I&#8217;ll be presenting at the <a href="http://nwadnug.org/tabid/54/ModuleID/370/ItemID/42/mctl/EventDetails/Default.aspx">Northwest Arkansas .NET User Group</a>.</li>
<li>On Friday, June 19th, I&#8217;ll be presenting at <a href="http://www.dallastechfest.com/">Dallas TechFest 2009</a>.</li>
</ul>
<div style="text-align:center;padding-bottom: 12px;"><img src="http://blog.phatboyg.com/wp-content/uploads/2009/05/dallas-techfest-slide.png" alt="Dallas TechFest Slide.png" border="0" width="477" height="179" /></div>
<p>If you are one or more of these events, be sure to come up and introduce yourself after the session. Also, if you have any feedback on the presentation, feel free to post your comments here or via e-mail.</p>
<img src="http://feeds.feedburner.com/~r/PhatBoyG/~4/pcL-y5VXq4w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.phatboyg.com/2009/05/27/presenting-on-event-driven-architecture-and-masstransit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MassTransit Now Speaks XML By Default</title>
		<link>http://blog.phatboyg.com/2009/05/27/masstransit-now-speaks-xml-by-default-2/</link>
		<comments>http://blog.phatboyg.com/2009/05/27/masstransit-now-speaks-xml-by-default-2/#comments</comments>
		<pubDate>Wed, 27 May 2009 14:14:02 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[MSMQ]]></category>

		<category><![CDATA[MassTransit]]></category>

		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://blog.phatboyg.com/?p=772</guid>
		<description><![CDATA[Last night, I made a major update to the trunk of MassTransit that changes the default message format from binary to XML.
Since the first drop of MassTransit, the default format for messages was binary. This had several advantages, one being the ability to take any object and just use it as a message. The BinaryFormatter [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Last night, I made a major update to the trunk of MassTransit that changes the default message format from binary to XML.</strong></p>
<p>Since the first drop of <a href="http://code.google.com/p/masstransit/">MassTransit</a>, the default format for messages was <em>binary</em>. This had several advantages, one being the ability to take any object and just use it as a message. The BinaryFormatter in .NET is pretty hard core about making sure that the object will come out the other end without any changes. The disadvantage of using binary as a message format is it makes it very difficult to interoperate with other systems. For this reason, we are embracing XML as the new default message format.</p>
<p>The road to XML was not easy. Many months ago when we opened up the endpoints to a configurable serialization format, we ran into some issues with our first attempt at XML. We used the .NET XmlSerializer at first, and found it to be too limited to meet our needs. There was no support for serializing dictionaries (which I would call a smell in your message contract anyway), and you had to register the type of every object being serialized in advance in order for it work properly. With all these problems, we continued to keep binary as the default with XML being experimental.</p>
<p>I started writing a new XML serializer from the ground up nearly a year ago. I went through a lot of approaches and just didn&#8217;t find something that I liked using .NET 2.0 as the framework. I looked at a more Google Protocol Buffers technique for a while, but found it a little cumbersome to deal with compared to just using XML. Then, a month or two ago, I started to seriously look at how we could do a solid XML serialization attempt again using the .NET 3.5 framework features. From that research, the current default XML serializer was founded.</p>
<p>Like many ORMs such as NHibernate, the use of the XML message serializer requires that the objects being serialized have a no-argument constructor. It can be protected to hide it from developers, but it must exist. Also, only properties are serialized as they represent the public contract that the message object is sharing. And the properties must be read/write so that the serializer can get and set the value of the property. Here is an example of one of our messages:</p>
<pre name="code" class="csharp">

public class NewUserRegistered :
CorrelatedBy&lt; Guid &gt;
{
public Guid CorrelationId { get; set; }
public string Username { get; set; }
public string Email { get; set; }
public DateTime RegisteredAt { get; set; }
}
</pre>
<p>Since messages are DTOs (data transfer objects), I try to keep them clean and simple. They are pure data containers and are not meant to have any behavior associated with them. While I treat my messages as immutable, I don&#8217;t find I need to express that in the message class itself since it just tends to make the object more confusing. And quite honestly, there are better ways to express immutable message contracts, such as using interfaces.</p>
<p>The resulting XML for the above message looks like:</p>
<pre name="code" class="xml">

&lt; ?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;x :XmlMessageEnvelope
xmlns:x=&quot;MassTransit.Serialization.XmlMessageEnvelope, MassTransit&quot;
xmlns:m=&quot;MassTransit.Tests.Serialization.NewUserRegistered, MassTransit.Tests&quot;
xmlns:s=&quot;System.String, mscorlib&quot;
xmlns:d=&quot;System.DateTime, mscorlib&quot;
xmlns:g=&quot;System.Guid, mscorlib&quot;
xmlns:i=&quot;System.Int32, mscorlib&quot;&gt;
&lt;m :Message&gt;
&lt;s :Username&gt;billg&lt;/s&gt;
&lt;s :Email&gt;billg@microsoft.com&lt;/s&gt;
&lt;d :RegisteredAt&gt;2009-05-27T13:50:21.106875Z&lt;/d&gt;
&lt;g :CorrelationId&gt;acb709df-7e32-45e2-a48c-9c160091aa5d&lt;/g&gt;
&lt;/m&gt;
&lt;s :SourceAddress &gt;loopback://localhost/source&lt;/s&gt;
&lt;s :DestinationAddress &gt;loopback://localhost/destination&lt;/s&gt;
&lt;s :MessageType &gt;MassTransit.Tests.Serialization.NewUserRegistered, MassTransit.Tests&lt;/s&gt;
&lt;/x&gt;
</pre>
<p>Namespaces are created for each type of object that is serialized. This makes it fast and easy for the deserialization process to figure out what type to use when reading the value from the XML. It&#8217;s easy to look and see the actual data that belongs to the message, as well as the headers used by MassTransit.</p>
<p>I wanted to post this as quickly as possible after committing the changes to the trunk so I will wrap up. I&#8217;m pretty excited about having a nice, readable message format. Since finding <a href="http://www.geekproject.com/tools.aspx#10">MSMQ Studio</a>, I&#8217;ve really wanted to improve the diagnosis story for looking at messages inside the queues. I think this is a solid move towards that goal and a great first steps towards interoperability with other systems.</p>
<img src="http://feeds.feedburner.com/~r/PhatBoyG/~4/-TKW4fzOmiA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.phatboyg.com/2009/05/27/masstransit-now-speaks-xml-by-default-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MassTransit Saga Enhancements for Event Processing</title>
		<link>http://blog.phatboyg.com/2009/05/22/masstransit-saga-enhancements-for-event-processing/</link>
		<comments>http://blog.phatboyg.com/2009/05/22/masstransit-saga-enhancements-for-event-processing/#comments</comments>
		<pubDate>Sat, 23 May 2009 02:30:44 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[MSMQ]]></category>

		<category><![CDATA[MassTransit]]></category>

		<guid isPermaLink="false">http://blog.phatboyg.com/?p=760</guid>
		<description><![CDATA[In the past year, I&#8217;ve been learning about Event Driven Architecture and how using it in the enterprise can make adding functionality over time easier through a loosely-coupled event-based architecture. With Event Driven Architecture, business components can subscribe and react to events, using correlation and orchestration to combine those events to represent business processes. The [...]]]></description>
			<content:encoded><![CDATA[<p>In the past year, I&#8217;ve been learning about <a href="http://en.wikipedia.org/wiki/Event_Driven_Architecture">Event Driven Architecture</a> and how using it in the enterprise can make adding functionality over time easier through a loosely-coupled event-based architecture. With Event Driven Architecture, business components can subscribe and react to events, using correlation and orchestration to combine those events to represent business processes. The loose-coupled nature makes it easier to add functionality without modifying existing services &#8212; reducing the risk of deploying new services over time.
</p>
<p>
When I first added saga support to <a href="http://code.google.com/p/masstransit/">MassTransit</a>, the focus was purely on allowing for long-lived transactions and the orchestration of a series of events that related to a specific process. Earlier this year, the first release of a new declarative programming style for sagas using a fluent interface was put into the trunk, making it possible to design sagas using a more natural structure and language. This feature alone is one of the more compelling things about sagas in MassTransit.
</p>
<p>
Over the past month or so, I&#8217;ve been working on extending the capabilities of sagas in MassTransit beyond the orchestration of directly correlated events (represented as messages). With the latest updates to the trunk, messages that are not directly correlated to the saga can now be observed by the saga using either the interface-based or declarative state machine based saga syntax. This makes for some very compelling functionality as sagas can now <em>observe</em> other events and react to them!
</p>
<p>
Let&#8217;s take a quick look at the syntax using the state machine syntax using a simple message indicating a user has signed out.
</p>
<pre name="code" class="csharp">

public class UserSignedOut
{
	public string Username { get; set; }
}
</pre>
<p>
This message only contains the username of the user that signed out of the system. If we had a saga that tracked the state of an operation on a web site based on the current user, we could observe this message and release any resources that were being tracked by the saga. For example:
</p>
<pre name="code" class="csharp">

public class ShoppingCartSaga :
	SagaStateMachine&lt; ShoppingCartSaga &gt;
{
	static ShoppingCartSaga()
	{
		Define(()=&gt;
		{
			Correlate(UserSignedOut).By((saga,message) =&gt; saga.Username == message.Username);

			During(Active,
				When(UserSignedOut)
					.Then(saga =&gt; saga.ReturnCartItemsToInventory())
					.Complete());
		};
	}

	public static Event&lt; UserSignedOut &gt; UserSignedOut { get; set; }
}
</pre>
<p>
The Correlate() method is used to define the correlation expression used to match a message to one or more sagas in the saga repository. With this addition, the <a href="http://code.google.com/p/masstransit/source/browse/trunk/MassTransit/Saga/ISagaRepository.cs">ISagaRepository</a> has been changed to make it more integrated into the message pipeline, along with the new pipeline message sinks to support this enhanced functionality. The pipeline viewer has also been updated to show the contents of the message pipeline, including all the messages handled by the saga. The Correlate() method can also be used to change how a <a href="http://code.google.com/p/masstransit/source/browse/trunk/MassTransit/CorrelatedBy.cs">CorrelatedBy</a> message is also correlated to the saga, making it possible to override the logic on how messages are used to create/use existing saga instances.
</p>
<p>
The first use case for this new functionality was to improve the subscription service. By making Subscription and SubscriptionClient sagas observe messages from each other, the sagas are able to now complete when they see a node coming back online after a crash or going offline, etc. Since the saga repositories themselves are used to keep track of all the clients and subscriptions in the system, putting that responsibility within the declaration of the saga state machine itself makes for a really clean implementation.
</p>
<p>
These bits are currently in the trunk and will be part of the next release drop of MassTransit. I encourage you to check them out and provide some feedback on any issues. Some of this may be extended soon to also allow for the custom definition of the policy associated with how messages should be applied to sagas, such as always creating a new instance or using an existing instance of a saga. Some conventions are currently in place based on the Initial state that select a default saga policy (check out <a href="http://code.google.com/p/masstransit/source/browse/trunk/MassTransit/Saga/ISagaPolicy.cs">ISagaPolicy</a> and the classes that implement it for more details there).
</p>
<p>
So check it out and keep the great feedback and comments coming on the message group. The new syntax additions should be added to the <a href="http://masstransit.pbworks.com/">wiki</a> soon.</p>
<img src="http://feeds.feedburner.com/~r/PhatBoyG/~4/RCsXcsAckrY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.phatboyg.com/2009/05/22/masstransit-saga-enhancements-for-event-processing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I’m Down With M.V.C., Yeah You Know Me!</title>
		<link>http://blog.phatboyg.com/2009/05/10/im-down-with-mvc-yeah-you-know-me/</link>
		<comments>http://blog.phatboyg.com/2009/05/10/im-down-with-mvc-yeah-you-know-me/#comments</comments>
		<pubDate>Mon, 11 May 2009 01:47:29 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ALT.NET]]></category>

		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[MVC]]></category>

		<category><![CDATA[System.Web.Mvc]]></category>

		<guid isPermaLink="false">http://blog.phatboyg.com/?p=758</guid>
		<description><![CDATA[Over the past week, I&#8217;ve had some time to dig into the new ASP.NET MVC framework. For starters, my background in web development is mostly classic ASP talking to COM objects built in C++. I&#8217;ve only used ASP.NET to provide web services for smart clients. Beyond that, my experience has been all PHP joined by [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past week, I&#8217;ve had some time to dig into the new <a href="http://www.asp.net/mvc/">ASP.NET MVC framework</a>. For starters, my background in web development is mostly classic ASP talking to COM objects built in C++. I&#8217;ve only used ASP.NET to provide web services for smart clients. Beyond that, my experience has been all PHP joined by a short experimentation period with Ruby on Rails. When Scott Gu presented the new ASP.NET MVC framework at the first ALT.NET Austin in 2007, I was excited to see Microsoft stepping into the space where at the time Monorail was the only viable choice.</p>
<p>First things first &#8212; the benefit of waiting until now to jump into ASP.NET MVC is being able to learn from the writing that has been produced. Jimmy Bogard has <a href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/04/24/how-we-do-mvc.aspx">written</a> a number of articles about how they are using the MVC framework, including strong opinions about how to adhere to the SOLID principles and ensure the long-term maintainability of the final application. Jeremy Miller and Chad Myers have certainly <a href="http://codebetter.com/blogs/jeremy.miller/archive/2008/10/23/our-opinions-on-the-asp-net-mvc-introducing-the-thunderdome-principle.aspx">voiced</a> their <a href="http://www.lostechies.com/blogs/chad_myers/archive/2009/04/27/to-mvc-or-to-webforms.aspx">opinions</a> about the framework, resulting in their own <a href="http://code.google.com/p/fubumvc/">FubuMVC</a> framework.</p>
<p>From my initial dive into the framework, it seems as if an emphasis was put on the View and Controller while leaving the Model a bit behind. Views and controllers are certainly easier to demonstrate, but a good model is going to be very domain specific and hard to generalize in a demo. The framework does make it easy to keep the domain and application services separate from both the controllers and the views, so I think the underpinnings for success are certainly present.</p>
<p>At this point, I&#8217;ve only been working with ASP.NET MVC for about a week and I am enthusiastic about what is being provided by Microsoft. Considering Microsoft&#8217;s efforts to work with the development community during the development of the framework combined with developer interest, I think it is a sensible solution and certainly a better alternative to ASP.NET WebForms in a .NET development shop. Plus, I feel that web developers <strong>should</strong> know both HTML and JavaScript, they are the languages of the web after all.</p>
<img src="http://feeds.feedburner.com/~r/PhatBoyG/~4/VsQ-yF7-OLE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.phatboyg.com/2009/05/10/im-down-with-mvc-yeah-you-know-me/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Declarative Workflow with MassTransit</title>
		<link>http://blog.phatboyg.com/2009/04/07/declarative-workflow-with-masstransit/</link>
		<comments>http://blog.phatboyg.com/2009/04/07/declarative-workflow-with-masstransit/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 01:49:34 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[MassTransit]]></category>

		<guid isPermaLink="false">http://blog.phatboyg.com/?p=752</guid>
		<description><![CDATA[One of the really cool features that is available in the 0.6 release of MassTransit is the ability to declaratively define a saga/workflow using a nested-closure syntax in combination with a fluent builder. While some wonder if fluent interfaces are going to become the &#8220;aluminum wiring&#8221; of the current generation of software development, I find [...]]]></description>
			<content:encoded><![CDATA[<p>One of the really cool features that is available in the 0.6 release of MassTransit is the ability to declaratively define a saga/workflow using a nested-closure syntax in combination with a fluent builder. While some wonder if fluent interfaces are going to <a href="http://odetocode.com/Blogs/scott/archive/2009/03/16/12651.aspx">become the &#8220;aluminum wiring&#8221;</a> of the current generation of software development, I find them incredible valuable for building an expressive representation of logic.</p>
<p>A saga is a way of defining a long-lived transaction, typically involving multiple transactional actors. A workflow is a way of orchestrating a number of actors into a process. Both sagas and workflows can be modeled using the new declarative syntax. First, let&#8217;s look at what this new language looks like in code:</p>
<pre name="code" class="csharp">

static DrinkPreparationSaga()
{
	Define(() =&gt;
		{
			Initially(
				When(NewOrder)
					.Then((saga, message) =&gt; saga.ProcessNewOrder(message))
					.TransitionTo(WaitingForPayment)
				);

			During(WaitingForPayment,
			       When(PaymentComplete)
			       	.Then((saga, message) =&gt;
			       		{
			       			Console.WriteLine(&quot;Payment Complete for &#039;{0}&#039; got it!&quot;, saga.Name);
			       			saga.ServeDrink();
			       		})
			       	.Complete()
				);
		});
}
</pre>
<p><em>(I&#8217;ve removed the class structure around the constructor to keep the code short)</em></p>
<p>If we read from the top down, it is easy to understand the behavior for this saga. Initially (which signifies the creation of a new saga based on an event in this block), when a NewOrder is received, then we&#8217;re going to call the ProcessNewOrder method on the saga passing it the message that was received. Once that method completes, the saga will transition to the WaitingForPayment state. During the WaitingForPayment state, if a PaymentComplete is received, the saga will output a message, call the ServeDrink method on the saga, and complete.</p>
<p>The states and events of the saga are defined by adding some static properties to the class:</p>
<pre name="code" class="csharp">

public static State Initial { get; set; }
public static State Completed { get; set; }
public static State PreparingDrink { get; set; }
public static State WaitingForPayment { get; set; }

public static Event&lt; NewOrderMessage &gt; NewOrder { get; set; }
public static Event&lt; PaymentCompleteMessage &gt; PaymentComplete { get; set; }
</pre>
<p>The static constructor for the state machine initializes these properties during the definition of the behavior as part of the Define() call. It is nice to be able to see all the states and events for the saga in one place, as well as the messages that are related to the events.</p>
<p>Another great feature allows us to ask the saga state machine engine to tell us what it is going to do based on how we defined the behavior of the saga. The StateMachineInspector class is a tool that will output a trace of the defined behavior of the state machine. For the above saga, the output looks like:</p>
<pre>
	During Initial
		When NewOrder Occurs Containing NewOrderMessage
			(custom action)
			Transition To WaitingForPayment
	During PreparingDrink
	During WaitingForPayment
		When PaymentComplete Occurs Containing PaymentCompleteMessage
			(custom action)
			Transition To Completed
	During Completed
</pre>
<p>This information is generated by using expressions and reflecting over the class and types contained. The above example is taken from the Starbucks example in the MassTransit trunk. For a service to subscribe and handle sagas like this, the service only needs to call:</p>
<pre name="code" class="csharp">

var unsubscribe = bus.Subscribe&lt; DrinkPreparationSaga &gt;();
</pre>
<p>Like all component-based consumers in MassTransit, the container should know how to build the saga and needs to have a ISagaRepository< T > implementation for the saga as well.</p>
<p>I hope as more people start to use this syntax that it evolves in a really rich was of doing code-first workflow and saga definitions. One thing we definitely want to do is take the text-based visualization of the saga and output it in a format that can be used by GraphViz or MSGLEE to get a nice diagram of the behavior of the saga. Hopefully that will be coming sooner rather than later!</p>
<p>So that&#8217;s one of the really cool features of MassTransit that have been added.</p>
<img src="http://feeds.feedburner.com/~r/PhatBoyG/~4/PYyXuDFWfEE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.phatboyg.com/2009/04/07/declarative-workflow-with-masstransit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MassTransit 0.6 Release Candidate</title>
		<link>http://blog.phatboyg.com/2009/03/30/masstransit-06-release-candidate/</link>
		<comments>http://blog.phatboyg.com/2009/03/30/masstransit-06-release-candidate/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 02:16:49 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[MSMQ]]></category>

		<category><![CDATA[MassTransit]]></category>

		<guid isPermaLink="false">http://blog.phatboyg.com/?p=748</guid>
		<description><![CDATA[I&#8217;m proud to announce that we are getting close to a final 0.6 release of MassTransit. We&#8217;ve been working on this release since early December and have added a lot of new functionality. We&#8217;re also glad to have integrated a number of patches that the community has contributed &#8212; thanks for your help!
If you are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m proud to announce that we are getting close to a final 0.6 release of <a href="http://code.google.com/p/masstransit/">MassTransit</a>. We&#8217;ve been working on this release since early December and have added a lot of new functionality. We&#8217;re also glad to have integrated a number of patches that the community has contributed &#8212; thanks for your help!</p>
<p>If you are currently developing with MassTransit, please check out the new bits and give us feedback. The trunk contains all of the latest code. <a href="http://masstransit.googlecode.com/files/masstransit-0.6RC1-r1829-src.zip">A snapshot of the trunk</a>, along with a <a href="http://masstransit.googlecode.com/files/masstransit-0.6RC1-r1829.zip">0.6 RC1 build</a> have been added to the <a href="http://code.google.com/p/masstransit/">GoogleCode</a> site. If you have any problems, comments, suggestions, or patches please post them to the <a href="http://groups.google.com/group/masstransit-discuss">Google Group for MassTransit</a>. We&#8217;re interested in all experiences, good, bad, or otherwise.</p>
<p>A quick run down of the changes includes:</p>
<ul>
<li>
<strong>Message Pipeline</strong><br />
The message pipeline is a replacement for the message dispatcher, as well as the cache-based publishing and subscribing bits. This new pipeline is built using a pipes-and-filter approach and is dynamically adjusted as subscriptions are added and removed &#8212; both locally and by remote services.
</li>
<li>
<strong>Saga State Machine</strong><br />
With the all new method of defining sagas using a state/event fluent interface, it is now even easier to describe the business logic of a process and the events from which it is built. With the new state machine, it is not necessary to have message consumers and interfaces on your saga, you can just define the events in the class and they are wired automatically by the subscription framework. The early version of the syntax was discussed <a href="http://blog.phatboyg.com/2009/01/16/state-machine-for-managing-sagas/">in this post</a>.
</li>
<li>
<strong>Better Request/Response Support</strong><br />
The old bus.Request() syntax has been replaced with a new fluent style for making requests and waiting for responses. Both synchronous and asynchronous calling conventions are supported. Look for the new bus.MakeRequest extension method for more information on this slick new syntax.
</li>
<li>
<strong>Code-based Configuration Syntax</strong><br />
A new, code-based method of configuring and running a service bus has been added. This syntax significantly simplifies getting started with MassTransit and has been used throughout the unit tests. The facilities for Castle have also been updated to transparently use this new syntax with the same XML-style configuration in Windsor. More details on this syntax can be <a href="http://blog.phatboyg.com/2008/12/21/simplified-masstransit-configuration/">found here</a>.
</li>
<li>
<strong>Message Headers</strong><br />
Messages are now wrapped in an envelope and headers are associated with the message. The pipeline will add certain headers, and additional headers can be added by the message publisher using an extension method to the IServiceBus.Publish and IEndpoint.Send methods. Header properties such as ResponseAddress, FaultAddress, DestinationAddress, and SourceAddress make some more advanced routing options available. All three message serializers support the message headers. Which brings me to&#8230;
</li>
<li>
<strong>Binary, XML, and JSON Message Serializers</strong><br />
All three serializers can now be configured for use as the wire message format.
</li>
<li>
<strong>Topshelf Integration</strong><br />
The old MassTransit.Host has been replaced with the easier to use <a href="http://code.google.com/p/topshelf/">Topshelf</a> service hosting framework.
</li>
<li>
<strong>Unsubscribe via Delegate</strong><br />
The Unsubscribe methods on IServiceBus have been removed. When Subscribe is called, an UnsubscribeAction is returned instead. This delegate should be called when the subscription is no longer needed. This makes it easier to modify the state of the service bus in response to subscribe/unsubscribe actions by maintaining all of the information needed to unsubscribe in a lambda expression. The UnsubscribeAction is a delegate, and multiple unsubscribe handlers can be added together via the += operator. You can also use the extension method to get an IDisposable version of the subscription.
</li>
<li>
<strong>Redesigned Subscription Service</strong><br />
The subscription service and client have been rewritten to take advantage of the new saga syntax. This reduces the number of specialized components needed for each service, as well as leveraging the features of MassTransit internally. Check out the SubscriptionManagerGUI in the WinFormSample for a demonstration of the service, as well as the pre-built services for use in your production environment.
</li>
<li>
<strong>Starbucks Sample Updated</strong><br />
The Starbucks example has been updated to use the new saga state machines as well as some housekeeping updates to use the new features. Be sure to check it out as a starting point for understanding sagas and how to interact with them. Details on how to get the Starbucks sample running <a href="http://masstransit.pbwiki.com/starbucks">are on the wiki</a>.
</li>
</ul>
<p>We&#8217;re hoping to get an official 0.6 release in the next couple of weeks, so please provide any feedback you have to help us wrap it up. You can get the bits, including a <a href="http://masstransit.googlecode.com/files/masstransit-0.6RC1-r1829-src.zip">source</a> and <a href="http://masstransit.googlecode.com/files/masstransit-0.6RC1-r1829.zip">binary</a> distribution <a href="http://code.google.com/p/masstransit/downloads/list">here</a>.</p>
<img src="http://feeds.feedburner.com/~r/PhatBoyG/~4/nPV2TZ3fQf0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.phatboyg.com/2009/03/30/masstransit-06-release-candidate/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dr. Dru and PhatBoyG on Elegant Code Cast</title>
		<link>http://blog.phatboyg.com/2009/03/18/dr-dru-and-phatboyg-on-elegant-code-cast/</link>
		<comments>http://blog.phatboyg.com/2009/03/18/dr-dru-and-phatboyg-on-elegant-code-cast/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 04:41:08 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[MSMQ]]></category>

		<category><![CDATA[MassTransit]]></category>

		<guid isPermaLink="false">http://blog.phatboyg.com/?p=746</guid>
		<description><![CDATA[Just over a week ago, Dru Sellers and I recorded a podcast with Elegant Coders Jarod Ferguson and David Starr. We spent a couple of hours discussing event driven architecture (EDA), messaging, and MassTransit. Through the magic of editing, they managed to end up with a solid eighty minutes (most likely to achieve a straight [...]]]></description>
			<content:encoded><![CDATA[<p>Just over a week ago, <a href="http://drusellers.codebetter.com/">Dru Sellers</a> and I recorded a podcast with <a href="http://elegantcode.com/">Elegant Code</a>rs <a href="http://elegantcode.com/about/jarod-ferguson/">Jarod Ferguson</a> and <a href="http://elegantcode.com/about/david-starr/">David Starr</a>. We spent a couple of hours discussing <a href="http://en.wikipedia.org/wiki/Event_Driven_Architecture">event driven architecture</a> (EDA), messaging, and <a href="http://code.google.com/p/masstransit/">MassTransit</a>. Through the magic of editing, they managed to end up with a solid eighty minutes (most likely to achieve a straight up <a href="http://www.urbandictionary.com/define.php?term=G">G</a> rating). </p>
<p><a href="http://elegantcode.com/2009/03/18/code-cast-25-masstransit/">Check it out on their web site</a> (where you can listen, or subscribe via iTunes/PodCastRSS).</p>
<img src="http://feeds.feedburner.com/~r/PhatBoyG/~4/hrynOJEs5TA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.phatboyg.com/2009/03/18/dr-dru-and-phatboyg-on-elegant-code-cast/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Developing for the iPhone</title>
		<link>http://blog.phatboyg.com/2009/02/08/developing-for-the-iphone/</link>
		<comments>http://blog.phatboyg.com/2009/02/08/developing-for-the-iphone/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 01:00:15 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
		
		<category><![CDATA[OSX]]></category>

		<category><![CDATA[Random]]></category>

		<category><![CDATA[Xcode]]></category>

		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blog.phatboyg.com/?p=744</guid>
		<description><![CDATA[First, one my the reasons I love using OSX: 16 applications open including 4 Xcode projects, Photoshop, Numbers, Evernote, Mindjet MindManager, and more without a hint of slowdown and still 1.3 GB free (4GB total on my MBP). It&#8217;s wide, because I use a 24&#8243; display next to my built-in laptop display.

I&#8217;ve been doing a [...]]]></description>
			<content:encoded><![CDATA[<p>First, one my the reasons I love using OSX: 16 applications open including 4 Xcode projects, Photoshop, Numbers, Evernote, Mindjet MindManager, and more without a hint of slowdown and still 1.3 GB free (4GB total on my MBP). It&#8217;s wide, because I use a 24&#8243; display next to my built-in laptop display.</p>
<p><img src="http://blog.phatboyg.com/wp-content/uploads/2009/02/widedesktop.jpg" alt="WideDesktop.jpg" border="0" width="640" height="229" /></p>
<p>I&#8217;ve been doing a lot of work in Xcode lately, building an application for the iPhone. I officially joined the developer program this past weekend, making it possible to load applications into my phone for testing. I&#8217;ve got a few ideas for some applications that I haven&#8217;t seen done yet, so hopefully I can get something out there to fill the void.</p>
<p>I have to say, the more I work in Objective-C, the more I like it. Sure, I&#8217;m missing a few things like all my comfortable frameworks and such, but there are plenty of other ways to deal with things I&#8217;ve coming across. And since the NDA, sites like <a href="http://www.stackoverflow.com/">Stack Overflow</a> have become a great resource for getting answers to issues I come across.</p>
<p>I&#8217;m still working on my other projects like MassTransit, this is just something to broaden my knowledge and have fun at the same time. Between developing on the iPhone, doing Java projects at work, and building open-source .NET frameworks at home &#8212; I&#8217;ve got plenty to keep me busy!</p>
<img src="http://feeds.feedburner.com/~r/PhatBoyG/~4/6T50uM4XlKY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.phatboyg.com/2009/02/08/developing-for-the-iphone/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
