<?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: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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Los Techies</title>
    
	<link>http://lostechies.com</link>
	<description>LosTechies.com was originally discussed a few years ago, over a couple of adult beverages whose name sounds very similar to l(D)os t(E)quies. Anyway the thought was to create a public forum where technical ideas and thoughts can be shared in the same way we all get together around a good meal and drinks. Ideas and thoughts are cultivated in discussion, and brought to fruition through professional debate and laughter. Sounds good in theory, well read our thoughts and ideas, take part in our debates and rejoice in our laughter.</description>
	<lastBuildDate>Mon, 20 May 2013 15:47:33 +0000</lastBuildDate>
		<language />
        <image>
		<url>http://lostechies.com/favicon.ico</url>
		<title>LosTechies Master Site Feed Posts &amp; Pages</title>
		<link>http://lostechies.com</link>
	</image>
    
<generator>http://wordpress.org/?v=3.4.2</generator>
	<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/LosTechies" /><feedburner:info uri="lostechies" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>ripple: Fubu-inspired dependency management</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/Y-D0v-GfhD4/</link>
		<comments>http://lostechies.com/josharnold/2013/05/20/ripple-fubu-inspired-dependency-management/#comments</comments>
		<pubDate>Mon, 20 May 2013 15:47:33 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[fubu]]></category>
		<category><![CDATA[ripple]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/josharnold/?p=257]]></guid>
		<description><![CDATA[I&#8217;m happy to announce that our ripple project is now publicly available and it&#8217;s sporting some brand new documentation. The docs go into greater detail than I&#8217;m going to write here but I&#8217;ll provide some highlights: Overview: Ripple is a&#160;&#8230; <a href="http://lostechies.com/josharnold/2013/05/20/ripple-fubu-inspired-dependency-management/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m happy to announce that our ripple project is now publicly available and it&#8217;s sporting some <a href="http://darthfubumvc.github.io/ripple/ripple/">brand new documentation</a>. The docs go into greater detail than I&#8217;m going to write here but I&#8217;ll provide some highlights:</p>
<p><strong>Overview:</strong></p>
<p>Ripple is a new kind of package manager that was created out of heavy usage of the standard NuGet client. The feeds, the protocol, and the packages are the same. Ripple just embodies differing opinions and provides a new way of consuming them that is friendlier for continuous integration.</p>
<p><strong>Features:</strong></p>
<p>1. Staying up to date with the latest build</p>
<p>Ripple introduces the concept of &#8220;Fixed&#8221; vs. &#8220;Float&#8221; dependencies. For internal dependencies, it&#8217;s often beneficial to keep all of your downstream projects built against the very latest of your internal libraries. For the Fubu team, this means that changes to FubuMVC.Core &#8220;ripple&#8221; into downstream projects and help us find bugs FAST.</p>
<p>2. Command line friendly</p>
<p>Ripple is 100% command line and has no ties into Visual Studio. The usages were designed for how the Fubu team works and for integration with our build server.</p>
<p>3. Generating nuspec files</p>
<p>Keeping your packages up to date with versions can be a challenge when you have a lot of them. Ripple provides the ability to automatically generate version constraints for the dependencies in your nuspec files so that you never get out of sync.</p>
<p>&#8230;<a href="http://darthfubumvc.github.io/ripple/ripple/">and lots more.</a></p>
<p><strong>Getting Started:</strong></p>
<p>Ripple is published both as a Ruby Gem (ripple-cli) and as a NuGet package (Ripple) &#8212; which you can use with Chocolatey.</p>
<p>You can read the &#8220;Edge&#8221; documentation here: <a href="http://darthfubumvc.github.io/ripple">http://darthfubumvc.github.io/ripple<br />
</a><em><br />
Note:  The ripple docs are powered by our brand new &#8220;FubuDocs&#8221; tooling. Jeremy will likely be writing about that one soon. If he wasn&#8217;t planning on it&#8230;then I think I just volunteered him for it.</em>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=Y-D0v-GfhD4:oU_ERu98i-U:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=Y-D0v-GfhD4:oU_ERu98i-U:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=Y-D0v-GfhD4:oU_ERu98i-U:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=Y-D0v-GfhD4:oU_ERu98i-U:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=Y-D0v-GfhD4:oU_ERu98i-U:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=Y-D0v-GfhD4:oU_ERu98i-U:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/Y-D0v-GfhD4" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/josharnold/2013/05/20/ripple-fubu-inspired-dependency-management/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/21cf6b362c0b90a52606aa2be2c1ccc4?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Josh Arnold</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/josharnold/2013/05/20/ripple-fubu-inspired-dependency-management/</feedburner:origLink></item>
	<item>
		<title>Eventual consistency in REST APIs</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/64fjyXHDAh0/</link>
		<comments>http://lostechies.com/jimmybogard/2013/05/15/eventual-consistency-in-rest-apis/#comments</comments>
		<pubDate>Wed, 15 May 2013 19:57:08 +0000</pubDate>
		<dc:creator>Jimmy Bogard</dc:creator>
				<category><![CDATA[REST]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/jimmybogard/?p=780]]></guid>
		<description><![CDATA[Not picking on an API in particular, but…wait, yes I am. Octopus (an awesome product) has a proposed API on GitHub, and one of the things it describes is how to deal with the fact that the backend is built&#160;&#8230; <a href="http://lostechies.com/jimmybogard/2013/05/15/eventual-consistency-in-rest-apis/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>Not picking on an API in particular, but…wait, yes I am. Octopus (an awesome product) has a proposed API on GitHub, and one of the things it describes is <a href="https://github.com/OctopusDeploy/OctopusDeploy-Api/blob/master/sections/links.md#collections">how to deal with the fact that the backend is built on top of Raven DB</a>, where eventual consistency its default mode for index results.</p>
<p>In it, the proposal includes an “IsStale” flag on the collection, as well as on the query itself, so you could do something like:</p>
<p>GET /api/environments?nonstale=true</p>
<p>Or similar. This presents a rather weird choice to the end user of the API – consistency as a choice, not on mutating operations (PUT/POST/DELETE) but on idempotent GET operations. I presume that this will use the “<a href="http://ravendb.net/docs/2.0/client-api/querying/stale-indexes">WaitForNonStaleResults</a>” behavior of RavenDB – but this isn’t really something I’d expect to directly expose to clients.</p>
<p>Without directly exposing our persistence mechanism to our clients (i.e., what if we switched to SQL Server? Redis as a write-through cache to MondoDB? and so on), we have a number of options of dealing with eventual consistency in our REST APIs.</p>
<h3>Option 1: Do nothing</h3>
<p><strong>The easiest approach for our API is to simply not care</strong>. Non-stale results should only really appear when we’re dealing with queries and collections – if you’re dealing with stale resources from GET actions directly against a resource, you’ve really got a weird interaction model.</p>
<p>Looking at some other APIs, like Netflix or GitHub or Trello, you don’t really see any option for influencing the consistency choice on a read.</p>
<p>So we could just ignore it. This is what a lot of APIs do, accept the POST/PUT/DELETE, and make sure that my resource itself is affected correctly. If I do a DELETE /users/jbogard and then a GET /users/jbogard, I expect a 404. But if I query users or search them, then I might not expect those results to be reflected in that model. I can be explicit in this by having search be a completely separate set of resources/entry point (i.e. /search?entity=users&amp;name=jbogard), so it’s completely explicit that search/query is different than interacting with resources.</p>
<p>This is similar to how a library with a card catalog might work. Do I synchronize the activity of checking out a book with checking the catalog? Or might someone have grabbed the book from when I checked the card catalog? Or do I have someone hold the card while checking out a book?</p>
<p>What I don’t do is allow a person looking for a book to either be disappointed OR have the choice of yelling out to everyone in the library, “DOES ANYONE HAVE THIS BOOK OR IS OTHERWISE WANTING TO CHECK THIS BOOK OUT”. I fix my interaction model and just be up front about it.</p>
<h3>Option 2: Provide feedback on consistency results</h3>
<p>Instead of just punting on whether or not the collection/query is stale, we might provide that as feedback. We could return dates of last update, things like “results as of mm/dd/yyyy”. We often do this on printable reports so that when people print a report (and it is now preeeeeetty much as stale as it gets), we can include a timestamp of when it was printed so that anyone looking at it is informed of how fresh the data is.</p>
<p>Just a tidbit of information to the end user to let them know if their results are up to date or not. If the client made a mutating operation, they can compare the date of this mutation with the date on the query results to make a simple decision to query again, or just move on as planned. Again, the power is in the client not to affect how we query, but what decisions they can make.</p>
<h3></h3>
<h3>Option 3: Return a 202 ACCEPTED status</h3>
<p>If we really want to model an asynchronous operation in our REST API, we can look to the HTTP status codes to communicate this explicitly to our clients. We do this in a couple of places where processing is too expensive in the context of a request, so we return a 202 to let clients know that “we got your request, but it’s not getting processed at this moment.” The <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#10.2.3">description from the W3C reads</a>:</p>
<blockquote><p>The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this.
<p>The 202 response is intentionally non-committal. Its purpose is to allow a server to accept a request for some other process (perhaps a batch-oriented process that is only run once per day) without requiring that the user agent&#8217;s connection to the server persist until the process is completed. The entity returned with this response SHOULD include an indication of the request&#8217;s current status and either a pointer to a status monitor or some estimate of when the user can expect the request to be fulfilled.</p>
</blockquote>
<p>We can return a pointer to an indication of the current status, or some estimate of completion. But we’re being 100% up front that your request is processed asynchronously.
<p>This is similar to any long-running transaction. You place an order at a fast-food restaurant, and are given a correlation identifier that represents your order. You can come back and ask the status of your order at any time. But the cashier certainly doesn’t cook our order while we’re standing in line!<br />
<h3>Option 4: Write-through cache</h3>
<p>If these operations are expected to succeed (or we verify that the transactional write has succeeded), we can do a simple trick that a lot of high-volume websites do. If we don’t have an AP-system like Dynamo (choosing availability and partitionability over consistency), we might choose consistency instead. To do so, we can cache index results, and write our updated value to that store along with our regular persistent store.</p>
<p>It’s not the most exciting of options, but if we know that writes are much less frequent than reads (and we’re not partitioning, i.e. we pick CA of CAP), then it’s not too far-fetched to write to both our cache and our document store.</p>
<p>Of course, if this is all to force us to bypass our consistency model of the database we’ve chosen, it’s a lot of work. But still, it’s an option nonetheless.</p>
<h3></h3>
<h3>Option 5: Choose a database that matches our consistency needs</h3>
<p>If we don’t like the consistency model that our database provides, or we feel like we want to allow clients to choose a consistency model, we might view this as a case where we’ve simply chosen the wrong model. If clients NEED consistency, why not pick something that gives that to them? Or don’t allow them to choose.</p>
<p>This would be like, on writes, allowing clients that interact with a database that uses a relational model to also indicate the isolation level on writes. That’s something that should really be encapsulated by the operation, and made with SLAs and contracts about the behavior.</p>
<h3>Conclusion</h3>
<p>We have a lot of options here, and all are valid in some scenarios. In each example, we’ve chosen a consistency model that matches our needs, rather than have a compromised consistency model exposed from our database of choice. Before Amazon put out their Dynamo paper, it’s not like us as users of the website knew that this storage system existed in the back end. It was encapsulated. The most we could do was “Ctrl+F5” to force a request back to their servers, but that still had no real guarantees.</p>
<p>Instead of letting our database leak its consistency model to our API, it’s better to choose a model that makes this consistency model explicit, or offer no guarantees at all. But as a rule, I as a consumer should not care that you’ve chosen Raven DB instead of SQL Server for your back end. It’s just none of my business.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=64fjyXHDAh0:zgGZNfWU4kU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=64fjyXHDAh0:zgGZNfWU4kU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=64fjyXHDAh0:zgGZNfWU4kU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=64fjyXHDAh0:zgGZNfWU4kU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=64fjyXHDAh0:zgGZNfWU4kU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=64fjyXHDAh0:zgGZNfWU4kU:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/64fjyXHDAh0" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/jimmybogard/2013/05/15/eventual-consistency-in-rest-apis/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/cc359c5ccf90d7a24b5976316797b5ec?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Jimmy Bogard</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/jimmybogard/2013/05/15/eventual-consistency-in-rest-apis/</feedburner:origLink></item>
	<item>
		<title>Saga patterns: wrap up</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/TbS8yE_ioPs/</link>
		<comments>http://lostechies.com/jimmybogard/2013/05/14/saga-patterns-wrap-up/#comments</comments>
		<pubDate>Tue, 14 May 2013 14:08:29 +0000</pubDate>
		<dc:creator>Jimmy Bogard</dc:creator>
				<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/jimmybogard/?p=778]]></guid>
		<description><![CDATA[Posts in this series: Observer pattern Controller pattern Pattern variations Scaling sagas Routing slips NServiceBus sagas are a simple yet flexible tool to achieve a variety of end goals. Whether it’s orchestration, choreography, business activity monitoring, or just other long-running&#160;&#8230; <a href="http://lostechies.com/jimmybogard/2013/05/14/saga-patterns-wrap-up/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>Posts in this series:</p>
<ul>
<li><a href="http://lostechies.com/jimmybogard/2013/03/11/saga-implementation-patterns-observer/">Observer pattern</a></li>
<li><a href="http://lostechies.com/jimmybogard/2013/03/14/saga-implementation-patterns-controller/">Controller pattern</a></li>
<li><a href="http://lostechies.com/jimmybogard/2013/03/21/saga-implementation-patterns-variations/">Pattern variations</a></li>
<li><a href="http://lostechies.com/jimmybogard/2013/03/26/scaling-nservicebus-sagas/">Scaling sagas</a></li>
<li><a href="http://lostechies.com/jimmybogard/2013/04/26/saga-alternatives-routing-slips/">Routing slips</a></li>
</ul>
<p>NServiceBus sagas are a simple yet flexible tool to achieve a variety of end goals. Whether it’s orchestration, choreography, business activity monitoring, or just other long-running business transaction variants, the uses of an NServiceBus saga are pretty much endless.</p>
<p>When choosing to go with a centralized workflow, we also saw that there is a cost to centralization with the introduction of a bottleneck. With the routing slip pattern, we can include instructions with our message in a header so that each recipient only needs to reference the attached instructions. In a routing slip, flow is linear, but there’s nothing stopping us from including more advanced instructions for state machines, compensations and so on.</p>
<p>I tend to think of the NServiceBus saga as more of a facility, than a specific pattern, because it doesn’t force us to go in any one direction. Rather than assume a specific role or function for a saga, I like to keep things a bit more flexible, and choose one of the many <a href="http://www.eaipatterns.com/docs/IEEE_IC_Conversations.pdf">conversation</a>/<a href="http://www.eaipatterns.com/">messaging</a> patterns available for each given scenario.</p>
<p>In the end, sagas are a useful tool (and one that can be over-used, not every workflow deserves central management), but a nice one to have. Every time I introduce NServiceBus sagas to folks that spent time with other messaging tools, whether it’s big orchestration with ESBs or bare-metal messaging tools, the simplicity and code-centric nature of NServiceBus sagas either excites or depresses, depending on the possibility of switching or introducing new tools.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=TbS8yE_ioPs:QGMeuUYtfjg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=TbS8yE_ioPs:QGMeuUYtfjg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=TbS8yE_ioPs:QGMeuUYtfjg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=TbS8yE_ioPs:QGMeuUYtfjg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=TbS8yE_ioPs:QGMeuUYtfjg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=TbS8yE_ioPs:QGMeuUYtfjg:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/TbS8yE_ioPs" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/jimmybogard/2013/05/14/saga-patterns-wrap-up/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/cc359c5ccf90d7a24b5976316797b5ec?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Jimmy Bogard</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/jimmybogard/2013/05/14/saga-patterns-wrap-up/</feedburner:origLink></item>
	<item>
		<title>Everything’s Coming Up ‘Duino</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/Qe9IUQRYmMU/</link>
		<comments>http://lostechies.com/sharoncichelli/2013/05/11/everythings-coming-up-duino/#comments</comments>
		<pubDate>Sat, 11 May 2013 18:44:23 +0000</pubDate>
		<dc:creator>Sharon Cichelli</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[electronics]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/sharoncichelli/?p=197]]></guid>
		<description><![CDATA[I just went to Barnes and Noble and bought a magazine with my name in it. :D Check it out: &#8220;Hello, Arduino&#8221; in CODE Magazine, an introduction to the programmable microcontroller designed to be approachable and fun. If you&#8217;ve ever&#160;&#8230; <a href="http://lostechies.com/sharoncichelli/2013/05/11/everythings-coming-up-duino/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>I just went to Barnes and Noble and bought a magazine with my name in it. :D</p>
<p>Check it out: <a href="http://code-magazine.com/Article.aspx?quickid=1305081">&#8220;Hello, Arduino&#8221; in <em>CODE Magazine</em></a>, an introduction to the programmable microcontroller designed to be approachable and fun. If you&#8217;ve ever had a hankering to see your code manifest your will in the corporeal world, you&#8217;ll love the Arduino. My article will take you step-by-step through a &#8220;Hello, World&#8221; project, even (especially!) if you&#8217;re a complete beginner to electronics.</p>
<p>(Why&#8217;d I buy the magazine? Not to worry, EPS sent me three copies of my own, as is right and proper. I just wanted an extra one to leave at <a href="http://techshop.ws/">TechShop</a>. Plus, what a thrill to purchase a magazine with my words and ideas in it! &#8220;Yes, I&#8217;d like a latte and <em>maybe you recognize the author of this article</em>, hmm?&#8221; Regrettable narcissism, I know.)</p>
<p>I&#8217;ll be giving an <a href="http://www.thatconference.com/Sessions/session_614">Arduino presentation at That Conference</a> in August in Wisconsin. Please come to my talk, say hi, show me what you&#8217;re building!</p>
<p>If you&#8217;re a parent or get to hang out with kids on a regular basis, introduce them to the Arduino. You will have a blast building stuff together. Here is a nine-year-old developer I pair-programmed with at CodeMash (she specified the requirements and did all the typing):<br />
<a href="http://www.flickr.com/photos/spyderella/8370386939/" title="Pair Programming the Arduino"><img src="http://farm9.staticflickr.com/8501/8370386939_6d7207923b_n.jpg" width="320" height="308" alt="Pair Programming the Arduino"></a></p>
<p>I&#8217;d love to hear about your projects. Make great stuff!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=Qe9IUQRYmMU:hIsFab_Owx0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=Qe9IUQRYmMU:hIsFab_Owx0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=Qe9IUQRYmMU:hIsFab_Owx0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=Qe9IUQRYmMU:hIsFab_Owx0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=Qe9IUQRYmMU:hIsFab_Owx0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=Qe9IUQRYmMU:hIsFab_Owx0:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/Qe9IUQRYmMU" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/sharoncichelli/2013/05/11/everythings-coming-up-duino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/7a03e19970cbd58f328126aa71d98f53?s=96&amp;d=retro&amp;r=G" medium="image">
            <media:title type="html">Sharon Cichelli</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/sharoncichelli/2013/05/11/everythings-coming-up-duino/</feedburner:origLink></item>
	<item>
		<title>Ditching two-phased commits</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/ZXcMjeekF30/</link>
		<comments>http://lostechies.com/jimmybogard/2013/05/09/ditching-two-phased-commits/#comments</comments>
		<pubDate>Thu, 09 May 2013 01:47:34 +0000</pubDate>
		<dc:creator>Jimmy Bogard</dc:creator>
				<category><![CDATA[Messaging]]></category>
		<category><![CDATA[SOA]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/jimmybogard/?p=776]]></guid>
		<description><![CDATA[I’ve had a love-hate relationship with two-phased commits during my years with messaging. Even if MSDTC was free to set up, it doesn’t come free in terms of throughput. Most people run into 2PC in messaging because because queueing systems&#160;&#8230; <a href="http://lostechies.com/jimmybogard/2013/05/09/ditching-two-phased-commits/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>I’ve had a love-hate relationship with <a href="https://en.wikipedia.org/wiki/Two-phase_commit_protocol">two-phased commits</a> during my years with messaging. Even if <a href="http://en.wikipedia.org/wiki/Microsoft_Distributed_Transaction_Coordinator">MSDTC</a> was free to set up, it doesn’t come free in terms of throughput. Most people run into 2PC in messaging because because queueing systems and databases are two different resources, and therefore don’t participate in the same transaction. Ideally, I’d have all three participants either succeed or fail together:</p>
<p><a href="http://lostechies.com/jimmybogard/files/2013/05/image1.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://lostechies.com/jimmybogard/files/2013/05/image_thumb1.png" width="499" height="379"></a></p>
<p>Since the queues in this picture are different resources than the database, I need to involve a third party, or transaction manager, to coordinate transactions between these three resources.</p>
<p>DTC, when it works, works really well. It’s much, much easier to not care about the consequences of a lack of coordination. In fact, I’d recommend not caring until you actually do care, because ditching two-phased commits does require work. Luckily for us, there are a <a href="http://dancres.org/reading_list.html">ton of resources</a> on how to do exactly that!</p>
<p>Most of the time, literature around avoiding 2PC is concerned about an entirely different situation, where I have two separate databases:</p>
<p><a href="http://lostechies.com/jimmybogard/files/2013/05/image2.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://lostechies.com/jimmybogard/files/2013/05/image_thumb2.png" width="459" height="347"></a></p>
<p>We’re doing messaging, which means that it’s typically the consumer of the message that does something against other data stores. So even though we’re avoiding communicating with two databases, it’s still two resources, and thus a need to coordinate!</p>
<p>But again, that coordination comes with a cost. A fairly large cost, in some recent testing we found that overall throughput dropped 80%, or to put it another way, ditching DTC saw a 5X increase in throughput. Five fold!</p>
<p>For some systems, that throughput doesn’t matter much, but for those that have a reasonably high volume of messages, or sensitive SLAs, it’s worth investigating alternative approaches.</p>
<h3>General rules of thumb</h3>
<p>Like most messaging approaches, the ways of avoiding coordination are right in front of our faces. In Gregor Hohpe’s excellent <a href="http://www.enterpriseintegrationpatterns.com/docs/IEEE_Software_Design_2PC.pdf">paper on Starbucks</a>, he points out any real-world system that values throughput over absolute consistency avoids distributed transactions. The basic ideas are:</p>
<ul>
<li>Idempotency is king. Get this and you’re halfway home</li>
<li>Strategies for dealing with downstream effects is a business decision</li>
</ul>
<p><a href="http://en.wikipedia.org/wiki/Idempotence">Idempotency</a> is absolutely required, but it’s not that hard to apply. For some operations, we can rely on natural idempotency. If I’m asked to turn on the light, receiving the request twice means the same outcome – the light is on! For state machine-like systems, idempotency is a bit easier.</p>
<p>For operations that aren’t naturally idempotent (launch the nuclear missile), we’ll need to get a little creative. If we can identify some correlating information from a request (The president called at 9:15 to launch the missile) or just assign some correlation information (The president has issued request #132 to launch the missile), we can simply keep a journal on the receiving side. If it’s expensive to keep a journal around, we can recycle/trim our journals if they get too big.</p>
<p>Downstream effects become more interesting. If throughput is a high concern, we can rely on compensating actions (customer didn’t have enough money, cancel the order) or more journaling. Instead of sending a message immediately, shouting out messages to downstream systems, we can instead just write down in the same persistent store as our other data another journal for outgoing messages.</p>
<p>Once our local DB transaction is complete, it’s just a matter of sending the messages we’ve written down to send out down the line, and crossing them off our list of “sent” messages. And since downstream systems can deal with at-least-once messages through our idempotency guarantees.</p>
<h3>How I learned to stop worrying and ditch 2PC</h3>
<p>In some current systems, we’re deciding on a service-by-service basis whether or not we want to enlist or not enlist in distributed transactions. It’s still annoying to try and build a system-wide solution (though the event sourcing guys have this more or less in the bag), so until then, I can just use business decisions to guide me one way or the other.</p>
<p>But it is time to let go and stop worrying so much. Honestly, unless your services have downstream side effects, you can safely turn off DTC if your work is idempotent. If you have downstream side effects, there’s a number of paths to choose from. While I’m not saying goodbye forever (still the best solution if it were absolutely free to use), it is time to shop around.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=ZXcMjeekF30:vyRQ8h6C-zU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=ZXcMjeekF30:vyRQ8h6C-zU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=ZXcMjeekF30:vyRQ8h6C-zU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=ZXcMjeekF30:vyRQ8h6C-zU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=ZXcMjeekF30:vyRQ8h6C-zU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=ZXcMjeekF30:vyRQ8h6C-zU:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/ZXcMjeekF30" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/jimmybogard/2013/05/09/ditching-two-phased-commits/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/cc359c5ccf90d7a24b5976316797b5ec?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Jimmy Bogard</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/jimmybogard/2013/05/09/ditching-two-phased-commits/</feedburner:origLink></item>
	<item>
		<title>Messages, data and types</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/5H-4JF3jJMU/</link>
		<comments>http://lostechies.com/jimmybogard/2013/05/01/messages-data-and-types/#comments</comments>
		<pubDate>Wed, 01 May 2013 14:08:23 +0000</pubDate>
		<dc:creator>Jimmy Bogard</dc:creator>
				<category><![CDATA[Messaging]]></category>
		<category><![CDATA[SOA]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/jimmybogard/?p=770]]></guid>
		<description><![CDATA[One concern I receive quite a bit from folks new to messaging, especially those coming from SOAP and WCF land, is how to preserve the convenience of proxy classes and data contracts that can be shared amongst multiple clients. The&#160;&#8230; <a href="http://lostechies.com/jimmybogard/2013/05/01/messages-data-and-types/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>One concern I receive quite a bit from folks new to messaging, especially those coming from SOAP and WCF land, is how to preserve the convenience of proxy classes and data contracts that can be shared amongst multiple clients. The problem comes in when looking at coupling, especially around changes in the contract and how to upgrade clients. Clemens Vasters details many of these issues in his <a href="http://channel9.msdn.com/Blogs/Subscribe/DataContract-Coupling-in-Messaging">screencast on data/contract coupling in messaging</a>.</p>
<p>One thing that grounds all of this is what we consider the message as developers, and what our transport and messaging system considers to be the message. For example, the Azure REST services <a href="http://msdn.microsoft.com/en-us/library/windowsazure/jj157186.aspx">expose contracts as XML</a>. XML, by itself, and JSON make for great transport formats because the underlying technology provides a fairly universally acceptable common type system. Although your language might need to bridge from your format to theirs, people standardize on ISO formats for standard primitives to maximize interoperability (and minimize serialization mistakes).</p>
<p>Dealing with such large XML documents from a client API can be a pain, however. XML is notoriously finicky with respect to case sensitivity, and I can’t count how many times I’ve been bitten by this when dealing with raw XML and REST APIs. We would need to assume that documentation exists, and until <a href="https://gist.github.com/mikekelly/3808215">forms become common in REST APIs</a>, it’s difficult to say that <a href="http://en.wikipedia.org/wiki/HATEOAS">HATEOAS</a> will simply solve all these problems of self-describing APIs.</p>
<p>Instead, we often see REST and other messaging clients, out of convenience, build DTOs as a means of representing the message. But first – what is a message? A <a href="http://www.eaipatterns.com/Message.html">message is just data</a>. It’s defined by a header and body, where the header is used by the transport/messaging system and the body is ignored (picture courtesy <a href="http://www.eaipatterns.com">http://www.eaipatterns.com</a>):</p>
<p><img src="http://www.eaipatterns.com/img/MessageSolution.gif"></p>
<p>However, <strong>messages aren’t types</strong>. But what about sharing something like this?</p>
<p> <script src="https://gist.github.com/5495362.js"></script><noscript>
<pre><code class="language-c# c#">[DataContract]
public class PurchaseOrder
{
	private int poId_value;
	
	// Apply the DataMemberAttribute to the property.
	[DataMember]
	public int PurchaseOrderId
	{
	
	    get { return poId_value; }
	    set { poId_value = value; }
	}
}</code></pre>
<p></noscript>
<p>That’s still not terrible, because underneath the covers our message is still just XML or JSON. We use this type as a description or blueprint of our message, because it’s simpler to describe our message in C# terms instead of a looser type like XML or JSON, which are more difficult to describe and use in C#. I’m ignoring dynamic types in .NET – those to me are a bit of a hack in this case. In WCF, proxy classes get generated on the client side, so we’re still not taking an assembly dependency. This isn’t available in REST or other messaging technologies, leaving clients reliant on documentation to “Get it right” – assuming that they don’t make mistakes translating raw XML or JSON into code building raw XML or JSON on the client side.</p>
<p>So what typically happens <strong>in a homogenous environment</strong> is that data contract assemblies are shared:</p>
<p><a href="http://lostechies.com/jimmybogard/files/2013/05/image.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://lostechies.com/jimmybogard/files/2013/05/image_thumb.png" width="355" height="243"></a></p>
<p>Both client and server share a contracts assembly, and use the contracts assembly as a description for how to construct and consume the raw messages.</p>
<p>We introduce coupling on the client side with a raw type shared across the server boundary, but it’s up to those building the system to determine if this sort of <strong>coupling introduces any potential risks</strong>. When we look at coupling, we must always balance risk. If coupling introduces low risk, it might be acceptable (assuming we’re more or less prescient in our future system’s design).</p>
<p>From my experience, as long as the messaging infrastructure doesn’t assume that the message is built from a type and therefore leak those concerns, this sort of model can be a nice compromise in ecosystems where types as blueprints for messages ensures safety in our message construction and consumption. It’s similar to <a href="http://lostechies.com/jimmybogard/2009/06/30/how-we-do-mvc-view-models/">building MVC applications around View Models</a> – they’re a blueprint for building forms, and a means of accepting raw form POSTs. Side note – I found it hilarious that the Rails folks ran into that mass assignment security problem – it’s a problem I’ve never, ever had in MVC.</p>
<p>But that’s the real kicker – our messaging infrastructure can’t assume types, as the message is not the type. We might use a type as a convenience to build and consume, as we do in MVC, but ultimately, our messaging infrastructure can’t assume a type. MVC handles this quite well, with model metadata and its ModelState objects. The <strong>original request is always preserved in its raw form</strong> (dictionary of strings), but the model provided to the controller action is an approximation of that request.</p>
<p>It’s only when we assume that we’ve literally shared types that we’re going to slip into real type coupling, and everything that SOAP failed to deliver comes back again.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=5H-4JF3jJMU:5ThhysgGMKc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=5H-4JF3jJMU:5ThhysgGMKc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=5H-4JF3jJMU:5ThhysgGMKc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=5H-4JF3jJMU:5ThhysgGMKc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=5H-4JF3jJMU:5ThhysgGMKc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=5H-4JF3jJMU:5ThhysgGMKc:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/5H-4JF3jJMU" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/jimmybogard/2013/05/01/messages-data-and-types/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/cc359c5ccf90d7a24b5976316797b5ec?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Jimmy Bogard</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/jimmybogard/2013/05/01/messages-data-and-types/</feedburner:origLink></item>
	<item>
		<title>Slap-Slides: Arduino Powered Veggie Chopper Slide Deck Controller</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/5dCBncrac_I/</link>
		<comments>http://lostechies.com/derickbailey/2013/04/27/slap-slides-proof-of-concept/#comments</comments>
		<pubDate>Sat, 27 Apr 2013 20:31:39 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JohnnyFive]]></category>
		<category><![CDATA[Prototype]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/derickbailey/?p=1095]]></guid>
		<description><![CDATA[A few weeks ago I half-jokingly tweeted about my desire to turn a SlapChop in to a presentation controller … like I said … &#8220;half-jokingly&#8221; I give you the Slap-Slides, proof of concept! (no audio) &#38;amp;amp;amp;amp;amp;lt;iframe&#38;amp;amp;amp;amp;amp;gt; The code is written&#160;&#8230; <a href="http://lostechies.com/derickbailey/2013/04/27/slap-slides-proof-of-concept/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>A few weeks ago I half-jokingly tweeted about my desire to turn a SlapChop in to a presentation controller</p>
<p><img title="NewImage.png" src="http://lostechies.com/derickbailey/files/2013/04/NewImage.png" alt="NewImage" width="320" height="320" border="0" /></p>
<p>… like I said … &#8220;half-jokingly&#8221;</p>
<p>I give you the Slap-Slides, proof of concept! (no audio)</p>
<p><iframe src="http://www.youtube.com/embed/FIfhtPHMbtU" width="640" height="480" frameborder="0">&amp;amp;amp;amp;amp;amp;lt;iframe&amp;amp;amp;amp;amp;amp;gt;</iframe></p>
<p>The code is written in <a href="https://github.com/rwldrn/johnny-five">Johnny-Five</a>, running in NodeJS, connected to an <a href="http://www.amazon.com/gp/product/B00761NDHI/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00761NDHI&amp;linkCode=as2&amp;tag=avocadosoftwa-20">Arduino Nano</a>. I bought the cheapest veggie-chopper I could find at my local grocery store, ripped the blade out and mounted a 10k button on to the plate that the blade was previously on.</p>
<p>I&#8217;ll be soldering this in to a proper set up housed entirely in the veggie-chopper, and stabilizing the button (right now it fails every 2 or 3 clicks because of the mounting in the veggie chopper.</p>
<h2><strong>UPDATE: I have it nearly complete.</strong></h2>
<p>I have the primary circuitry soldered on to a component board, and some holes cut in the housing in order to clean up the entrance of a USB cable in to the chopper.</p>
<p>Here&#8217;s a series of pictures that show the components and assembly… making code skinny, one slap at a time :D</p>
<p><img title="IMAG1507.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1507.jpg" alt="IMAG1507" width="338" height="600" border="0" /></p>
<p><img title="IMAG1509.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1509.jpg" alt="IMAG1509" width="600" height="338" border="0" /></p>
<p><img title="IMAG1510.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1510.jpg" alt="IMAG1510" width="600" height="338" border="0" /></p>
<p><img title="IMAG1511.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1511.jpg" alt="IMAG1511" width="600" height="338" border="0" /></p>
<p><img title="IMAG1512.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1512.jpg" alt="IMAG1512" width="600" height="338" border="0" /></p>
<p><img title="IMAG1514.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1514.jpg" alt="IMAG1514" width="600" height="338" border="0" /></p>
<p><img title="IMAG1515.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1515.jpg" alt="IMAG1515" width="600" height="338" border="0" /></p>
<p><img title="IMAG1476.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1476.jpg" alt="IMAG1476" width="600" height="338" border="0" /></p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=5dCBncrac_I:RpO04T9gV1Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=5dCBncrac_I:RpO04T9gV1Q:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=5dCBncrac_I:RpO04T9gV1Q:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=5dCBncrac_I:RpO04T9gV1Q:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=5dCBncrac_I:RpO04T9gV1Q:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=5dCBncrac_I:RpO04T9gV1Q:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/5dCBncrac_I" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/derickbailey/2013/04/27/slap-slides-proof-of-concept/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/e592bd1326b1e80188ed4c0bf26b9f75?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Derick Bailey</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/derickbailey/2013/04/27/slap-slides-proof-of-concept/</feedburner:origLink></item>
	<item>
		<title>Saga alternatives – routing slips</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/JOxjJQik7nI/</link>
		<comments>http://lostechies.com/jimmybogard/2013/04/26/saga-alternatives-routing-slips/#comments</comments>
		<pubDate>Fri, 26 Apr 2013 19:49:38 +0000</pubDate>
		<dc:creator>Jimmy Bogard</dc:creator>
				<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/jimmybogard/?p=766]]></guid>
		<description><![CDATA[In the last few posts on sagas, we looked at a variety of patterns of modeling long-running business transactions. However, the general problem of message routing doesn’t always require a central point of control, such as is provided with the&#160;&#8230; <a href="http://lostechies.com/jimmybogard/2013/04/26/saga-alternatives-routing-slips/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>In the last few posts on sagas, we looked at a variety of patterns of modeling long-running business transactions. However, the general problem of message routing doesn’t always require a central point of control, such as is provided with the saga facilities in NServiceBus. Process managers offer a great deal of flexibility in modeling complex business processes and splitting out concerns. They come at a cost though, with the shared state and single, centralized processor.</p>
<p>Back in our sandwich shop example, we had a picture of an interaction starting a process and moving down the line until completion:</p>
<p><a href="http://lostechies.com/jimmybogard/files/2013/04/image.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://lostechies.com/jimmybogard/files/2013/04/image_thumb.png" width="607" height="257"></a></p>
<p>Not quite clear in this picture is that if we were to model this process as a saga, we’d have a central point in which all messages must flow to for decisions to be made on the next step. But is there really any decision to be made in the picture above? In a true saga, we have a sequence of steps and a set of compensating actions (in a very simplistic case). Many times, however, there’s no need to worry about compensations in case of failures. Nor does the order in which we do things change much.</p>
<p>Humans have already found that assembly lines are great ways of breaking down a long process into individual steps, and performing those steps one at a time. Henry Ford’s Model T rolled off the assembly line every 3 minutes. If only one centralized worker coordinated all steps, it’s difficult to imagine how this level of throughput could be achieved.</p>
<p>The key differentiator is that there’s nothing really to coordinate – the process of steps is well-defined and known up front, and individual steps shouldn’t need to make decisions about what’s next. Nor is there a need for a central controller to figure out the next step – we already know the steps up front!</p>
<p>In our sandwich model, we need to tweak our picture to represent the reality of what’s going on. Once I place my order, the sequence of steps to fulfill my order are known up front, based on simply examining my order. The only decision to be made is to inspect the order and write the steps down. My order then flows through the system based on the pre-defined steps:</p>
<p><a href="http://lostechies.com/jimmybogard/files/2013/04/image1.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://lostechies.com/jimmybogard/files/2013/04/image_thumb1.png" width="607" height="242"></a></p>
<p>&nbsp;</p>
<p>Each step doesn’t change the order, nor do they decide what the next step is (or even care who the next step is). Each step’s job is to simply perform its operation, and once completed, pass the order to the next step.</p>
<p>Not all orders have the same set of steps, but that’s OK. As long as the steps don’t deviate from the plan once started, we don’t need to have any more “smarts” in our steps.</p>
<p>It turns out this pattern is a well-known pattern in the messaging world (which, in turn, borrowed its ideas from the real world): the <a href="http://www.enterpriseintegrationpatterns.com/RoutingTable.html">routing slip pattern</a>.</p>
<h3>Routing slips in NServiceBus</h3>
<p>Routing slips don’t exist in NServiceBus, but it turns out it’s not too difficult to implement. A routing slip represents the list of steps (and the progress), as well as a place for us to stash any extra information needed further down the line:</p>
<p> <script src="https://gist.github.com/5469268.js"></script><noscript>
<pre><code class="language-c# c#">    public interface IRoutingSlip
    {
        Guid Id { get; }
        IEnumerable&lt;IProcessingStep&gt; ProcessingSteps { get; }
        IDictionary&lt;string, string&gt; Attachments { get; }
    }
</code></pre>
<p></noscript>
<p>We can attach our routing slip to the original message, so that each step can inspect the slip for the next step. We’ll kick off the process when we first send out the message:</p>
<p> <script src="https://gist.github.com/5469353.js"></script><noscript>
<pre><code class="language-c# c#">Bus.Route(sandwichOrder, new[]
{
	&quot;Preparation&quot;,
	&quot;Oven&quot;,
	&quot;Packing&quot;,
});
</code></pre>
<p></noscript>
<p>Each handler handles the message, but doesn’t really need to do anything to pass it down the line, we can do this at the NServiceBus infrastructure level.</p>
<p> <script src="https://gist.github.com/5469381.js"></script><noscript>
<pre><code class="language-c# c#">public class PackingHandler 
	: IHandleMessages&lt;SandwichOrder&gt;
{
	public void Handle(SandwichOrder message)
	{
	    // pack the sandwich
	}
}
</code></pre>
<p></noscript>
<p>The nice aspect of this model is that it eliminates any centralized control. The message flows straight through the set of queues – leaving out any potential bottleneck our saga implementation would introduce. Additionally, we don’t need to resort to things like pub-sub – since this would still force our steps to be aware of the overall order, hard-coding who is next in the chain. If a customer doesn’t toast their sandwich – it doesn’t go through the oven, but we know this up front! No need to have each step to know both what to do and what the next step is.</p>
<p>I put the message routing implementation up on <a href="http://nuget.org/packages/nservicebus.messagerouting">NuGet</a> and <a href="https://github.com/jbogard/NServiceBus.MessageRouting">GitHub</a>, you just need to enable it on each endpoint via configuration:</p>
<p> <script src="https://gist.github.com/5469796.js"></script><noscript>
<pre><code class="language-c# c#">public class Startup : IWantCustomInitialization
{
	public void Init()
	{
	    Configure.Instance.RoutingSlips();
	}
}
</code></pre>
<p></noscript>
<p>If you need to process a message in a series of steps (known up front), and want to keep individual steps from knowing what’s next (or introduce a central controller), the routing slip pattern could be a good fit.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=JOxjJQik7nI:yqWlbpF4PVE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=JOxjJQik7nI:yqWlbpF4PVE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=JOxjJQik7nI:yqWlbpF4PVE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=JOxjJQik7nI:yqWlbpF4PVE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=JOxjJQik7nI:yqWlbpF4PVE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=JOxjJQik7nI:yqWlbpF4PVE:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/JOxjJQik7nI" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/jimmybogard/2013/04/26/saga-alternatives-routing-slips/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/cc359c5ccf90d7a24b5976316797b5ec?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Jimmy Bogard</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/jimmybogard/2013/04/26/saga-alternatives-routing-slips/</feedburner:origLink></item>
	<item>
		<title>Pablo’s Fiesta is Back!!</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/DbSF26Zo2y8/</link>
		<comments>http://lostechies.com/johnteague/2013/04/25/pablos-fiesta-is-back/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 16:10:57 +0000</pubDate>
		<dc:creator>John Teague</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/johnteague/?p=193]]></guid>
		<description><![CDATA[The Details: When: October 25 &#38; 26 Where: Austin TX, St. Edwards PEC (location) We took a little haitus last year, but we&#8217;re coming back this year for our Third Pablo&#8217;s Fiesta Open Space conference. What is it? Pablo&#8217;s Fiesta&#160;&#8230; <a href="http://lostechies.com/johnteague/2013/04/25/pablos-fiesta-is-back/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<h2>The Details:<br />
<span style="font-size: 16px;"><strong>When:</strong> October 25 &amp; 26<br />
</span><span style="font-size: 16px;"><strong>Where:</strong> Austin TX, <a href="http://www.pec.stedwards.edu/" target="_blank">St. Edwards PEC</a> (<a href="http://www.pec.stedwards.edu/about-map.asp" target="_blank">location</a>)</span></h2>
<p><a href="http://www.eventbrite.com/event/5517113836?ref=ebtnebregn" target="_blank"><img src="http://www.eventbrite.com/custombutton?eid=5517113836" alt="Eventbrite - Los Techies Fiesta Open Space Conference 2013" /></a></p>
<p>We took a little haitus last year, but we&#8217;re coming back this year for our Third Pablo&#8217;s Fiesta Open Space conference.</p>
<h2>What is it?</h2>
<p>Pablo&#8217;s Fiesta is a an Open Space conference on Software Quality and Craftsmanship.  It&#8217;s a chance for us to come together, learn from each other, and share our experiences and passion for what we do in an open and inclusive atmosphere.</p>
<p>If you have never been to an Open Space conference, it&#8217;s a conference experience like no other.  The schedule is defined at the conference open session, so it&#8217;s up to us to make it a great conference!!  Unlike traditional, presentation centric conferences, you are encouraged to move around and find a topic or session that is the most stimulating for you.  Or just start your own.  It&#8217;s more of a conversation than presented material.</p>
<h2>The Schedule<br />
<em><span style="font-size: 16px;">I&#8217;ll provide more detailed schedule information as I get more things planned, such as any parties and social events.</span></em></h2>
<p>If you&#8217;ve been to previous Fiestas, this one is just a little different.  The previous conferences started on Friday night for the opening session  and schedule selection and sessions on Saturday and Sunday.  This year, we will only have sessions on Saturday.  We are going to plan some social activities for Sunday, October 27th, like a picnic and a hackfest, so you might want to plan on staying in Austin until late Sunday.</p>
<p><strong>Friday October 25, around 6:00 PM</strong>.  Opening Session.  This is where we propose topics for the conference and define the schedule for the conference.</p>
<p><strong>Saturday October 26, around 9:00 AM.</strong>   Conference Sessions begin.</p>
<p><strong>Sunday October 27, TBA.</strong> Social Activities.  We&#8217;ve got some ideas were bouncing around, probably a picnic or some other activity, plus a hackfest or something.</p>
<p>It&#8217;s going to be a great time and I look forward to meeting you all there!</p>
<p>&nbsp;
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=DbSF26Zo2y8:t0Cot4vKJ5k:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=DbSF26Zo2y8:t0Cot4vKJ5k:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=DbSF26Zo2y8:t0Cot4vKJ5k:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=DbSF26Zo2y8:t0Cot4vKJ5k:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=DbSF26Zo2y8:t0Cot4vKJ5k:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=DbSF26Zo2y8:t0Cot4vKJ5k:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/DbSF26Zo2y8" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/johnteague/2013/04/25/pablos-fiesta-is-back/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/4ec3c07d6f4527238a3f5c6ec5fefd63?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">John Teague</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/johnteague/2013/04/25/pablos-fiesta-is-back/</feedburner:origLink></item>
	<item>
		<title>Prosthetics And Orthotics: Building Backbone Plugins</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/4RossBE0bL0/</link>
		<comments>http://lostechies.com/derickbailey/2013/04/22/prosthetics-and-orthotics-building-backbone-plugins/#comments</comments>
		<pubDate>Mon, 22 Apr 2013 13:10:13 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[Backbone]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[Marionette]]></category>
		<category><![CDATA[Principles and Patterns]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/derickbailey/?p=1091]]></guid>
		<description><![CDATA[A long time ago, in a galaxy far, far away…  It was almost a year ago that I announced a book on building Backbone.js plugins. Since then… nothing. Well I finally got tired of sitting on it and over the&#160;&#8230; <a href="http://lostechies.com/derickbailey/2013/04/22/prosthetics-and-orthotics-building-backbone-plugins/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>A long time ago, in a galaxy far, far away… </p>
<p>It was almost a year ago that <a href="http://lostechies.com/derickbailey/2012/07/06/im-wring-a-book-on-building-backbone-plugins/">I announced a book</a> on building Backbone.js plugins. Since then… nothing. Well I finally got tired of sitting on it and over the weekend I made a bunch of edits, cleaned up a lot and released the first 6 chapters of the book via Leanpub!</p>
<p><a href="https://leanpub.com/building-backbone-plugins">https://leanpub.com/building-backbone-plugins</a></p>
<blockquote>
<p>Learn the how and why of building plugins for Backbone.js. This book provides first hand lessons learned, best practices, and patterns for building flexible add-ons and frameworks components, based on my experience &#8211; both success and failure &#8211; from the last few years of working with Backbone and building plugins for it!</p>
</blockquote>
<h2>On Buidling Backbone Plugins</h2>
<p>I&#8217;ve built more than a handful of Backbone related tools, plugins and add-ons in my time working with it. From nearly the beginning of my exploration and use of Backbone, in fact, I&#8217;ve been looking for and developing better methods of handling common tasks and solving the same problems. This has led me to create plugins and frameworks such as <a href="http://github.com/derickbailey/backbone.marionette" target="_self">MarionetteJS</a> (Backbone.Marionette), <a href="http://github.com/derickbailey/backbone.picky" target="_self">Backbone.Picky</a>, <a href="http://github.com/derickbailey/backbone.modelbinding" target="_self">Backbone.ModelBinding</a> and many more &#8211; some published on my Github account, many unpublished and created for a specific client application.</p>
<p>In all of the plugins and add-ons that I&#8217;ve built, there have been lessons learned. The continued success of frameworks like MarionetteJS provide many useful insights in to how to properly create view layers and additional object types that support the creation of large Backbone application. Equally as valuable, though, failures such as Backbone.Modelbinding provide insight in to the patterns and practices that should be avoided when creating add-ons. Or, at least, they illustrate some of the scenarios and circumstances in which these patterns and practices fall apart.</p>
<h2>A Work In Progress</h2>
<p>This book is a work in progress, with 6 chapters roughly completed at this time, 3 or 4 additional chapters in rough draft, and one or two chapters planned beyond that. Expect this book to change over time, with edits and additional chapters being added. Early adopters will be able to purchase the book at a discounted price. The amount of demand I am seeing from early adopers will largely determine the schedule that I keep for additional releases, and the eventual price that is charged for the finished product.</p>
<p><a href="https://leanpub.com/building-backbone-plugins">https://leanpub.com/building-backbone-plugins</a> </p>
<p> </p>
<p>Be sure to follow the book on twitter for updates, as well: <a href="http://twitter.com/backboneplugins">@BackbonePlugins</a></p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=4RossBE0bL0:aY3FNXI9LvM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=4RossBE0bL0:aY3FNXI9LvM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=4RossBE0bL0:aY3FNXI9LvM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=4RossBE0bL0:aY3FNXI9LvM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=4RossBE0bL0:aY3FNXI9LvM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=4RossBE0bL0:aY3FNXI9LvM:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/4RossBE0bL0" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/derickbailey/2013/04/22/prosthetics-and-orthotics-building-backbone-plugins/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/e592bd1326b1e80188ed4c0bf26b9f75?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Derick Bailey</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/derickbailey/2013/04/22/prosthetics-and-orthotics-building-backbone-plugins/</feedburner:origLink></item>
	<item>
		<title>A First Look At My Arduino BBQ Thermometer</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/yjuZaXXEoEE/</link>
		<comments>http://lostechies.com/derickbailey/2013/04/10/a-first-look-at-my-arduino-bbq-thermometer/#comments</comments>
		<pubDate>Wed, 10 Apr 2013 17:01:07 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[KendoUI]]></category>
		<category><![CDATA[Mobile]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/derickbailey/?p=1089]]></guid>
		<description><![CDATA[I&#8217;ve uploaded a first look at the Arduino powered BBQ thermometer and software that I&#8217;m building. It&#8217;s using an Arduino Uno with Ethernet shield.  The probe is a 100K &#8220;meat probe&#8221; (aka &#8220;thermistor&#8221;) that I took from a store bought&#160;&#8230; <a href="http://lostechies.com/derickbailey/2013/04/10/a-first-look-at-my-arduino-bbq-thermometer/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve uploaded a first look at the <a href="http://arduino.cc/">Arduino</a> powered BBQ thermometer and software that I&#8217;m building. It&#8217;s using an <a href="http://www.amazon.com/gp/product/B006H06TVG/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B006H06TVG&amp;linkCode=as2&amp;tag=avocadosoftwa-20">Arduino Uno</a> with <a href="http://www.amazon.com/gp/product/B006UT97FE/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B006UT97FE&amp;linkCode=as2&amp;tag=avocadosoftwa-20">Ethernet shield</a>. </p>
<p><iframe src="http://www.youtube.com/embed/29qBI7IWFl4" width="640" height="480" frameborder="0"></iframe></p>
<p>The probe is a 100K &#8220;meat probe&#8221; (aka &#8220;thermistor&#8221;) that I took from a store bought meat thermometer. Something like <a href="http://www.amazon.com/gp/product/B0048GD8RY/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0048GD8RY&amp;linkCode=as2&amp;tag=avocadosoftwa-20">this replacement probe</a> would work great. It&#8217;s a bit of a guessing game as to wether the probe is a 10k or 100k Ohm probe. I tried 10, 100, 1k, 10k and finally 100k resistors in my thermistor setup. You can read about thermistor setup on <a href="http://playground.arduino.cc/ComponentLib/Thermistor">the Arduino playground</a>, and at <a href="http://www.hacktronics.com/Tutorials/arduino-thermistor-tutorial.html">Hacktronics</a>.</p>
<p>The Arduino code produces a JSON document when I make an HTTP request to it. The software is built with <a href="http://www.kendoui.com/mobile">Kendo UI Mobile</a>, and reads the JSON document on a 1 second interval.</p>
<p>I&#8217;ll be blogging about this more, and hopefully soon, with plans on going through a step by step &#8220;how I learned&#8221; series &#8211; at least, that&#8217;s the plan. For now, this little teaser video should give you a good idea of what can be done with an Arduino, some simple parts from a store, and a mobile app framework like <a href="http://www.kendoui.com/mobile">Kendo UI Mobile</a>. :)</p>
<p>… I need to learn how to optimize my C code for battery life. I&#8217;ve run that 9volt battery maybe 10 or 20 minutes, total, and it&#8217;s already dead. :P</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=yjuZaXXEoEE:DlVsKPD6nss:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=yjuZaXXEoEE:DlVsKPD6nss:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=yjuZaXXEoEE:DlVsKPD6nss:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=yjuZaXXEoEE:DlVsKPD6nss:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=yjuZaXXEoEE:DlVsKPD6nss:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=yjuZaXXEoEE:DlVsKPD6nss:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/yjuZaXXEoEE" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/derickbailey/2013/04/10/a-first-look-at-my-arduino-bbq-thermometer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/e592bd1326b1e80188ed4c0bf26b9f75?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Derick Bailey</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/derickbailey/2013/04/10/a-first-look-at-my-arduino-bbq-thermometer/</feedburner:origLink></item>
	<item>
		<title>An Evernote backed Journal using Vim/Emacs</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/hj470XKxH18/</link>
		<comments>http://lostechies.com/ryansvihla/2013/04/07/an-evernote-backed-journal-using-vimemacs/#comments</comments>
		<pubDate>Sun, 07 Apr 2013 16:54:31 +0000</pubDate>
		<dc:creator>Ryan Svihla</dc:creator>
				<category><![CDATA[Evernote]]></category>
		<category><![CDATA[Vim]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/ryansvihla/?p=73]]></guid>
		<description><![CDATA[I journal quite a bit and my holy grail has been using my favorite text editor (Vim or Vim bindings) with Evernote to store the everything in a smart searchable format. Today I stumbled onto a neat little tool that makes&#160;&#8230; <a href="http://lostechies.com/ryansvihla/2013/04/07/an-evernote-backed-journal-using-vimemacs/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>I journal quite a bit and my holy grail has been using my favorite text editor (Vim or Vim bindings) with Evernote to store the everything in a smart searchable format. Today I stumbled onto a neat little tool that makes this all happen called Geeknote http://www.geeknote.me/.  It&#8217;s written in Python and works fine on my Mac.</p>
<h3>Installing Geeknote</h3>
<div>In the directory of your choosing run the following script.  This will checkout the latest copy from source and allow you to login:</div>
<div>
<blockquote>
<div id="file-install_geeknote-LC1" class="line"><span class="c" style="color: #999988; font-style: italic;">#!/bin/sh</span></div>
<div id="file-install_geeknote-LC2" class="line"><span class="c" style="color: #999988; font-style: italic;"># Download the repository.</span></div>
<div id="file-install_geeknote-LC3" class="line">git clone git://github.com/VitaliyRodnenko/geeknote.git</div>
<div id="file-install_geeknote-LC4" class="line"></div>
<div id="file-install_geeknote-LC5" class="line"><span class="nb" style="color: #0086b3;">cd </span>geeknote</div>
<div id="file-install_geeknote-LC6" class="line"></div>
<div id="file-install_geeknote-LC7" class="line"><span class="c" style="color: #999988; font-style: italic;"># Launch Geeknote and go through login procedure.</span></div>
<div id="file-install_geeknote-LC8" class="line">python geeknote.py login</div>
<div id="file-install_geeknote-LC9" class="line"><span class="c" style="color: #999988; font-style: italic;">#change vim to whatever you want it to be</span></div>
<div id="file-install_geeknote-LC11" class="line">python geeknote.py settings &#8211;editor vim</div>
</blockquote>
</div>
<div></div>
<div>Then add the following script and execute it from whatever directory you want to install Geeknote into</div>
<div>
<blockquote>
<div id="file-gistfile1-sh-LC1" class="line"><span class="c" style="color: #999988; font-style: italic;">#!/bin/sh</span></div>
<div id="file-gistfile1-sh-LC2" class="line"></div>
<div id="file-gistfile1-sh-LC3" class="line"><span class="c" style="color: #999988; font-style: italic;">#change checkout_dir to match where you&#8217;ve checked out the latest</span></div>
<div id="file-gistfile1-sh-LC4" class="line"><span class="nv" style="color: teal;">checkout_dir</span><span class="o" style="font-weight: bold;">=</span>~/Documents/geeknote</div>
<div id="file-gistfile1-sh-LC5" class="line"><span class="c" style="color: #999988; font-style: italic;">#change notebook to whatever notebook you use as your journal</span></div>
<div id="file-gistfile1-sh-LC6" class="line"><span class="nv" style="color: teal;">notebook</span><span class="o" style="font-weight: bold;">=</span>Journal</div>
<div id="file-gistfile1-sh-LC7" class="line"><span class="nv" style="color: teal;">title</span><span class="o" style="font-weight: bold;">=</span><span class="nv" style="color: teal;">$1</span></div>
<div id="file-gistfile1-sh-LC8" class="line"><span class="k" style="font-weight: bold;">if</span> <span class="o" style="font-weight: bold;">[</span> -z <span class="s2" style="color: #dd1144;">"$1"</span> <span class="o" style="font-weight: bold;">]</span></div>
<div id="file-gistfile1-sh-LC9" class="line"><span class="k" style="font-weight: bold;">    then</span></div>
<div id="file-gistfile1-sh-LC10" class="line"><span class="nv" style="color: teal;">        title</span><span class="o" style="font-weight: bold;">=</span><span class="k" style="font-weight: bold;">$(</span>date +%Y-%m-%d<span class="k" style="font-weight: bold;">)</span></div>
<div id="file-gistfile1-sh-LC11" class="line"><span class="k" style="font-weight: bold;">fi</span></div>
<div id="file-gistfile1-sh-LC12" class="line"><span class="nb" style="color: #0086b3;">echo </span>creating a note named <span class="nv" style="color: teal;">$title</span> in the <span class="nv" style="color: teal;">$notebook</span> notebook</div>
<div id="file-gistfile1-sh-LC13" class="line"></div>
<div id="file-gistfile1-sh-LC14" class="line">python <span class="nv" style="color: teal;">$checkout_dir</span>/geeknote.py create &#8211;title <span class="nv" style="color: teal;">$title</span> &#8211;notebook <span class="nv" style="color: teal;">$notebook</span> &#8211;content <span class="s2" style="color: #dd1144;">&#8220;test&#8221;</span></div>
<div id="file-gistfile1-sh-LC15" class="line">python <span class="nv" style="color: teal;">$checkout_dir</span>/geeknote.py edit &#8211;note <span class="nv" style="color: teal;">$title</span> &#8211;notebook <span class="nv" style="color: teal;">$notebook</span> &#8211;content <span class="s2" style="color: #dd1144;">&#8220;WRITE&#8221;</span></div>
</blockquote>
</div>
<div>
<h3>Writing Journal Entries</h3>
<div>My script is named journal so for me I just type either of the following:</div>
<blockquote>
<div><span style="background-color: white; font-family: monospace; font-size: 12px; line-height: 16px; white-space: pre;">journal </span> <span style="background-color: white; color: #999988; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; font-style: italic; line-height: 16px;">#creates a note in journal with todays date as the title</span></div>
</blockquote>
<div>or</div>
<blockquote>
<div><span style="background-color: white; font-family: monospace; font-size: 12px; line-height: 16px; white-space: pre;">journal custom_title </span> <span style="background-color: white; color: #999988; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; font-style: italic; line-height: 16px;">#no spaces allowed and will use the title specified</span></div>
</blockquote>
<div></div>
<h3>Summary</h3>
<div>With a few simple scripts and in moments you two can be writing notes in the command prompt. I highly recommend you extend these scripts to your needs or just use the Geeknote command prompt as you see fit.  <span style="background-color: white; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 16px;"> </span></div>
<p>&nbsp;</p>
</div>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=hj470XKxH18:diqsi4GY0O8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=hj470XKxH18:diqsi4GY0O8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=hj470XKxH18:diqsi4GY0O8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=hj470XKxH18:diqsi4GY0O8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=hj470XKxH18:diqsi4GY0O8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=hj470XKxH18:diqsi4GY0O8:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/hj470XKxH18" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/ryansvihla/2013/04/07/an-evernote-backed-journal-using-vimemacs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/0438ccea75300839c59c11cc880ccf16?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Ryan Svihla</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/ryansvihla/2013/04/07/an-evernote-backed-journal-using-vimemacs/</feedburner:origLink></item>
	<item>
		<title>Announcing posh-tf</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/alFg5om-8Wo/</link>
		<comments>http://lostechies.com/keithdahlby/2013/04/01/announcing-posh-tf/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 06:27:35 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[posh-git]]></category>
		<category><![CDATA[posh-tf]]></category>
		<category><![CDATA[powershell]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/keithdahlby/?p=122]]></guid>
		<description><![CDATA[As you may or may not know, I&#8217;ve been a fan of Git for a while now. I&#8217;ve hacked on an implementation of it, I&#8217;ve presented on it, I&#8217;ve even built a PowerShell environment for it that&#8217;s used by at&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2013/04/01/announcing-posh-tf/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>As you may or may not know, I&#8217;ve been a fan of Git for a while now. I&#8217;ve <a title="Contributions to LibGit2Sharp" href="https://github.com/libgit2/libgit2sharp/commits/vNext?author=dahlbyk">hacked</a> on an implementation of it, I&#8217;ve <a title="Git More Done @ NDC" href="http://vimeo.com/43659036">presented</a> on it, I&#8217;ve even built a <a title="posh-git" href="http://github.com/dahlbyk/posh-git">PowerShell environment</a> for it that&#8217;s used by at least twelve people that aren&#8217;t related to me. Until a few months ago, I was content in my little Git bubble.</p>
<p>But recently I&#8217;ve been working with a team that has broadened my horizons and imparted a valuable lesson to me: &#8220;there&#8217;s nothing Git can do that TFS can&#8217;t.&#8221; Now if you&#8217;ve been following me for a while, you know this has been patently untrue. Until today.</p>
<h1>Announcing posh-tf</h1>
<p>Obviously the killer feature that TFS lacks as an alternative to Git is that it doesn&#8217;t integrate well with PowerShell. According to the <a title="TFS UserVoice: Provide a better tf.exe experience with PowerShell" href="http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3801822-provide-a-better-tf-exe-experience-with-powershell">UserVoice suggestion</a>, at least one person thinks this needs to be remedied. And so I am pleased to present <a href="https://github.com/dahlbyk/posh-tf">posh-tf: a PowerShell environment for Team Foundation</a>.</p>
<p>posh-tf provides everything that posh-git provides, except for the things that aren&#8217;t readily available from <code>tf.exe</code>:</p>
<ul>
<li>No current branch information</li>
<li>No file status information</li>
<li>No tab completion for new, modified or deleted files</li>
<li>No tab completion for branches, shelvesets, etc</li>
</ul>
<p>Actually, it would probably be easier to just list what it does provide:</p>
<ul>
<li>Tab expansion for commands: <code>tf ch&lt;tab&gt;</code> expands to <code>tf checkout</code></li>
<li>Tab expansion for help: <code>tf help ch&lt;tab&gt;</code> expands to <code>tf help checkout</code></li>
<li>A prompt hook if someone can figure out a way to get current directory status.</li>
</ul>
<p>Can&#8217;t wait to get started? The <a href="https://github.com/dahlbyk/posh-tf#readme">readme</a> has everything you need!</p>
<p>I&#8217;m thrilled with what I have to release today, and am looking forward to working with the TFS community to make posh-tf even better!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=alFg5om-8Wo:Ti6aKkxUq2g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=alFg5om-8Wo:Ti6aKkxUq2g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=alFg5om-8Wo:Ti6aKkxUq2g:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=alFg5om-8Wo:Ti6aKkxUq2g:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=alFg5om-8Wo:Ti6aKkxUq2g:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=alFg5om-8Wo:Ti6aKkxUq2g:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/alFg5om-8Wo" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/keithdahlby/2013/04/01/announcing-posh-tf/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/43a5676a300a54ffdc903e49a2db9060?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Keith Dahlby</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/keithdahlby/2013/04/01/announcing-posh-tf/</feedburner:origLink></item>
	<item>
		<title>Implementing Routing Slip with MassTransit</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/HjvA5vSn86M/</link>
		<comments>http://lostechies.com/chrispatterson/2013/03/28/implementing-routing-slip-with-masstransit/#comments</comments>
		<pubDate>Thu, 28 Mar 2013 23:49:00 +0000</pubDate>
		<dc:creator>Chris Patterson</dc:creator>
				<category><![CDATA[masstransit]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/chrispatterson/?p=106]]></guid>
		<description><![CDATA[This article introduces MassTransit.Courier, a new project that implements the routing slip pattern on top of MassTransit, a free, open-source, and lightweight message bus for the .NET platform. Introduction When sagas were originally conceived in MassTransit, they were inspired by&#160;&#8230; <a href="http://lostechies.com/chrispatterson/2013/03/28/implementing-routing-slip-with-masstransit/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p><em>This article introduces <a href="https://github.com/MassTransit/MassTransit-Courier">MassTransit.Courier</a>, a new project that implements the routing slip pattern on top of <a href="http://masstransit-project.com/">MassTransit</a>, a free, <a href="https://github.com/MassTransit/MassTransit">open-source</a>, and lightweight message bus for the .NET platform.</em></p>
<h2>Introduction</h2>
<p>When sagas were originally conceived in MassTransit, they were inspired by an <a href="http://rgoarchitects.bit.ly/4xNwpp">excerpt</a> from Chapter 5 in the book <a href="http://www.manning.com/rotem/">SOA Patterns</a> by <a href="http://arnon.me/">Arnon Rotem-Gal Oz</a>. Over the past few months, the community has <s>argued</s> discussed how the use of the word saga has led to confusion and how early implementations included in both NServiceBus and MassTransit do not actually align with the <a href="http://www.cs.cornell.edu/andru/cs711/2002fa/reading/sagas.pdf">original paper</a> published in 1987 by Princeton University and written by Hector Garcia-Molina and Kenneth Salem in which the term was coined.</p>
<p>With MassTransit Courier, the intent is to provide a mechanism for creating and executing distributed transactions with fault compensation that can be used alongside the existing MassTransit sagas for monitoring and recovery.</p>
<h2>Background</h2>
<p>Over the past few years building distributed systems using MassTransit, a pattern I consistently see repeated is the orchestration of multiple services into a single business transaction. Using the existing MassTransit saga support to manage the state of the transaction, the actual processing steps are created as autonomous services that are invoked by the saga using command messages. Command completion is observed using an event or response message by the saga, at which point the next processing step is invoked. When the saga has invoked the final service the business transaction is complete.</p>
<p>As the processing required within a business transaction changes with evolving business requirements, a new version of the saga is required that includes the newly created processing steps. Knowledge of the new services becomes part of the saga, as well as the logic to identify which services need to be invoked for each transaction. The saga becomes rich with knowledge, and with great knowledge comes great responsibility (after all, knowledge is power right?). Now, instead of only orchestrating the transaction, the saga is responsible for identifying which services to invoke based on the content of the transaction. Another concern was the level of database contention on the saga tables. With every service invocation being initiated by the saga, combined with the saga observing service events and responses, the saga tables gets very busy.</p>
<p>Beyond the complexity of increasing saga responsibilities, more recently the business has requested the ability to selectively route a message through a series of services based on the content of the message. In addition to being able to dynamically route messages, the business needs to allow new services to be created and added to the inventory of available services. And this should be possible without modifying a central control point that dispatches messages to each service.</p>
<p>Like most things in computer science, this problem has already been solved.</p>
<h2>The Routing Slip Pattern</h2>
<p>A routing slip specifies a sequence of processing steps for a message. As each processing step completes, the routing slip is forwarded to the next step. When all the processing steps have completed, the routing slip is complete.</p>
<p>A key advantage to using a routing slip is it allows the processing steps to vary for each message. Depending upon the content of the message, the routing slip creator can selectively add processing steps to the routing slip. This dynamic behavior is in contrast to a more explicit behavior defined by a state machine or sequential workflow that is statically defined (either through the use of code, a DSL, or something like Windows Workflow).</p>
<h2>MassTransit Courier</h2>
<p>MassTransit Courier is a framework that implements the routing slip pattern. Leveraging a durable messaging transport and the advanced saga features of MassTransit, MassTransit Courier provides a powerful set of components to simplify the use of routing slips in distributed applications. Combining the routing slip pattern with a <a href="https://github.com/phatboyg/Automatonymous">state machine such as Automatonymous</a> results in a reliable, recoverable, and supportable approach for coordinating and monitoring message processing across multiple services.</p>
<p>In addition to the basic routing slip pattern, MassTransit Courier also supports <a href="http://en.wikipedia.org/wiki/Compensation_%28engineering%29">compensations</a> which allow processing steps to store process-related data so that reversible operations can be undone, using either a traditional rollback mechanism or by applying an offsetting operation. For example, a processing step that holds a seat for a patron could release the held seat when compensated.</p>
<p>MassTransit Courier is free software and is covered by the same open source license as MassTransit (Apache 2.0). You can install <a href="https://github.com/MassTransit/MassTransit-Courier">MassTransit.Courier</a> into your existing solution using <a href="http://nuget.org/packages/masstransit.courier">NuGet</a>.</p>
<h2>Activities</h2>
<p>In MassTransit Courier, an <em>Activity</em> refers to a processing step that can be added to a routing slip. To create an activity, create a class that implements the <em>Activity</em> interface.</p>
<pre><code>public class DownloadImageActivity :
    Activity&lt;DownloadImageArguments, DownloadImageLog&gt;
{
}
</code></pre>
<p>The <em>Activity</em> interface is generic with two arguments. The first argument specifies the activity’s input type and the second argument specifies the activity’s log type. In the example shown above, <em>DownloadImageArguments</em> is the input type and <em>DownloadImageLog</em> is the log type. Both arguments must be interface types so that the implementations can be dynamically created.</p>
<h3>Implementing an Activity</h3>
<p>An activity must implement two interface methods, <em>Execute</em> and <em>Compensate</em>. The <em>Execute</em> method is called while the routing slip is executing activities and the <em>Compensate</em> method is called when a routing slip faults and needs to be compensated.</p>
<p>When the <em>Execute</em> method is called, an <em>execution</em> argument is passed containing the activity arguments, the routing slip <em>TrackingNumber</em>, and methods to mark the activity as completed or faulted. The actual routing slip message, as well as any details of the underlying infrastructure, are excluded from the <em>execution</em> argument to prevent coupling between the activity and the implementation. An example <em>Execute</em> method is shown below.</p>
<pre><code>ExecutionResult Execute(Execution&lt;DownloadImageArguments&gt; execution)
{
    DownloadImageArguments args = execution.Arguments;
    string imageSavePath = Path.Combine(args.WorkPath, 
        execution.TrackingNumber.ToString());

    _httpClient.GetAndSave(args.ImageUri, imageSavePath);

    return execution.Completed(new DownloadImageLogImpl(imageSavePath));
}
</code></pre>
<p>Once activity processing is complete, the activity returns an <em>ExecutionResult</em> to the host. If the activity executes successfully, the activity can elect to store compensation data in an activity log which is passed to the <em>Completed</em> method on the <em>execution</em> argument. If the activity chooses not to store any compensation data, the activity log argument is not required. In addition to compensation data, the activity can add or modify variables stored in the routing slip for use by subsequent activities.</p>
<blockquote>
<p>In the example above, the activity creates an instance of a private class that implements the <em>DownloadImageLog</em> interface and stores the log information in the object properties. The object is then passed to the <em>Completed</em> method for storage in the routing slip before sending the routing slip to the next activity. </p>
</blockquote>
<p>When an activity fails, the <em>Compensate</em> method is called for previously executed activities in the routing slip that stored compensation data. If an activity does not store any compensation data, the <em>Compensate</em> method is never called. The compensation method for the example above is shown below.</p>
<pre><code>CompensationResult Compensate(Compensation&lt;DownloadImageLog&gt; compensation)
{
    DownloadImageLog log = compensation.Log;
    File.Delete(log.ImageSavePath);

    return compensation.Compensated();
}
</code></pre>
<p>Using the activity log data, the activity compensates by removing the downloaded image from the work directory. Once the activity has compensated the previous execution, it returns a <em>CompensationResult</em> by calling the <em>Compensated</em> method. If the compensating actions could not be performed (either via logic or an exception) and the inability to compensate results in a failure state, the <em>Failed</em> method can be used instead, optionally specifying an <em>Exception</em>.</p>
<h2>Building a Routing Slip</h2>
<p>Developers are discouraged from directly implementing the <em>RoutingSlip</em> message type and should instead use a <em>RoutingSlipBuilder</em> to create a routing slip. The <em>RoutingSlipBuilder</em> encapsulates the creation of the routing slip and includes methods to add activities, activity logs, and variables to the routing slip. For example, to create a routing slip with two activities and an additional variable, a developer would write:</p>
<pre><code>var builder = new RoutingSlipBuilder(NewId.NextGuid());
builder.AddActivity(“DownloadImage”, “rabbitmq://localhost/execute_downloadimage”, new
    {
        ImageUri = new Uri(“http://images.google.com/someImage.jpg”)
    });
builder.AddActivity(“FilterImage”, “rabbitmq://localhost/execute_filterimage”);
builder.AddVariable(“WorkPath”, “\\dfs\work”);

var routingSlip = builder.Build();
</code></pre>
<p>Each activity requires a name for display purposes and a URI specifying the execution address. The execution address is where the routing slip should be sent to execute the activity. For each activity, arguments can be specified that are stored and presented to the activity via the activity arguments interface type specify by the first argument of the <em>Activity</em> interface. The activities added to the routing slip are combined into an <em>Itinerary</em>, which is the list of activities to be executed, and stored in the routing slip.</p>
<blockquote>
<p>Managing the inventory of available activities, as well as their names and execution addresses, is the responsibility of the application and is not part of the MassTransit Courier. Since activities are application specific, and the business logic to determine which activities to execute and in what order is part of the application domain, the details are left to the application developer.</p>
</blockquote>
<p>Once built, the routing slip is executed, which sends it to the first activity’s execute URI. To make it easy and to ensure that source information is included, an extension method to <em>IServiceBus</em> is available, the usage of which is shown below.</p>
<pre><code>bus.Execute(routingSlip); // pretty exciting, eh?
</code></pre>
<p>It should be pointed out that if the URI for the first activity is invalid or cannot be reached, an exception will be thrown by the <em>Execute</em> method.</p>
<h2>Hosting Activities in MassTransit</h2>
<p>To host an activity in a MassTransit service bus instance, the configuration namespace has been extended to include two additional subscription methods (thanks to the power of extension methods and a flexible configuration syntax, no changes to MassTransit were required). Shown below is the configuration used to host an activity.</p>
<pre><code>var executeUri = new Uri(“rabbitmq://localhost/execute_example”);
var compensateUri = new Uri(“rabbitmq://localhost/compensate_example”);

IServiceBus compensateBus = ServiceBusFactory.New(x =&gt;
    {
        x.ReceiveFrom(compensateUri);
        x.Subscribe(s =&gt; s.CompensateActivityHost&lt;ExampleActivity, ExampleLog&gt;(
            _ =&gt; new ExampleActivity());
    });

IServiceBus executeBus = ServiceBusFactory.New(x =&gt;
    {
        x.ReceiveFrom(executeUri);
        x.Subscribe(s =&gt; s.ExecuteActivityHost&lt;ExampleActivity, ExampleArguments&gt;(
            compensateUri,
             _ =&gt; new ExampleActivity());
    });
</code></pre>
<p>In the above example two service bus instances are created, each with their own input queue. For execution, the routing slip is sent to the execution URI, and for compensation the routing slip is sent to the compensation URI. The actual URIs used are up to the application developer, the example merely shows the recommended approach so that the two addresses are easily distinguished. The URIs <strong>must</strong> be different!</p>
<h2>Monitoring Routing Slips</h2>
<p>During routing slip execution, events are published when the routing slip completes or faults. Every event message includes the <em>TrackingNumber</em> as well as a <em>Timestamp</em> (in UTC, of course) indicating when the event occurred:</p>
<ul>
<li>RoutingSlipCompleted</li>
<li>RoutingSlipFaulted</li>
<li>RoutingSlipCompensationFailed</li>
</ul>
<p>Additional events are published for each activity, including:</p>
<ul>
<li>RoutingSlipActivityCompleted</li>
<li>RoutingSlipActivityFaulted</li>
<li>RoutingSlipActivityCompensated</li>
<li>RoutingSlipActivityCompensationFailed</li>
</ul>
<p>By observing these events, an application can monitor and track the state of a routing slip. To maintain the current state, an Automatonymous state machine could be created. To maintain history, events could be stored in a database and then queried using the <em>TrackingNumber</em> of the <em>RoutingSlip</em>.</p>
<h2>Wrapping Up</h2>
<p>MassTransit Courier is a great way to compose dynamic processing steps into a routing slip that can be executed, monitored, and compensated in the event of a fault. When used in combination with the existing saga features of MassTransit, it is possible to coordinate a distributed set of services into a reliable and supportable system.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=HjvA5vSn86M:o8nLfaXXTOo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=HjvA5vSn86M:o8nLfaXXTOo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=HjvA5vSn86M:o8nLfaXXTOo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=HjvA5vSn86M:o8nLfaXXTOo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=HjvA5vSn86M:o8nLfaXXTOo:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=HjvA5vSn86M:o8nLfaXXTOo:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/HjvA5vSn86M" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/chrispatterson/2013/03/28/implementing-routing-slip-with-masstransit/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/0e12b6dc468379c7067c55f2fa609c37?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Chris Patterson</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/chrispatterson/2013/03/28/implementing-routing-slip-with-masstransit/</feedburner:origLink></item>
	<item>
		<title>Scaling NServiceBus Sagas</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/kwQszsB3nck/</link>
		<comments>http://lostechies.com/jimmybogard/2013/03/26/scaling-nservicebus-sagas/#comments</comments>
		<pubDate>Tue, 26 Mar 2013 13:57:28 +0000</pubDate>
		<dc:creator>Jimmy Bogard</dc:creator>
				<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[SOA]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/jimmybogard/?p=759]]></guid>
		<description><![CDATA[When looking at NServiceBus sagas (process managers), especially at high volume of messages, we often run into two main problems: Deadlocks Starvation This is because of the fundamental (default) design of sagas is that: A single saga shares a single&#160;&#8230; <a href="http://lostechies.com/jimmybogard/2013/03/26/scaling-nservicebus-sagas/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>When looking at NServiceBus sagas (<a href="http://www.eaipatterns.com/ProcessManager.html">process managers</a>), especially at high volume of messages, we often run into two main problems:</p>
<ul>
<li>Deadlocks
<li>Starvation</li>
</ul>
<p>This is because of the fundamental (default) design of sagas is that:</p>
<ul>
<li>A single saga shares a single saga entity (causing deadlocks)
<li>All messages handled by a saga are delivered to the same endpoint (causing a bottleneck)</li>
</ul>
<p>Two very different problems, with very different solutions. But, as per usual, we’ll look at how we might handle these situations in the real life to see how our virtual world should behave. Both of these problems (amongst others) are called out in the Enterprise Integration Patterns book, so it shouldn’t be a surprise if you run into these issues. Not as clear, however, is how to deal with them.</p>
<h3>Deadlocks</h3>
<p>Deadlocks in sagas are pretty easy to run into if we start pumping up the concurrency on our sagas. Back in our McDonald’s example, we published a message out and waited for all of the stations to report back:</p>
<p><a href="http://lostechies.com/jimmybogard/files/2013/03/image7.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://lostechies.com/jimmybogard/files/2013/03/image_thumb7.png" width="471" height="407"></a></p>
<p>In our restaurant, there’s only room for one person to examine a single tray at a time. When someone finishes a food item, they have to go look at all the trays. But what if someone is putting food on my tray? Do I push them out of the way?</p>
<p>Probably not, I need to wait for them to finish. It turns out that this is what happens in our sagas – we can only really allow one person at a time to affect a saga instance. The way NServiceBus can handle this by default is by adjusting the isolation level for Serializable transactions. This ensures that only one person looks at a tray at any given time.</p>
<p>What we don’t want to have happen is the fries person look at the tray, see a missing sandwich, and decide that the order isn’t done. The sandwich person does the same thing in reverse – look at the tray, see missing fries, and decide the order isn’t done.</p>
<p>It turns out that our Serializable isolation level has unintended consequences – we might lock more trays (or ALL of the trays) unintentionally. If there are more than one message that can start our saga, then effectively every employee has to look at all the trays to see if our tray is already on the counter, or we’re the first one and need to put a new one out. But if someone is also doing the same thing – multiple trays for the same order might go out!</p>
<p>We don’t want to block the entire counter for our order, so we can adjust our scheme slightly. If we implement a simple versioning scheme, we can simply have the employees look at a version number on the receipt, make their changes, and bump the version number with a little tally mark. If the tally mark has gone up since we last looked at the tray, we’ll just re-do our work – something has changed, so let’s reevaluate our decisions.</p>
<p>To get around the problem of too many trays for the same order, we can rely on a third party to ensure we don’t have too many trays. If when anyone places a tray down, the supervisor enforces this rule that only one tray per order can exist, they’ll ask us to put our tray back up and redo our work.</p>
<p>Two things we want to do then:</p>
<ul>
<li>Introduce a unique constraint on the correlation identifier to prevent duplicates
<li>Use optimistic concurrency to allow us to isolate just our own tray (and not affect anyone else)</li>
</ul>
<p>This is a rather straightforward fix – and in fact, NServiceBus defaults to using optimistic concurrency in 4.0 (now in beta). This was a rather easy fix, but what about our other problem of the bottleneck?</p>
<h3>Starvation and bottlenecks</h3>
<p>Back in my early days of school, I worked at a fast food restaurant during breaks (surprise, surprise). I worked the graveyard shift of a 24-hour burger joint, and it was just me and one other person manning the entire place. From 10PM to 6AM, just two of us.</p>
<p>One thing that I found pretty early was that we had quite a few “regulars”. These were folks that every morning, came in and ordered the same thing at around the same time. Because it was quite early, they could rely on little to no contention for resources, and the queue was more or less empty.</p>
<p>Most of the time.</p>
<p>But every once in a while, we would get someone ordering food for a large group of people. We didn’t do catering, but we did sell breakfast tacos. Handling one or two at a time wasn’t a problem, but someone coming in and ordering 50 tacos – that’s a problem. Our process looked something like this:</p>
<p><a href="http://lostechies.com/jimmybogard/files/2013/03/image8.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://lostechies.com/jimmybogard/files/2013/03/image_thumb8.png" width="607" height="257"></a></p>
<p>The problem was, because there were only two of us, most messages flowed through exactly one channel. In NServiceBus Sagas, this is what happens as well – all messages for a saga are delivered to a single endpoint. We might have the situation like this:</p>
<table cellspacing="0" cellpadding="2" width="133" border="1">
<tbody>
<tr>
<td valign="top" width="131"><strong>Saga Queue</strong></td>
</tr>
<tr>
<td valign="top" width="131">Prep Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Prep Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Prep Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Prep Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Prep Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Prep Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Prep Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Prep Pancakes – #2</td>
</tr>
</tbody>
</table>
<p>My cook has dozens of tacos to go through before getting to that second order, and because that person packs all the food <em>and</em> preps all the food, all items from the first order must be both prepped and packed before order #2 is complete:</p>
<table cellspacing="0" cellpadding="2" width="133" border="1">
<tbody>
<tr>
<td valign="top" width="131"><strong>Saga Queue</strong></td>
</tr>
<tr>
<td valign="top" width="131">Pack Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Pack Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Pack Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Pack Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Pack Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Pack Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Pack Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Pack Pancakes – #2</td>
</tr>
</tbody>
</table>
<p>That’s not a huge problem, except we have both packing and prepping done by a single person. Another order comes in, the prepping for that one interferes with the others. Additionally, items are sitting in the saga queue waiting to get packed while prepping finishes.</p>
<p>In many NServiceBus sagas, the sagas themselves don’t perform the actual work. They’re instead the controllers/coordinators, making decisions about next steps. But all the messages are delivered to the exact same queue, effectively creating a bottleneck. I’m waiting for <em>all</em> prepping to be done before moving on to <em>any</em> packing. The time it takes to this entire set of orders is basically the time it takes to prep all items plus the time it takes to pack all items.</p>
<p>The problem is our saga is modeled rather strangely. In the real world, long-running business processes, split into multiple activities/steps, are performed many times by different people. Effectively, different channels/endpoints/queues. But our saga shoved everyone back into one queue!</p>
<p>What we did in our taco tragedy above was that I came off the line from taking orders and performed the prep stage. For N items, we took a total time of N+1 or so. We had two queues going for the one saga:</p>
<table cellspacing="0" cellpadding="2" width="133" border="1">
<tbody>
<tr>
<td valign="top" width="131"><strong>Prep Queue</strong></td>
</tr>
<tr>
<td valign="top" width="131">Prep Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Prep Pancakes – #2</td>
</tr>
</tbody>
</table>
<table cellspacing="0" cellpadding="2" width="133" border="1">
<tbody>
<tr>
<td valign="top" width="131"><strong>Pack Queue</strong></td>
</tr>
<tr>
<td valign="top" width="131">Pack Taco – #1</td>
</tr>
<tr>
<td valign="top" width="131">Pack Taco – #1</td>
</tr>
</tbody>
</table>
<p>The total number of items in the Pack queue was always small – packing was easy and quick. By splitting the saga handling into separate queues, we ensured that an overload in one type of message didn’t choke out all the others. This isn’t the default way of managing long-running processes in NServiceBus though, we have to set this up ourselves.</p>
<p>When dealing with the Process Manager pattern, it’s important to keep in mind what this pattern brings to the table. We’re able to support complex message flow, but at the price of potential bottlenecks and deadlocks.</p>
<p>Next time – a better pattern for linear processes that doesn’t bring in deadlocks and bottlenecks, the routing slip pattern.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=kwQszsB3nck:wwznxNIt5DI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=kwQszsB3nck:wwznxNIt5DI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=kwQszsB3nck:wwznxNIt5DI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=kwQszsB3nck:wwznxNIt5DI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=kwQszsB3nck:wwznxNIt5DI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=kwQszsB3nck:wwznxNIt5DI:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/kwQszsB3nck" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/jimmybogard/2013/03/26/scaling-nservicebus-sagas/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/cc359c5ccf90d7a24b5976316797b5ec?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Jimmy Bogard</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/jimmybogard/2013/03/26/scaling-nservicebus-sagas/</feedburner:origLink></item>
	<item>
		<title>MarionetteJS v1.0</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/XC0CqhEo0XM/</link>
		<comments>http://lostechies.com/derickbailey/2013/03/25/marionettejs-v1-0-now-with-stickers/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 13:19:08 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[Backbone]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Marionette]]></category>
		<category><![CDATA[Open Source]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/derickbailey/?p=1080]]></guid>
		<description><![CDATA[Hot on the heels of the Backbone v1.0 release, I present MarionetteJS v1.0! I quietly released it over the weekend, and I&#8217;m glad I did. I already had a bug report and have released v1.0.1 to fix it. :D The&#160;&#8230; <a href="http://lostechies.com/derickbailey/2013/03/25/marionettejs-v1-0-now-with-stickers/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>Hot on the heels of the <a href="http://ashkenas.com/backbonejs-1.0/">Backbone v1.0 release</a>, I present <a href="http://marionettejs.com">MarionetteJS v1.0</a>!</p>
<p>I quietly released it over the weekend, and I&#8217;m glad I did. I already had a bug report and have released v1.0.1 to fix it. :D</p>
<p>The last few years of working on Marionette have been tremendously fun, exciting, frustrating at time, and have provided much more work and opportunity for me than I had ever imagined. I started this project out of need, and hoped that it might help a few people out &#8211; at least show them what could be done and give them ideas on how to do it. I never expected that this project would have 1/10th the number of stars it has on Github, or that this project would lead to working with dozens of amazing companies, travelling around the world, create new friendships, and land me some awesome speaking opportunities on podcasts and at conferences! </p>
<h2>What&#8217;s New</h2>
<p>There&#8217;s a ton of new things that have happened since I started the 1.0 release candidates. And actually, going in to &#8220;release candidate&#8221; model was probably the worst mistake I&#8217;ve made with Marionette, so far. I had far too many breaking changes, far too many times for it to really be a release candidate series. But things are stable now, and have been for a bit. There were a few additions and breaks in this release, some of which came from dependencies.</p>
<p>You can <strong>read the complete <a href="https://github.com/marionettejs/backbone.marionette/blob/master/changelog.md">change log</a> and <a href="https://github.com/marionettejs/backbone.marionette/blob/master/upgradeGuide.md">upgrade guide</a> in the repository</strong>, but I want to highlight a few of the notable things quickly.</p>
<h3>Backbone.Wreqr Updates</h3>
<p>Backbone.Wreqr is an integral part of Marionette and helps to provide a lot of the communication infrastructure for scaling applications. </p>
<p>In the latest release of Wreqr, I&#8217;ve renamed &#8220;addHandler&#8221; to &#8220;setHandler&#8221; for all Wreqr objects. There was confusion around the name &#8220;addHander&#8221; as it implied the ability to add multiple handlers. Since none of Wreqr allows multiple handlers for any one registered name, I changed this to &#8220;setHandler&#8221;. Anyone updating to Wreqr v0.2.0, along with Marionette v1.0.0, will need to account for this.</p>
<p>I&#8217;ve also made the commands somewhat persistent when there is no handler currently registered. Several people noted that they were running in to situations where a command needed to be executed, but due to the order of module loading being unpredictable, the handler wasn&#8217;t there. To fix this, a command can be executed whether or not the handler is available. As soon as the handler is available, the actual execution of the command will take place. Commands will persist in memory, for the life of the page. Refreshing the page or navigating to another page will destroy the not-yet-executed commands.</p>
<h3>Marionette.RegionManager</h3>
<p>One of the most requested features in recent times has been the ability to add and remove regions from layouts. I set out to solve this and realized that half of the code I needed was already in the Application object, and the other half was in the Layout object. So I consolidated most of this code in to a single object called RegionManager. Both the Application and Layout now use a RegionManager to manage their regions. This allows a more consistent way of managing the regions, and provides all of the add and remove functionality that is needed, on both.</p>
<h2>STICKERS!!!!</h2>
<p>WOOO! STICKERS!!! :D</p>
<p> <a href="http://www.devswag.com/products/marionette-stickers-4"><img title="marionette-sticker-detail.jpg" src="http://lostechies.com/derickbailey/files/2013/03/marionette-sticker-detail.jpg" alt="Marionette sticker detail" width="400" height="400" border="0" /></a></p>
<p>You can <a href="http://www.devswag.com/products/marionette-stickers-4">order yours from DevSwag</a>. They are providing order management and fulfillment for stickers, for Marionette and many other amazing open source projects.</p>
<h2>Semantic Versioning: A Goal</h2>
<p>I have a goal, moving forward, of using <a href="http://semver.org">Semantic Versioning</a> for the version numbers. I don&#8217;t think I can promise perfect semantic versions, though, for a few reasons. First off, this is my first project to hit v1.0. I know I&#8217;m going to make mistakes and screw up some little detail here and there. But for the most part, I plan on following semver. Secondly, and more importantly, though, Marionette relies on other libraries which have their own release cycles. Sometimes releases coincide. Other times they don&#8217;t. Sometimes they break Marionette, other times they don&#8217;t. This will make it challenging to follow semver.</p>
<h2>What&#8217;s Next?</h2>
<p>It&#8217;s been a whirlwind ride with near constant updates along the way. I&#8217;ve learned a ton about JavaScript and running an open source project. And this is the first time I&#8217;ve pushed an open source project to 1.0, so I&#8217;m sure there are still a ton of lessons left to learn.</p>
<p>There are still more than 50 tickets open in the Marionette repository, and a lot of things that I want to do to help re-stucture some of the ugly parts. I want to tear apart Modules, for example, and create separated namespacing, sub-applications and components. There are a lot of other feature requests and issues reported that need big changes, too. I&#8217;m looking forward to where Marionette will head, and hope to continue to build a strong community around it &#8211; including a more active core contributor team.).</p>
<h2>Thank You!</h2>
<p>Yes, it&#8217;s the grammy-award speech time! Someone start the &#8220;wrap it up&#8221; timer&#8230;</p>
<p><img title="NewImage.png" src="http://lostechies.com/derickbailey/files/2013/03/NewImage.png" alt="NewImage" width="275" height="183" border="0" /></p>
<p>I owe an especially large thanks to Jarrod Overson, Matt Briggs, Brian Mann and Tony Abou-Assaleh. These guys have been a great core team to bounce ideas around with, to help out with issues, and provide needed support and feedback. And to Ruben Vreeken for all the work he puts in to the Google group, answering questions. :)</p>
<p>Marionette wouldn&#8217;t be what it is without <a href="https://github.com/marionettejs/backbone.marionette/contributors">the amazing contributors</a>. Everyone that has contributed in any way &#8211; answering questions in the google group, sending issue reports, ideas, pull requests, writing blog posts and articles, screencasts, and talking at user groups and conferences. I&#8217;m still and continuously amazed at how much has been done in the community with this library. Thank you all!</p>
<p>A special thanks to Backbone, of course, which is what got me into JavaScript again, and allowed me to build Marionette. Thank you to <a href="http://medienfreunde.com/">MedienFreunde</a> for the amazing logo and website.</p>
<p>And thank you to all of the awesome people building apps with Marionette. Projects like <a href="http://app.halowaypoint.com">Halo Waypoint</a>, <a href="http://www.redbullmusicacademy.com/">Redbull Music Academy</a>, and <a href="http://www.stubhub.com/">StubHub</a> are among the most widely known systems built with Marionette &#8211; then there&#8217;s the three error reporting / analytics tools: <a href="http://airbrake.io/">AirBrake.io</a>, <a href="http://raygun.io/">RayGun.io</a> and <a href="http://crashlytics.com/">CrashLytics</a>. But there are so many more out there, still It&#8217;s been awesome seeing Marionette in all these places, and I&#8217;m looking forward to seeing where it goes from here! :)</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=XC0CqhEo0XM:z9FyNNUfR58:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=XC0CqhEo0XM:z9FyNNUfR58:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=XC0CqhEo0XM:z9FyNNUfR58:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=XC0CqhEo0XM:z9FyNNUfR58:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=XC0CqhEo0XM:z9FyNNUfR58:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=XC0CqhEo0XM:z9FyNNUfR58:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/XC0CqhEo0XM" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/derickbailey/2013/03/25/marionettejs-v1-0-now-with-stickers/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/e592bd1326b1e80188ed4c0bf26b9f75?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Derick Bailey</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/derickbailey/2013/03/25/marionettejs-v1-0-now-with-stickers/</feedburner:origLink></item>
	<item>
		<title>Saga implementation patterns – variations</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/VV5OOAC2bF8/</link>
		<comments>http://lostechies.com/jimmybogard/2013/03/21/saga-implementation-patterns-variations/#comments</comments>
		<pubDate>Thu, 21 Mar 2013 02:13:34 +0000</pubDate>
		<dc:creator>Jimmy Bogard</dc:creator>
				<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[SOA]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/jimmybogard/?p=753]]></guid>
		<description><![CDATA[In the previous couple of posts, I looked at the two main patterns I run into when looking at sagas: Command-oriented (request/response) in the Controller pattern Event-oriented (pub/sub) in the Observer pattern Of course, these aren’t the only ways our&#160;&#8230; <a href="http://lostechies.com/jimmybogard/2013/03/21/saga-implementation-patterns-variations/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>In the previous couple of posts, I looked at the two main patterns I run into when looking at sagas:</p>
<ul>
<li><a href="http://lostechies.com/jimmybogard/2013/03/14/saga-implementation-patterns-controller/">Command-oriented (request/response) in the Controller pattern</a></li>
<li><a href="http://lostechies.com/jimmybogard/2013/03/11/saga-implementation-patterns-observer/">Event-oriented (pub/sub) in the Observer pattern</a></li>
</ul>
<p>Of course, these aren’t the <em>only</em> ways our saga could behave. We could have any combination of these.</p>
<h3>Publish-Gather</h3>
<p>Looking back on our McDonald’s example, we could improve our situation a little bit. We could have a situation where we want a command to start a saga, then have the saga itself publish a message. It would then wait for events to come back (ignoring order):</p>
<p><a href="http://lostechies.com/jimmybogard/files/2013/03/image5.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://lostechies.com/jimmybogard/files/2013/03/image_thumb5.png" width="403" height="310"></a></p>
<p>The advantage here is that we only have one entry point to our saga. We don’t have to worry about our saga potentially getting started by any number of messages that were pushed out.</p>
<p>When you place an order at McDonald’s, it’s almost always the cashier that places the tray on the table. When stations are finished with fries, sandwiches etc., they don’t really come to the counter and make a decision “do I need a new tray?”. The tray is already there, so our saga has already started.</p>
<p>There’s also nothing stopping our downstream processes from spawning off additional sagas – but that’s hidden from our originator.</p>
<h3>Reporter</h3>
<p>Another role our saga can play is one that doesn’t make decisions, but instead merely reports status:</p>
<p><a href="http://lostechies.com/jimmybogard/files/2013/03/image6.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://lostechies.com/jimmybogard/files/2013/03/image_thumb6.png" width="444" height="444"></a></p>
<p>This is a situation where a saga might never actually complete, and goes on forever. Its role is to communicate status of a longer-running process in the back-end, not for coordination purposes, but for reporting purposes.</p>
<p>The reason we might want a saga for this case is we still don’t know what order we’ve received messages from downstream systems we don’t own. As we learn about downstream events, we can evaluate them based on our knowledge of the overall business process. An order can’t go backwards from “shipped” to “verified”, so receiving these out of order doesn’t change the fact that the order shipped! <em>Note: this doesn’t necessarily imply the status is in the saga entity itself. It still could be separate.</em></p>
<p>Keeping it as a saga lets us handle messages in any order and keep some centralized logic around interpreting these messages.</p>
<p>Sagas/process managers are pretty flexible in how we compose the pieces together. I often get questions around “why can’t I design a saga like a workflow?” And the answer is that sagas are meant to handle cases where I don’t have a directed workflow, where I live in a world where messages can arrive out of order.</p>
<p>It’s a much easier world to scale – but we need to accept the complexity it brings on the other end.</p>
<p>There is another clear downside here – we have shared state amongst multiple messages and handlers, which can potentially lead to scaling problems. Next time, we’ll look at scaling sagas.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=VV5OOAC2bF8:zKGfAfipanA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=VV5OOAC2bF8:zKGfAfipanA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=VV5OOAC2bF8:zKGfAfipanA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=VV5OOAC2bF8:zKGfAfipanA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=VV5OOAC2bF8:zKGfAfipanA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=VV5OOAC2bF8:zKGfAfipanA:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/VV5OOAC2bF8" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/jimmybogard/2013/03/21/saga-implementation-patterns-variations/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/cc359c5ccf90d7a24b5976316797b5ec?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Jimmy Bogard</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/jimmybogard/2013/03/21/saga-implementation-patterns-variations/</feedburner:origLink></item>
	<item>
		<title>Huboard – socket.io backend</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/dYj4JqgCNOo/</link>
		<comments>http://lostechies.com/ryanrauh/2013/03/18/huboard-socket-io-backend/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 16:27:29 +0000</pubDate>
		<dc:creator>Ryan Rauh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[huboard]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/ryanrauh/?p=221]]></guid>
		<description><![CDATA[huboard.com! Your favorite open source kanban board built on top of the GitHub api has gotten a little bit more awesome. I&#8217;ve decided to release the socket.io backend that is keeping huboard.com all up to date and super fancy. Why&#160;&#8230; <a href="http://lostechies.com/ryanrauh/2013/03/18/huboard-socket-io-backend/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<h1><a href="http://huboard.com">huboard.com</a>!</h1>
<p>Your favorite <a href="https://github.com/rauhryan/huboard">open source</a> kanban board built on top of the <a href="https://github.com">GitHub</a> <a href="http://developer.github.com/">api</a> has gotten a little bit more awesome. I&#8217;ve decided to release the socket.io backend that is keeping <a href="http://huboard.com">huboard.com</a> all up to date and super fancy.</p>
<h1>Why nodejs (express + socket.io)?</h1>
<h2>1. Simple</h2>
<p>Nodejs (express + socket.io) was by far the easiest thing for me to get running on <a href="https://devcenter.heroku.com/articles/using-socket-io-with-node-js-on-heroku">heroku</a>. The <a href="http://lostechies.com/ryanrauh/2012/08/23/huboard-goes-realtime/">original version</a> I published back in August was only about 26 lines of javascript.</p>
<h2>2. Reliable</h2>
<p>I&#8217;m absolutely amazed, I pushed that code up to heroku back in August and haven&#8217;t touched it. It ran for about 6 months and I never even checked on it. As far as I can tell it never even crashed.</p>
<h2>3. Documentation</h2>
<p>There is a ton of great tutorials and blog posts just a google search away on getting socket.io up and running on heroku.</p>
<ul>
<li><a href="https://devcenter.heroku.com/articles/using-socket-io-with-node-js-on-heroku">Heroku &#8211; Dev Center</a></li>
<li><a href="http://socket.io/#how-to-use">Socket.io site</a></li>
</ul>
<h2>4. Cheap (free as in beer)</h2>
<p>Plain vanilla install of socket.io and express configured to use <a href="http://en.wikipedia.org/wiki/Comet_(programming)">xhr-polling</a> has been running problem free on heroku with one free dyno for 6 months. I&#8217;m not exactly sure how far that will scale using the MemoryStore (eventually I&#8217;ll run out of RAM) but huboard is sitting at nearly 4000 users and haven&#8217;t had any problems <em>yet</em></p>
<h2>Other options</h2>
<p>I did explore other options</p>
<ul>
<li>
<p>.NET &#8211; server sent events &#8211; (fubumvc or signalr)</p>
<ul>
<li><a href="https://github.com/DarthFubuMVC/FubuMVC.ServerSentEvents">FubuMVC.ServerSentEvents</a>
<ul>
<li>Not supported by heroku (see #1 &amp;&amp; #4)</li>
<li>SSE only &#8211; no fallback support </li>
<li>Very little documentation</li>
</ul>
</li>
<li>[SignalR]
<ul>
<li>Not supported by heroku</li>
<li>Not as stable (at the time)</li>
</ul>
</li>
</ul>
</li>
<li>
<p>Ruby &#8211; EventMachine</p>
<ul>
<li>I originally wanted to use something simple on top of ruby. I tried several different approaches and ultimately I just couldn&#8217;t figure out how to host a HTTP POST endpoint &amp;&amp; the socket connections inside the same app.</li>
</ul>
</li>
</ul>
<h1>Why did it take you so long to release it?</h1>
<p>Well the TL;DR; is that it wasn&#8217;t secure. It was largely experimental. Back when I published the <a href="http://lostechies.com/ryanrauh/2012/08/23/huboard-goes-realtime/">RealTime™</a> support the socket.io server was only about 26 lines of <a href="http://nodejs.org">nodejs</a>. It had no security because I didn&#8217;t know how to set it up. So I secure it the best I could (with a simple correlation string) and called it a day. The code wasn&#8217;t published so hackers at least had a <em>harder</em> time connecting to the socket than if the code was in the open. Security by obscurity (I know shame on me, I&#8217;m sorry).</p>
<h1>How are you going to make it secure?</h1>
<p>Step one is open sourcing it, people who are using huboard and know more than I do will hopefully care enough to help me make it as secure as possible.</p>
<ul>
<li>Things I&#8217;m doing already. </li>
</ul>
<p>All my users trust me with their OAuth token and I take that responsibility seriously. I try my best to make sure your authorization key doesn&#8217;t get into the wrong hands. Huboard <strong>never</strong> exposes your authorization key unencrypted.</p>
<p>The socket server now performs a handshake when making a connection. Your <strong>encrypted</strong> OAuth token is passed into socket.io via query string, which turns around and passes the <strong>encrypted</strong> key to a huboard api endpoint that <strong>decrypts</strong> your token and asks the GitHub api if its valid.</p>
<p>&#42;<strong>| Disclaimer &#42;</strong>| I&#8217;m not a security expert, I&#8217;m not happy that I&#8217;m passing the token back to huboard for verification. It doesn&#8217;t feel <em>right</em>. I tried for days to decrypt the token using node in order to validate the token inside the handshake code but I just ran into dead ends. I think it has something to do with the encoding of ruby vs node but I had very similar encryption code on both platforms and could figure out how to get node to decrypt a string from ruby or visa versa. <a href="https://github.com/rauhryan/huboard.socket.io/issues/1">Please help</a>!</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=dYj4JqgCNOo:UptEYiLH_oc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=dYj4JqgCNOo:UptEYiLH_oc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=dYj4JqgCNOo:UptEYiLH_oc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=dYj4JqgCNOo:UptEYiLH_oc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=dYj4JqgCNOo:UptEYiLH_oc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=dYj4JqgCNOo:UptEYiLH_oc:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/dYj4JqgCNOo" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/ryanrauh/2013/03/18/huboard-socket-io-backend/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/29283ede6c447fdc62f0ceac42df33ea?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Ryan Rauh</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/ryanrauh/2013/03/18/huboard-socket-io-backend/</feedburner:origLink></item>
	<item>
		<title>Event Aggregator And/Or/vs Mediator: A Tale Of Two Patterns</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/Obcrmwh1OZU/</link>
		<comments>http://lostechies.com/derickbailey/2013/03/18/event-aggregator-andorvs-mediator-a-tale-of-two-patterns/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 15:00:14 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[AntiPatterns]]></category>
		<category><![CDATA[Backbone]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Principles and Patterns]]></category>
		<category><![CDATA[Workflow]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/derickbailey/?p=1075]]></guid>
		<description><![CDATA[Design patterns often differ only in semantics and intent. That is, the language used to describe the pattern is what sets it apart, more than an implementation of that specific pattern. It often comes down to squares vs rectangles vs&#160;&#8230; <a href="http://lostechies.com/derickbailey/2013/03/18/event-aggregator-andorvs-mediator-a-tale-of-two-patterns/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>Design patterns often differ only in semantics and intent. That is, the language used to describe the pattern is what sets it apart, more than an implementation of that specific pattern. It often comes down to squares vs rectangles vs polygons. You can create the same end result with all three, given the constraints of a square are still met &#8211; or you can use polygons to create an infinitely larger and more complex set of things.</p>
<p>When it comes to the <a href="http://en.wikipedia.org/wiki/Mediator_pattern">Mediator</a> and <a href="http://martinfowler.com/eaaDev/EventAggregator.html">Event Aggregator</a> patterns, there are some times where it may look like the patterns are interchangeable due to implementation similarities. However, the semantics and intent of these patterns are very different. And even if the implementations both use some of the same core constructs, I believe there is a distinct difference between them. I also believe they should not be interchanged or confused in communication because of the differences.</p>
<h2>It&#8217;s All About Logic</h2>
<p>The TL;DR version of this article is this: where does the logic live? An event aggregator has no logic, other than forwarding events from a publisher to a subscriber. A mediator, on the other hand, encapsulates the potentially complex logic of coordinating multiple other objects and/or services, to accomplish a goal. A mediator contains real application / business / workflow / process logic.</p>
<p>This is the line I&#8217;m drawing in the ever-shifting sands of implementation details and fuzzy heuristics.</p>
<h2>Event Aggregator</h2>
<p>The core idea of the <a>Event Aggregator</a>, accoring to Martin Fowler, is to channel multiple event sources through a single object so that other objects needing to subscribe to the events don&#8217;t need to know about every event source.</p>
<h3>Backbone&#8217;s Event Aggregator</h3>
<p>The easiest event aggregator to show is that of <a href="http://backbonejs.org">Backbone.js</a> &#8211; it&#8217;s built in to the <code>Backbone</code> object directly.</p>
<div class="highlight">
<pre><span class="kd">var</span> <span class="nx">View1</span> <span class="o">=</span> <span class="nx">Backbone</span><span class="p">.</span><span class="nx">View</span><span class="p">.</span><span class="nx">extend</span><span class="p">({</span>
  <span class="c1">// ...</span>

  <span class="nx">events</span><span class="o">:</span> <span class="p">{</span>
    <span class="s2">"click .foo"</span><span class="o">:</span> <span class="s2">"doIt"</span>
  <span class="p">},</span>

  <span class="nx">doIt</span><span class="o">:</span> <span class="kd">function</span><span class="p">(){</span>
    <span class="c1">// trigger an event through the event aggregator</span>
    <span class="nx">Backbone</span><span class="p">.</span><span class="nx">trigger</span><span class="p">(</span><span class="s2">"some:event"</span><span class="p">);</span>
  <span class="p">}</span>
<span class="p">});</span>

<span class="kd">var</span> <span class="nx">View2</span> <span class="o">=</span> <span class="nx">Backbone</span><span class="p">.</span><span class="nx">View</span><span class="p">.</span><span class="nx">extend</span><span class="p">({</span>
  <span class="c1">// ...</span>

  <span class="nx">initialize</span><span class="o">:</span> <span class="kd">function</span><span class="p">(){</span>
    <span class="c1">// subscribe to the event aggregator's event</span>
    <span class="nx">Backbone</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"some:event"</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">doStuff</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
  <span class="p">},</span>

  <span class="nx">doStuff</span><span class="o">:</span> <span class="kd">function</span><span class="p">(){</span>
    <span class="c1">// ...</span>
  <span class="p">}</span>
<span class="p">})</span>
</pre>
</div>
<p>In this example, the first view is triggering an event when a DOM element is clicked. The event is triggered through Backbone&#8217;s built-in event aggregator &#8211; the <code>Backbone</code> object. Of course, <a href="http://lostechies.com/derickbailey/2011/07/19/references-routing-and-the-event-aggregator-coordinating-views-in-backbone-js/">it&#8217;s trivial to create your own event aggregator in Backbone</a>, and there are some <a href="http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/">key things that we need to keep in mind when using an event aggregator</a>, to keep our code simple.</p>
<h3>jQuery&#8217;s Event Aggregator</h3>
<p>Did you know that jQuery has a built-in event aggregator? They don&#8217;t call it this, but it&#8217;s in there and it&#8217;s scoped to DOM events. It also happens to look like Backbone&#8217;s event aggregator:</p>
<div class="highlight">
<pre><span class="nx">$</span><span class="p">(</span><span class="s2">"#mainArticle"</span><span class="p">).</span><span class="nx">on</span><span class="p">(</span><span class="s2">"click"</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">){</span>

  <span class="c1">// handle the event that any element underneath of our #mainArticle element</span>

<span class="p">});</span>
</pre>
</div>
<p>This code sets up an event handler function that waits for an unknown number of event sources to trigger a &#8220;click&#8221; event, and it allows any number of listeners to attach to the events of those event publishers. jQuery just happens to scope this event aggregator to the DOM.</p>
<h2>Mediator</h2>
<p>A <a href="http://en.wikipedia.org/wiki/Mediator_pattern">Mediator</a> is an object that coordinates interactions (logic and behavior) between multiple objects. It makes decisions on when to call which objects, based on the actions (or in-action) of other objects and input.</p>
<h3>A Mediator For Backbone</h3>
<p>Backbone doesn&#8217;t have the idea of a mediator built in to it like a lot of other MV* frameworks do. But that doesn&#8217;t mean you can&#8217;t write one in 1 line of code:</p>
<p><code>var mediator = {};</code></p>
<p>Yes, of course this is just an object literal in JavaScript. Once again, we&#8217;re talking about semantics here. The purpose of the mediator is to <a href="http://lostechies.com/derickbailey/2012/05/10/modeling-explicit-workflow-with-code-in-javascript-and-backbone-apps/">control the workflow between objects</a> and we really don&#8217;t need anything more than an object literal to do this.</p>
<div class="highlight">
<pre><span class="kd">var</span> <span class="nx">orgChart</span> <span class="o">=</span> <span class="p">{</span>

  <span class="nx">addNewEmployee</span><span class="o">:</span> <span class="kd">function</span><span class="p">(){</span>

    <span class="c1">// getEmployeeDetail provides a view that users interact with</span>
    <span class="kd">var</span> <span class="nx">employeeDetail</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getEmployeeDetail</span><span class="p">();</span>

    <span class="c1">// when the employee detail is complete, the mediator (the 'orgchart' object)</span>
    <span class="c1">// decides what should happen next</span>
    <span class="nx">employeeDetail</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"complete"</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">employee</span><span class="p">){</span>

      <span class="c1">// set up additional objects that have additional events, which are used</span>
      <span class="c1">// by the mediator to do additional things</span>
      <span class="kd">var</span> <span class="nx">managerSelector</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">selectManager</span><span class="p">(</span><span class="nx">employee</span><span class="p">);</span>
      <span class="nx">managerSelector</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"save"</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">employee</span><span class="p">){</span>
        <span class="nx">employee</span><span class="p">.</span><span class="nx">save</span><span class="p">();</span>
      <span class="p">});</span>

    <span class="p">});</span>
  <span class="p">},</span>

  <span class="c1">// ...</span>
<span class="p">}</span>
</pre>
</div>
<p>This example shows a very basic implementation of a mediator object with Backbone based objects that can trigger and subscribe to events. I&#8217;ve often referred to this type of object as a &#8220;workflow&#8221; object in the past, but the truth is that it is a mediator. It is an object that handles the workflow between many other objects, aggregating the responsibility of that workflow knowledge in to a single object. The result is workflow that is easier to understand and maintain.</p>
<h2>Similarities And Differences</h2>
<p>There are, without a doubt, similarities between the event aggregator and mediator examples that I&#8217;ve shown here. The similarities boil down to two primary items: events and third-party objects. These differences are superficial at best, though. When we dig in to the intent of the pattern and see that the implementations can be dramatically different, the nature of the patterns become more apparent.</p>
<h3>Events</h3>
<p>Both the event aggregator and mediator use events, in the above examples. An event aggregator obviously deals with events &#8211; it&#8217;s in the name after all. The mediator only uses events because it makes life easy when dealing with Backbone, though. There is nothing that says a mediator must be built with events. You can build a mediator with callback methods, by handing the mediator reference to the child object, or by any of a number of other means.</p>
<p>The difference, then, is why these two patterns are both using events. The event aggregator, as a pattern, is designed to deal with events. The mediator, though, only uses them because it&#8217;s convenient.</p>
<h3>Third-Party Objects</h3>
<p>Both the event aggregator and mediator, by design, use a third-party object to facilitate things. The event aggregator itself is a third-party to the event publisher and the event subscriber. It acts as a central hub for events to pass through. The mediator is also a thirdy party to other objects, though. So where is the difference? Why don&#8217;t we call an event aggregator a mediator? The answer largely comes down to where the application logic and workflow is coded.</p>
<p>In the case of an event aggregator, the third party object is there only to facilitate the pass-through of events from an unknown number of sources to an unknown number of handlers. All workflow and business logic that needs to be kicked off is put directly in to the the object that triggers the events and the objects that handle the events.</p>
<p>In the case of the mediator, though, the business logic and workflow is aggregated in to the mediator itself. The mediator decides when an object should have it&#8217;s methods called and attributes updated based on factors that the mediator knows about. It encapsulates the workflow and process, coordinating multiple objects to produce the desired system behaviour. The individual objects involved in this workflow each know how to perform their own task. But it&#8217;s the mediator that tells the objects when to perform the tasks by making decisions at a higher level than the individual objects.</p>
<p>An event aggregator facilitates a &#8220;fire and forget&#8221; model of communication. The object triggering the event doesn&#8217;t care if there are any subscribers. It just fires the event and moves on. A mediator, though, might use events to make decisions, but it is definitely not &#8220;fire and forget&#8221;. A mediator pays attention to a known set of input or activities so that it can facilitate and coordinate additional behavior with a known set of actors (objects).</p>
<h2>Relationships: When To Use Which</h2>
<p>Understanding the similarities and differences between an event aggregator and mediator is important for semantic reasons. It&#8217;s equally as important to understand when to use which pattern, though. The basic semantics and intent of the patterns does inform the question of when, but actual experience in using the patterns will help you understand the more subtle points and nuanced decisions that have to be made.</p>
<h3>Event Aggregator Use</h3>
<p>In general, an event aggregator is uses when you either have too many objects to listen to directly, or you have objects that are unrelated entirely.</p>
<p>When two objects have a direct relationship already &#8211; say, a parent view and child view &#8211; then there might be little benefit in using an event aggregator. Have the child view trigger an event and the parent view can handle the event. This is most commonly seen in Backbone&#8217;s Collection and Model, where all Model events are bubbled up to and through it&#8217;s parent Collection. A Collection often uses model events to modify the state of itself or other models. Handling &#8220;selected&#8221; items in a collection is a good example of this.</p>
<p>jQuery&#8217;s <a href="http://api.jquery.com/on/">on</a> method as an event aggregator is a great example of too many objects to listen to. If you have 10, 20 or 200 DOM elements that can trigger a &#8220;click&#8221; event, it might be a bad idea to set up a listener on all of them individually. This could quickly deteriorate performance of the application and user experience. Instead, using jQuery&#8217;s <code>on</code> method allows us to aggregate all of the events and reduce the overhead of 10, 20, or 200 event handlers down to 1.</p>
<p>Indirect relationships are also a great time to use event aggregators. In Backbone applications, it is very common to have multiple view objects that need to communicate, but <a href="http://lostechies.com/derickbailey/2011/07/19/references-routing-and-the-event-aggregator-coordinating-views-in-backbone-js/">have no direct relationship</a>. For example, a menu system might have a view that handles the menu item clicks. But we don&#8217;t want the menu to be direcly tied to the content views that show all of the details and information when a menu item is clicked. Having the content and menu coupled together would make the code very difficult to maintain, in the long run. Instead, we can use an event aggregator to trigger &#8220;menu:click:foo&#8221; events, and have a &#8220;foo&#8221; object handle the click event to show it&#8217;s content on the screen.</p>
<h3>Mediator Use</h3>
<p>A mediator is best applied when two or more objects have an indirect working relationship, and business logic or workflow needs to dictate the interactions and coordination of these objects.</p>
<p><a href="http://lostechies.com/derickbailey/2012/05/10/modeling-explicit-workflow-with-code-in-javascript-and-backbone-apps/">A wizard interface is a good example of this</a>, as shown with the &#8220;orgChart&#8221; example, above. There are multiple views that facilitate the entire workflow of the wizard. Rather than tightly coupling the view together by having them reference each other directly, we can decouple them and more explicitly model the workflow between them by introducing a mediator.</p>
<p>The mediator extracts the workflow from the implementation details and creates a more natural abstraction at a higher level, showing us at a much faster glance what that workflow is. We no longer have to dig in to the details of each view in the workflow, to see what the workflow actually is.</p>
<h2>Event Aggregator And Mediator Together</h2>
<p>The crux of the difference between an event aggregator and a mediator, and why these pattern names should not be interchanged with each other, is illustrated best by showing how they can be used together. The menu example for an event aggregator is the perfect place to introduce a mediator as well.</p>
<p>Clicking a menu item may trigger a series of changes throughout an application. Some of these changes will be independent of others, and using an event aggregator for this makes sense. Some of these changes may be internally related to each other, though, and may use a mediator to enact those changes. A mediator, then, could be set up to listen to the event aggregator. It could run it&#8217;s logic and process to facilitate and coordinate many objects that are related to each other, but unrelated to the original event source.</p>
<div class="highlight">
<pre><span class="kd">var</span> <span class="nx">MenuItem</span> <span class="o">=</span> <span class="nx">Backbone</span><span class="p">.</span><span class="nx">View</span><span class="p">.</span><span class="nx">extend</span><span class="p">({</span>

  <span class="nx">events</span><span class="o">:</span> <span class="p">{</span>
    <span class="s2">"click .thatThing"</span><span class="o">:</span> <span class="s2">"clickedIt"</span>
  <span class="p">},</span>

  <span class="nx">clickedIt</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">){</span>
    <span class="nx">e</span><span class="p">.</span><span class="nx">preventDefault</span><span class="p">();</span>

    <span class="c1">// assume this triggers "menu:click:foo"</span>
    <span class="nx">Backbone</span><span class="p">.</span><span class="nx">trigger</span><span class="p">(</span><span class="s2">"menu:click:"</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">model</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">"name"</span><span class="p">));</span>
  <span class="p">}</span>

<span class="p">});</span>

<span class="c1">// ... somewhere else in the app</span>

<span class="kd">var</span> <span class="nx">MyWorkflow</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(){</span>
  <span class="nx">Backbone</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"menu:click:foo"</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">doStuff</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
<span class="p">};</span>

<span class="nx">MyWorkflow</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">doStuff</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(){</span>
  <span class="c1">// instantiate multiple objects here.</span>
  <span class="c1">// set up event handlers for those objects.</span>
  <span class="c1">// coordinate all of the objects in to a meaninful workflow.</span>
<span class="p">};</span>
</pre>
</div>
<p>In this example, when the <code>MenuItem</code> with the right model is clicked, the &#8220;menu:click:foo&#8221; event will be triggered. An instance of the &#8220;MyWorkflow&#8221; object, assuming one is already instantiated, will handle this specific event and will coordinate all of the objects that it knows about, to create the desired user experience and workflow.</p>
<p>An event aggregator and a mediator have been combined to create a much more meaningful experience in both the code and the application itself. We now have a clean separation between the menu and the workflow through an event aggregator. And we are still keeping the workflow itself clean and maintainable through the use of a mediator.</p>
<h2>Pattern Language: Semantics</h2>
<p>There is one overriding point to make in all of this discussion: semantics. Communicating intent and semantics through the use of named patterns is only viable and only valid when all parties in a communication medium understand the language in the same way.</p>
<p>If I say &#8220;apple&#8221;, what am I talking about? Am I talking about a fruit? Or am I talking about a technology and consumer products company? As <a href="http://lostechies.com/sharoncichelli/">Sharon Cichelli</a> says: &#8220;semantics will continue to be important, until we learn how to communicate in something other than language&#8221;.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=Obcrmwh1OZU:GIg0K2F5_74:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=Obcrmwh1OZU:GIg0K2F5_74:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=Obcrmwh1OZU:GIg0K2F5_74:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=Obcrmwh1OZU:GIg0K2F5_74:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=Obcrmwh1OZU:GIg0K2F5_74:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=Obcrmwh1OZU:GIg0K2F5_74:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/Obcrmwh1OZU" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/derickbailey/2013/03/18/event-aggregator-andorvs-mediator-a-tale-of-two-patterns/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/e592bd1326b1e80188ed4c0bf26b9f75?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Derick Bailey</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/derickbailey/2013/03/18/event-aggregator-andorvs-mediator-a-tale-of-two-patterns/</feedburner:origLink></item>
	<item>
		<title>Tips On Submitting A Conference Session</title>
		<link>http://feedproxy.google.com/~r/LosTechies/~3/GremcUZaw7Y/</link>
		<comments>http://lostechies.com/derickbailey/2013/03/15/tips-on-submitting-a-conference-session/#comments</comments>
		<pubDate>Fri, 15 Mar 2013 15:56:24 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[AntiPatterns]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[Retrospectives]]></category>
        
		<guid isPermaLink="false"><![CDATA[http://lostechies.com/derickbailey/?p=1071]]></guid>
		<description><![CDATA[In the last 3 or so years, I&#8217;ve had every conference submission I&#8217;ve entered, rejected. Now that doesn&#8217;t mean I haven&#8217;t spoken at any conferences &#8211; I&#8217;ve been invited to a handful and have had a ton of fun at&#160;&#8230; <a href="http://lostechies.com/derickbailey/2013/03/15/tips-on-submitting-a-conference-session/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
		<content:encoded><![CDATA[<p>In the last 3 or so years, I&#8217;ve had every conference submission I&#8217;ve entered, rejected. Now that doesn&#8217;t mean I haven&#8217;t spoken at any conferences &#8211; I&#8217;ve been invited to a handful and have had a ton of fun at them. But for every conference that I&#8217;ve submitted a session too, I have not been selected. It&#8217;s not fun being rejected 6+ times in a row. The worst part, though, is not getting any valid feedback on why. I ranted about this for a while on Twitter yesterday, and got some interesting feedback.</p>
<h2>The Worst Part</h2>
<p>The worst parts of the constant rejection include not getting any feedback on why, and the constant growing self doubt. But the absolute worst rejection was from CodeMash last year, where they passed me up in favor of some other guy that wanted to do a Marionette session. I heard reports that it didn&#8217;t go well… and they chose this guy over me, the creator of Marionette. That one still stands out as the most crushing rejection.</p>
<p>But enough self-pitty-crap. You&#8217;re here the find out WHY and how to fix it, right?</p>
<h2>The Submission</h2>
<p>I ended up <a href="https://gist.github.com/derickbailey/5166832">posting one of my recent submissions to a gist</a> so that I could get some actual feedback. This is the basic session submission information that I&#8217;ve been using for a while now. I change it up from here, based on the specific talk that I&#8217;m going to give, but it generally looks like this:</p>
<blockquote>
<p><strong>Scaling JavaScript Apps With Backbone And Marionette</strong></p>
<p>Nearly everyone understands how to build a simple JavaScript application these days. From the classic “Todo” JavaScript app, to simple forms-over-data jQuery apps, we’ve all been around that block a few times. With the recent explosion of JavaScript MV* tools and frameworks, though, many of us find ourselves in over our heads, looking at patterns and practices that work well for small applications and pages but fail when scaling to anything substantial.</p>
<p>In this session, Derick Bailey will give you an introduction and walk through of many of the patterns and practices that your JavaScript applications need to be scalable. You’ll learn why copying Ruby on Rails’ pattern of “Models”, “Views” and “Controllers” folder names is wrong for scaling JavaScript apps, and how to correct that . You’ll learn about the necessity of separating the various concerns of your application. You’ll learn about patterns that aggregate and coordinate functionality from other parts of the system, how and when to properly decouple disparate areas of your application through messaging patterns, and more. And all of this will be illustrated with Backbone, MarionetteJS and additional plugins and patterns that can give you an edge in creating scalable applications in JavaScript.</p>
</blockquote>
<p>I asked people to tear this apart for me, and tell me what I have been doing wrong. I got exactly what I wanted, and I have a lot of great tips to move forward, now. </p>
<h2>The Raw Responses</h2>
<p>There&#8217;s a lot of useful tips in the raw responses, and lessons that can be picked from the responses. Rather than just trying to summarize things, though, I&#8217;m just going to post the responses directly and add my reactions.</p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> I&#8217;ll be honest, it&#8217;s the beard man. They are Jealous of your testosterone.</p>
<p>— Scott Koon (@lazycoder) <a href="https://twitter.com/lazycoder/status/312375144985288704">March 15, 2013</a></p></blockquote>
<p>
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script><br />
Ok, Scott&#8217;s probably right. My beard is amazing. But it&#8217;s probably more likely:</p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> Ok, I&#8217;ll be actually honest here. I have no idea WHY code on the client needs to scale past a single user?</p>
<p>— Scott Koon (@lazycoder) <a href="https://twitter.com/lazycoder/status/312375777649885185">March 15, 2013</a></p></blockquote>
<p>
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script><br />
Here&#8217;s one of the problems: semantics. &#8220;Scalability&#8221; is an over-used and abused word these days. When I say &#8220;scalability&#8221; in that abstract, I mean scaling to 10&#8242;s of thousands of lines of code, dozens of feature areas, sub-applications and general code size. I&#8217;m not referring to number of users since this all runs on client-side, one-person-at-a-time browsers. </p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> True, but you don&#8217;t say that in the abstract. I&#8217;m guessing you mean tons of data on the client w/complex cardinality.</p>
<p>— Scott Koon (@lazycoder) <a href="https://twitter.com/lazycoder/status/312376394334208002">March 15, 2013</a></p></blockquote>
<p>
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script><br />
Dually noted, and something I need to clarify in my abstract.</p>
<p> </p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> @<a href="https://twitter.com/jbogard">jbogard</a> @<a href="https://twitter.com/robconery">robconery</a> Needs more excitement! Get me excited about something!</p>
<p>— Kelly Sommers (@kellabyte) <a href="https://twitter.com/kellabyte/status/312375796973051904">March 15, 2013</a></p></blockquote>
<p>This is more likely the largest issue, and is the most common thread of feedback that I got. I spent years learning to take the emotion and extraneous fluff out of my written communications because I worked for large corporations where CEO&#8217;s wanted logical justification for me spending $100,000 on servers and software. Hand-waving doesn&#8217;t go over well in that environment, but apparently it&#8217;s what you need in a conference submission.</p>
<p> </p>
<p><a href="https://gist.github.com/derickbailey/5166832#comment-798819">Rob Conery responded</a> to my gist, with this:</p>
<blockquote>
<p>##Taking The Suck Out of Javascript with MarionetteJS</p>
<p>Many have heard of Single Page Applications and, even though most of us in the room might not admit it, have experimented with the idea late at night&#8230; only to face the inevitable self-loathing and vacant, soulless feeling the next day. In this talk Derick Bailey will show you a happier path for building Single Page Applications, using Marionette together with BackboneJS.</p>
<p>Marionette helps to structure your Javascript applications &#8211; doing the things you don&#8217;t want to do (or have tired of doing thousands of times over) &#8211; and it won&#8217;t leave your code feeling bloated and lifeless.</p>
</blockquote>
<p>This sparked a small response line in twitter:</p>
<p><img title="Screen Shot 2013-03-15 at 10.36.05 AM.png" src="http://lostechies.com/derickbailey/files/2013/03/Screen-Shot-2013-03-15-at-10.36.05-AM.png" alt="Screen Shot 2013 03 15 at 10 36 05 AM" width="519" height="559" border="0" /></p>
<p>Even if it bums people out, it&#8217;s a much more exciting and entertaining abstract. I would go to this session.</p>
<p> </p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/robconery">robconery</a> @<a href="https://twitter.com/kellabyte">kellabyte</a> @<a href="https://twitter.com/derickbailey">derickbailey</a> just do what jon skeet did in his abstract “I’M JON SKEET. SCIENCE BITCHES!!”</p>
<p>— Jimmy Bogard (@jbogard) <a href="https://twitter.com/jbogard/status/312377924433084416">March 15, 2013</a> </p></blockquote>
<p>hmm… I&#8217;m considering this, though I think Jon Skeet might have problems with me claiming to be him. :D</p>
<p> </p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> @<a href="https://twitter.com/jbogard">jbogard</a> @<a href="https://twitter.com/robconery">robconery</a> the abstract is too long. I liked the direction Rob was heading in the comments</p>
<p>— Chad Myers (@chadmyers) <a href="https://twitter.com/chadmyers/status/312379238605012992">March 15, 2013</a> </p></blockquote>
<p>Also very true. Anyone that has read me blog or articles knows that I have a hard time being concise. I definitely need to work on the length of abstract, which would also help move it toward the goal of more excitement. Less to read means I have to pack more information and punch in to fewer words.</p>
<p> </p>
<p>In a separate email conversation, Steve Smith (<a href="http://twitter.com/ardalis">@ardalis</a>) had this to say:</p>
<blockquote>
<p>Rob’s comment is great. Short, exciting, attention-getting abstracts are the best, but they’re not easy to write. What’s at least as important to those selecting sessions for an event is the speaker themselves. If you’re well-known, especially for the topic, that matters far more than the abstract. It’s also helpful to include your speaking background, so that those who don’t know you at least know you’re not new to speaking. Including ratings can help, too, as in: “Presented a similar talk to 100 developers at XYZ code camp and was rated 9.2 out of 10”</p>
<p>My first pass at abstracts usually look a lot like your initial one, which is kind of like the standard Microsoft product naming convention of describe-what-it-is-in-general-terms. If I’m submitting to something I already know I’m accepted for, I usually won’t spend a lot of time trying to sex it up, either (like, for a user group, for instance). But for something like TechEd or any other larger event where I don’t necessarily already have an “in”, I’ll try to spend more time making the abstracts more exciting, and also demonstrating my past experience.</p>
</blockquote>
<p>There&#8217;s a lot of great summary in here, for sure. I&#8217;m not sure I buy the &#8220;celebrity&#8221; angle at this point, though. In spite of being invited to speak about Marionette (among other things) and in spite of Marionette being the most watched Backbone framework on Github, with my name all over it, people still reject my sessions in favor of other people. </p>
<p>Unless you&#8217;re Jon Skeet, Addy Osmani or Paul Irish, you&#8217;re going to have to beg your way in to most conference submissions. You&#8217;re going to have to pay attention to the detail and make the submission exciting, or you&#8217;ll be passed up in spite of your name being all over the project that they want to hear about.</p>
<p> </p>
<p>Lastly, @kellabyte capped it off with a dose of reality for all of this advice:</p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> @<a href="https://twitter.com/robconery">robconery</a> @<a href="https://twitter.com/jbogard">jbogard</a> Nothing guarantees anything we say is worth a damn though :P</p>
<p>— Kelly Sommers (@kellabyte) <a href="https://twitter.com/kellabyte/status/312379489105637376">March 15, 2013</a></p></blockquote>
<p> </p>
<p>While this is true, I&#8217;m grateful to have received this feedback! This is infinitely more useful than the generic, patronizing &#8220;we had too many great submissions to choose from&#8221; responses that conference organizers like to send.</p>
<h2>What Other Advice Do You Have?</h2>
<p>I know I have a lot of work ahead of me to improve my submissions, and I&#8217;m still looking for more advice and more feedback. What else would you add to the conversation? What other tips and tricks do you have? </p>
<p>I don&#8217;t want others to have to go through this. Help us all learn from your lessons and patterns in successful session submissions. Post in the comments here, or in a response blog post. Just be sure to share your tips with the world so that others can hopefully avoid the mistakes and learn from the successful lessons.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LosTechies?a=GremcUZaw7Y:pqPzL1w0tg8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=GremcUZaw7Y:pqPzL1w0tg8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=GremcUZaw7Y:pqPzL1w0tg8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=GremcUZaw7Y:pqPzL1w0tg8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LosTechies?a=GremcUZaw7Y:pqPzL1w0tg8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LosTechies?i=GremcUZaw7Y:pqPzL1w0tg8:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LosTechies/~4/GremcUZaw7Y" height="1" width="1"/>]]></content:encoded>
		<wfw:commentRss>http://lostechies.com/derickbailey/2013/03/15/tips-on-submitting-a-conference-session/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
            <media:content url="http://www.gravatar.com/avatar/e592bd1326b1e80188ed4c0bf26b9f75?s=96&amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&amp;r=G" medium="image">
            <media:title type="html">Derick Bailey</media:title>
        </media:content>
    		<feedburner:origLink>http://lostechies.com/derickbailey/2013/03/15/tips-on-submitting-a-conference-session/</feedburner:origLink></item>
</channel>
</rss><!-- 217 queries 1.217 seconds. -->
