<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Scott M. Felder</title>
	<atom:link href="http://scottfelder.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://scottfelder.wordpress.com</link>
	<description>Hello Event-Driven World!</description>
	<lastBuildDate>Tue, 23 Aug 2011 05:18:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='scottfelder.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/8eb89b06f44fe4fb33cabdfa15c170e9?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Scott M. Felder</title>
		<link>http://scottfelder.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://scottfelder.wordpress.com/osd.xml" title="Scott M. Felder" />
	<atom:link rel='hub' href='http://scottfelder.wordpress.com/?pushpress=hub'/>
		<item>
		<title>BizTalk Server 2010 is now RTM</title>
		<link>http://scottfelder.wordpress.com/2010/09/23/biztalk-server-2010-is-now-rtm/</link>
		<comments>http://scottfelder.wordpress.com/2010/09/23/biztalk-server-2010-is-now-rtm/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 19:12:38 +0000</pubDate>
		<dc:creator>Scott Felder</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[AppFabric]]></category>
		<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[WorkFlow]]></category>

		<guid isPermaLink="false">http://blog.scottmfelder.com/?p=83</guid>
		<description><![CDATA[BizTalk Server 2010 released for manufacturing!!! The seventh major release of BizTalk Server has now been released to manufacturing and will be available for purchase starting October 1st. I&#8217;m particularly interested in checking out how BizTalk integrates with the new Windows Server AppFabric (code name Dublin) and WorkFlow 4.0 to build Agile Composite Applications. Filed under: .Net, AppFabric, BizTalk, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottfelder.wordpress.com&amp;blog=10210771&amp;post=83&amp;subd=scottfelder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3><a href="http://blogs.msdn.com/b/biztalk_server_team_blog/archive/2010/09/22/biztalk-server-2010-released-for-manufacturing.aspx">BizTalk Server 2010 released for manufacturing!!!</a></h3>
<p>The seventh major release of BizTalk Server has now been released to manufacturing and will be available for purchase starting October 1st.</p>
<p>I&#8217;m particularly interested in checking out how BizTalk integrates with the new Windows Server AppFabric (code name Dublin) and WorkFlow 4.0 to build Agile Composite Applications.</p>
<br />Filed under: <a href='http://scottfelder.wordpress.com/category/net/'>.Net</a>, <a href='http://scottfelder.wordpress.com/category/appfabric/'>AppFabric</a>, <a href='http://scottfelder.wordpress.com/category/biztalk/'>BizTalk</a>, <a href='http://scottfelder.wordpress.com/category/workflow/'>WorkFlow</a> Tagged: <a href='http://scottfelder.wordpress.com/tag/biztalk/'>BizTalk</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scottfelder.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scottfelder.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/scottfelder.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/scottfelder.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/scottfelder.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/scottfelder.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/scottfelder.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/scottfelder.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/scottfelder.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/scottfelder.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/scottfelder.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/scottfelder.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/scottfelder.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/scottfelder.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottfelder.wordpress.com&amp;blog=10210771&amp;post=83&amp;subd=scottfelder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scottfelder.wordpress.com/2010/09/23/biztalk-server-2010-is-now-rtm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3ba60f8a682cbf7ee173be26d18c88f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">scottfelder</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft .NET Micro Framework + Netdunio</title>
		<link>http://scottfelder.wordpress.com/2010/09/22/microsoft-net-micro-framework-netdunio/</link>
		<comments>http://scottfelder.wordpress.com/2010/09/22/microsoft-net-micro-framework-netdunio/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 02:54:03 +0000</pubDate>
		<dc:creator>Scott Felder</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net Micro Framework]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Netduino]]></category>
		<category><![CDATA[NetMF]]></category>
		<category><![CDATA[netduino]]></category>
		<category><![CDATA[netmf]]></category>

		<guid isPermaLink="false">https://scottfelder.wordpress.com/?p=68</guid>
		<description><![CDATA[I&#8217;ve always found embedded programming on microcontrollers to be very fascinating and fun, whether it is using the Lego Mind Storm robotics system or C on an Intel 8051 microcontroller. To program a microcontroller to sense the outside world through sensors or control some device such as a motor, or servo, or actuator is very [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottfelder.wordpress.com&amp;blog=10210771&amp;post=68&amp;subd=scottfelder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always found embedded programming on microcontrollers to be very fascinating and fun, whether it is using the Lego Mind Storm robotics system or C on an Intel 8051 microcontroller.  To program a microcontroller to sense the outside world through sensors or control some device such as a motor, or servo, or actuator is very cool.  I’ve taken a look at the Microsoft .Net Micro Framework numerous times but have never really had the opportunity to do much with it (other than the sample programs that come with the framework install that run on the emulator).  I’ve looked at some of the development kits that are out there that run the Micro Framework but I wasn’t willing to spend the $300+ to get started.  After reading a couple of blog posts by <a href="http://www.hanselman.com/blog/TheNETMicroFrameworkHardwareForSoftwarePeople.aspx">Scott Hanselman</a> and <a href="http://10rem.net/blog/2010/09/02/first-experiences-with-netduino-and-the-net-micro-framework">Pete Brown</a> I discovered the the <a href="http://netduino.com/">Netduino</a> as an inexpensive ($34.99 + S&amp;H) development board to get started with (I actually purchased my board from a company out of Canada because S&amp;H was only $4 versus the $7 that a similar US company was charging. I guess it is cheaper to outsource.).</p>
<h3>Netduino</h3>
<p><a href="http://scottfelder.files.wordpress.com/2010/09/inputandoutput.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:5px;" title="inputandoutput" src="http://scottfelder.files.wordpress.com/2010/09/inputandoutput_thumb.jpg?w=330&#038;h=306" border="0" alt="inputandoutput" width="330" height="306" /></a></p>
<p><span style="text-decoration:underline;">Technical Specs</span></p>
<ul>
<li>Atmel 32-bit microcontroller</li>
<li>Speed: 48 Mhz, ARM7</li>
<li>Code Storage: 128 KB</li>
<li>RAM: 60 KB</li>
<li>20 Digital and Analog GPIO pins</li>
</ul>
<p>The rest of the specs for the Netduino can be found on their website <a href="http://www.netduino.com/netduino/specs.htm">here</a>.</p>
<p>The Netduino is an <a href="http://www.arduino.cc/">Arduino</a> compatible open source board, which means that the schematics are available for download and you are free to build your own board if you so desire.  It also means that you can extend the functionality of the Netduino by attaching various  Arduino compatible modules called “Shields” since all Arduino compatible boards must be designed with a standard socket configuration allow for the shields to be easily added on top of the Arduino boards.</p>
<p><a href="http://scottfelder.files.wordpress.com/2010/09/mksp72t.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:5px;" title="MKSP7-2T" src="http://scottfelder.files.wordpress.com/2010/09/mksp72t_thumb.jpg?w=244&#038;h=160" border="0" alt="MKSP7-2T" width="244" height="160" /></a></p>
<p>Arduino with an Ethernet Shield attached.</p>
<p><a href="http://scottfelder.files.wordpress.com/2010/09/mkad72t.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:5px;" title="MKAD7-2T" src="http://scottfelder.files.wordpress.com/2010/09/mkad72t_thumb.jpg?w=244&#038;h=184" border="0" alt="MKAD7-2T" width="244" height="184" /></a></p>
<p>Motor Controller Shield for controlling DC motors and Servos.</p>
<p><a href="http://scottfelder.files.wordpress.com/2010/09/mkad62t.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:5px;" title="MKAD6-2T" src="http://scottfelder.files.wordpress.com/2010/09/mkad62t_thumb.jpg?w=244&#038;h=184" border="0" alt="MKAD6-2T" width="244" height="184" /></a></p>
<p>Prototyping Shield.</p>
<p>There are also shields for GPS, GSM cellular, Zigbee, and touch screens.  As you can see you can really extend the functionality of the Netduino well beyond the basic controller. (One note of caution, some shields come with drivers that need to be installed on the Micro Framework board.  Some shields such as GSM cellular’s drivers may be too large to install in the available memory on the board.)</p>
<h3>Microsoft .Net Micro Framework</h3>
<p>The .Net Micro Framework is a subset of the .Net Framework that is even smaller than the .Net Compact Framework.  Unlike the .Net Framework or the Compact framework, the Micro Framework does not require a host OS in order for it to run.  The Micro Framework has a hardware abstraction layer which allows for it to run on the bare metal.  You can also install and run the Micro Framework on a host OS if your requirements are such.  Also unlike the Compact Framework, the Micro Framework is now open source under the Apache 2.0 license agreement making it a very cheap option for embedded devices when compared to the cost of the embedded OS such as CE that is need to run the Compact Framework.  You can download the Micro Framework and find additional information on Microsoft’s MF website located <a href="http://www.microsoft.com/netmf/default.mspx">here</a>.</p>
<h3>Getting Started</h3>
<p>To get started developing in the Micro Frame work you must first either install Microsoft Visual Studio 2010 or install the Microsoft Visual C# Express 2010.  Once Visual Studio is installed download and install the .NET Micro Framework SDK v4.1.  Last download and install the Netduino SDK v4.1.0 (either the 32-bit or 64-bit version depending on your OS) from the Netduino website <a href="http://netduino.com/downloads/">here</a>.</p>
<p>Once Visual Studio and the software SDKs have been installed you can attached the Netduino to your computer via USB with the USB cable supplied with Netduino board.</p>
<p>The first project I created was a simple “Hello World” app (Netduino style) which made the onboard user LED blink on and off. (whoooo I know, how exciting. It gets better trust me)  I select “Console Application” from the Micro Framework template in VS 2010.</p>
<p><a href="http://scottfelder.files.wordpress.com/2010/09/newproject.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:5px;" title="NewProject" src="http://scottfelder.files.wordpress.com/2010/09/newproject_thumb.jpg?w=624&#038;h=451" border="0" alt="NewProject" width="624" height="451" /></a></p>
<p>Next I had to go into the project properties and tell Visual Studio to deploy via USB and select the Netduino device from my device list.  If you don’t it defaults to using the emulator.</p>
<p><a href="http://scottfelder.files.wordpress.com/2010/09/properties.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:5px;" title="properties" src="http://scottfelder.files.wordpress.com/2010/09/properties_thumb.jpg?w=754&#038;h=286" border="0" alt="properties" width="754" height="286" /></a></p>
<p>Next I added references to the Netduino libraries.</p>
<p><a href="http://scottfelder.files.wordpress.com/2010/09/ref.jpg"><img class="alignnone" style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0 initial initial;margin:5px;" title="Ref" src="http://scottfelder.files.wordpress.com/2010/09/ref_thumb.jpg?w=244&#038;h=178" border="0" alt="Ref" width="244" height="178" /></a></p>
<p>The code required to turn on and off the user LED is very simple.  Basically you set the OutputPort to the use the user LED and then you toggle it back and forth between 1 and 0 with the .Write() method on the OutputPort object.  This is the object you will instantiate when you want to interface with any of the GPIO pins.</p>
<p><pre class="brush: csharp;">
        public static void Main()
        {
            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
            while (true)
            {
                led.Write(true); // turn on the LED
                Thread.Sleep(250); // sleep for 250ms
                led.Write(false); // turn off the LED
                Thread.Sleep(250); // sleep for 250ms
            }
        }
</pre></p>
<p>Press F5 to compile and run in debug. Visual Studio will take care of deploying the source code over to the Netduino and starts running it on the device.  While running in debug and connected to the Netduino you can set breakpoints and step through your code all while running on the device.</p>
<p><a href="http://scottfelder.files.wordpress.com/2010/09/debug.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;margin:5px;" title="debug" src="http://scottfelder.files.wordpress.com/2010/09/debug_thumb.jpg?w=780&#038;h=636" border="0" alt="debug" width="780" height="636" /></a></p>
<h3>Conclusion</h3>
<p>As you can see there really isn’t much to getting the .Net Micro Framework installed and getting your first app up and running on the Netduino.  The entire process of installing both SDK’s and write/deploying that first HelloWorld app too me less than 10 minutes.  It’s really nice to be able to use the tools and languages that I’m familiar with and use everyday in my normal job.</p>
<p>Now I know this was a pretty simple example with not a lot of code to show but I just wanted to give a quick introduction to the .Net Micro Framework and the Netduino board before I move onto some more in-depth examples.  I’ve already started working on a project that will use the Netduino to interface with a DS1621 Temperature sensor that communicates over the I2C (pronounced ‘I’ Squared ‘C’) 2-wire communications bus.  I’m hoping have that project and blog post ready to publish by the end of this weekend. Stay tuned!</p>
<br />Filed under: <a href='http://scottfelder.wordpress.com/category/net/'>.Net</a>, <a href='http://scottfelder.wordpress.com/category/net-micro-framework/'>.Net Micro Framework</a>, <a href='http://scottfelder.wordpress.com/category/embedded/'>Embedded</a>, <a href='http://scottfelder.wordpress.com/category/netduino/'>Netduino</a>, <a href='http://scottfelder.wordpress.com/category/netmf/'>NetMF</a> Tagged: <a href='http://scottfelder.wordpress.com/tag/net/'>.Net</a>, <a href='http://scottfelder.wordpress.com/tag/net-micro-framework/'>.Net Micro Framework</a>, <a href='http://scottfelder.wordpress.com/tag/embedded/'>Embedded</a>, <a href='http://scottfelder.wordpress.com/tag/netduino-2/'>netduino</a>, <a href='http://scottfelder.wordpress.com/tag/netmf-2/'>netmf</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scottfelder.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scottfelder.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/scottfelder.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/scottfelder.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/scottfelder.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/scottfelder.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/scottfelder.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/scottfelder.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/scottfelder.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/scottfelder.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/scottfelder.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/scottfelder.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/scottfelder.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/scottfelder.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottfelder.wordpress.com&amp;blog=10210771&amp;post=68&amp;subd=scottfelder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scottfelder.wordpress.com/2010/09/22/microsoft-net-micro-framework-netdunio/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3ba60f8a682cbf7ee173be26d18c88f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">scottfelder</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2010/09/inputandoutput_thumb.jpg" medium="image">
			<media:title type="html">inputandoutput</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2010/09/mksp72t_thumb.jpg" medium="image">
			<media:title type="html">MKSP7-2T</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2010/09/mkad72t_thumb.jpg" medium="image">
			<media:title type="html">MKAD7-2T</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2010/09/mkad62t_thumb.jpg" medium="image">
			<media:title type="html">MKAD6-2T</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2010/09/newproject_thumb.jpg" medium="image">
			<media:title type="html">NewProject</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2010/09/properties_thumb.jpg" medium="image">
			<media:title type="html">properties</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2010/09/ref_thumb.jpg" medium="image">
			<media:title type="html">Ref</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2010/09/debug_thumb.jpg" medium="image">
			<media:title type="html">debug</media:title>
		</media:content>
	</item>
		<item>
		<title>Event Driven SOA with NServiceBus</title>
		<link>http://scottfelder.wordpress.com/2009/11/04/event-driven-soa-with-nservicebus/</link>
		<comments>http://scottfelder.wordpress.com/2009/11/04/event-driven-soa-with-nservicebus/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 21:52:19 +0000</pubDate>
		<dc:creator>Scott Felder</dc:creator>
				<category><![CDATA[Alt .Net]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[EDA]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Event-Driven SOA]]></category>

		<guid isPermaLink="false">http://blog.scottmfelder.com/?p=22</guid>
		<description><![CDATA[ After October’s Alt .Net demo of “Event-Driven SOA with NServiceBus” I decided to put together some additional thoughts about NServiceBus with respect to where and how it fits or can fit within the enterprise, for those who still may have questions like “now what?”  How, not only does NServiceBus’ use apply to Service-Oriented Architecture (SOA) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottfelder.wordpress.com&amp;blog=10210771&amp;post=22&amp;subd=scottfelder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="mceTemp mceIEcenter">
<div class="mceTemp mceIEcenter" style="text-align:left;"> After October’s Alt .Net demo of “Event-Driven SOA with NServiceBus” I decided to put together some additional thoughts about NServiceBus with respect to where and how it fits or can fit within the enterprise, for those who still may have questions like “now what?”  How, not only does NServiceBus’ use apply to Service-Oriented Architecture (SOA) and Event-Driven Architecture (EDA), but also with Domain Driven Design (DDD).</div>
</div>
<p><strong></strong> </p>
<p><strong>Big Ball of Mud</strong></p>
<p>Let’s start with my original example business, Acme Enterprise.  Acme wishes to build an ecommerce system to sell its products to its customers.  The developers at Acme start out by building a web application that customers can come to for placing orders, employees in the pricing department can update product prices, and employees in the inventory management department can maintain product SKUs and product levels.  As time goes on the pricing department wants to add new functionality to the system to maintain promotional pricing on products, discount pricing on products, etc.  The inventory department wants to add new functionality to the system to provide auto-replenishment on products, warehouse location of products, etc.  As the application grows into one monolithic system it can quickly become unmanageable in its current form, or as some call it, BBOM – Big Ball of Mud.  More importantly, the different departments within Acme define the term “Product” differently.  The sales department defines a “Product” as an item ordered by a customer and added to a shopping cart with a <em>price</em> and <em>quantity ordered</em> information attached to it.  The pricing department defines the “product” in terms of not only unit price, but promotional pricing, and marketing campaign pricing that is valid for a particular time period. Meanwhile the folks in inventory management define a “Product” in terms of <em>Quantity on Hand</em>, <em>Warehouse Location</em>, and <em>Reorder Threshold Trigger</em>.  As the system grows, so does the complexity and the size of our BBOM.</p>
<div class="mceTemp mceIEcenter"><img class="aligncenter size-full wp-image-8" title="NSB-BBM" src="http://scottfelder.files.wordpress.com/2009/11/nsb-bbm.png" alt="NSB-BBM" width="385" height="282" /></div>
<p><strong> </strong></p>
<p><strong>Bounded Contexts</strong></p>
<p>This is where Domain Driven Design (DDD) can help with the design of our ecommerce system.  When we start to define the term “Product” with the people responsible for products in each of the departments within the company, we realize that they all care about this thing called a “Product” but they each talk about it in a different context.  This is where DDD introduces the idea of a Bounded Context.  Our system can be split into separate contexts each with its own explicit boundary.  So what we end up with in our system is a bunch of Bounded Contexts for each of the different contexts within the system: an inventory context, a pricing context, sales context, etc.  Each Bounded Context has its own model and ubiquitous language that defines the domain and entities like “Product” uniquely to its own definition.  The key phrase to our bounded context here is “explicit boundary”.  Each context provides a contract to the outside world to interact with and can be viewed as its own application within an application.  This can provide modularity to our overall system design.  One Bounded Context shares data with another Bounded Context via a Context Map.  A Context Map exposes a well defined contract interface that can be consumed.</p>
<p style="text-align:center;"><img class="size-full wp-image-11  aligncenter" title="NSB-DDD" src="http://scottfelder.files.wordpress.com/2009/11/nsb-ddd.png" alt="NSB-DDD" width="418" height="406" /></p>
<p><strong> </strong> </p>
<p><strong> </strong></p>
<p><strong>Bounded Context as a Service</strong></p>
<p>Now let’s take our DDD ecommerce system and apply SOA principles to it. Remember when I stated that a Bounded Context provides an explicit boundary?  One of the core tenets of SOA states that “Boundaries are explicit”.  I also stated that a Bounded Context can provide modularity within our system and that a context can be viewed as an application within an application.  Well another core tenet of SOA states that “Services are autonomous.” Hmm, so what else do bounded contexts and SOAs share in common?  A Bounded Context within our system communicates with another Bounded Context within our system via a context map that provides a contract interface to the outside world.  SOA; “Services share Schema and Contract, not Class”.  So when we compare the Bounded Context of our DDD and the Services of our SOA, there really isn’t a whole lot of difference between the two.  Maybe in an SOA we should call them “Bounded Services”?  SOA is about the separation of Bounded Contexts in our application into their own services so looser coupling can be achieved while providing a certain degree of service reuse within our enterprise.  Our context map or interface to the SOA service can be done via a web service, restful service, or WCF.  For example, in our DDD ecommerce application, if we wanted to replace the inventory context with a third party inventory management or ERP system like SAP, there may be a bit more work involved to decouple it from the old system and integrate the new SAP system.  With SOA, we have a lesser degree of coupling to deal with so integrating to the new inventory system will be easier.  Notice, I said “easier” not seamless.</p>
<p style="text-align:center;"> <img class="size-full wp-image-10  aligncenter" title="NSB-SOA" src="http://scottfelder.files.wordpress.com/2009/11/nsb-soa.png" alt="NSB-SOA" width="403" height="314" /></p>
<p><strong> </strong></p>
<p><strong>EDA with NServiceBus</strong></p>
<p>This brings me to Event-Driven Architecture (EDA), more specifically, EDA with NServiceBus.  As we’ve taken our initial BBOM ecommerce application and we introduced DDD principles to it and refactored our system, we began to decouple the system into different functional modules, or Bounded Context, within one application running on our web server.  Each department (inventory, pricing, sales), would access the same system to update their various domains of information.  As we moved to SOA, we took this one step farther by making these contexts autonomous services that can be distributed on different servers running within our enterprise, providing user access to a particular service to only the people in the department that need to update data within that service.  The problem with traditional SOA is it still gives us a certain level of coupling with our enterprise applications between services.  If the inventory service needs to inform the pricing service that a new SKU has been entered into the system, the inventory service must know that the pricing service exists within our enterprise.  Meaning, the inventory service must be programmed to make a service call to a service interface (web service, WCF, socket call, etc.) on the pricing service.  If we decide to use a different system in the future to do pricing, we need to update the inventory service to call the new service interfaces on the new pricing system.  This is where event messages and NServiceBus can help.  If we define a series of business events that describe important transactions within our enterprise, we can publish their event messages to a message bus.  Now instead of our services interacting directly and having to be aware of one another in the enterprise, each service only needs to know to publish event messages to the message bus, and only subscribe to event messages on the message bus that it cares about.  So in the case of our inventory service, and our pricing service, the inventory service can publish“New SKU” events and the pricing service and subscribe to “New SKU” events.  At no point does the inventory service need to know about the pricing service and conversely, the pricing service doesn’t need to know about the inventory service; now what “links” the two systems together are the “New SKU” events, and more importantly the data contained within.  In essence, the event messages and the service bus, in this case NServiceBus (but we could use others) become the “Context Map” defined back in our DDD application.  The event messages are our contracts and NServiceBus becomes our service transport layer to communicate between Bounded Contexts/Services with a higher level of decoupling between our services than we had with our traditional SOA.</p>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-12" title="NSB-EDA" src="http://scottfelder.files.wordpress.com/2009/11/nsb-eda.png" alt="NSB-EDA" width="426" height="293" /> </p>
<p><strong> </strong></p>
<p><strong>In conclusion</strong></p>
<p>            NServiceBus provides an easy to use API to the framework to work with so we can create an event message driven architecture.  Publishing event messages via NServiceBus will allow for a much more loose coupling design between the different Bounded Contexts or Services running in our enterprise.  While applications or services will always have a higher degree of coupling between their application layers, (UI, Business Layer, DAL, etc.), Event-Driven Architecture with NServiceBus can provide for a much lesser degree of coupling between the explicit boundaries of the services.</p>
<br />Posted in Alt .Net, DDD, EDA, NServiceBus, SOA Tagged: Alt .Net, DDD, EDA, Event-Driven SOA, NServiceBus, SOA <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scottfelder.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scottfelder.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/scottfelder.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/scottfelder.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/scottfelder.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/scottfelder.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/scottfelder.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/scottfelder.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/scottfelder.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/scottfelder.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/scottfelder.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/scottfelder.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/scottfelder.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/scottfelder.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scottfelder.wordpress.com&amp;blog=10210771&amp;post=22&amp;subd=scottfelder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scottfelder.wordpress.com/2009/11/04/event-driven-soa-with-nservicebus/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3ba60f8a682cbf7ee173be26d18c88f7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">scottfelder</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2009/11/nsb-bbm.png" medium="image">
			<media:title type="html">NSB-BBM</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2009/11/nsb-ddd.png" medium="image">
			<media:title type="html">NSB-DDD</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2009/11/nsb-soa.png" medium="image">
			<media:title type="html">NSB-SOA</media:title>
		</media:content>

		<media:content url="http://scottfelder.files.wordpress.com/2009/11/nsb-eda.png" medium="image">
			<media:title type="html">NSB-EDA</media:title>
		</media:content>
	</item>
	</channel>
</rss>
