<?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:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Los Techies</title><link>http://www.lostechies.com/blogs/</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><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/BigNellie" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>How We Do Things - Specification (Using the right tools)</title><link>http://feedproxy.google.com/~r/LosTechies/~3/_T5TOhxgEVI/how-we-do-things-specification-using-the-right-tools.aspx</link><pubDate>Fri, 13 Nov 2009 14:41:52 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30581</guid><dc:creator>Scott C Reynolds</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;&lt;em&gt;This content comes solely from my experience, study, and a lot of trial and error (mostly error). I make no claims stating that which works for me will work for you. As with all things, your mileage may vary, and you will need to apply all knowledge through the filter of your context in order to strain out the good parts for you. Also, feel free to call BS on anything I say. I write this as much for me to learn as for you.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This is part 7 of the &lt;a href="http://www.lostechies.com/blogs/scottcreynolds/archive/2009/10/04/how-we-do-things-preamble-and-contents.aspx"&gt;How We Do Things&lt;/a&gt; series.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This post was co-written with &lt;a href="http://www.catschwamm.com"&gt;Cat Schwamm&lt;/a&gt;, business analyst extraordinaire.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In the last post we talked about how we approach specification philosophically, as an iterative, JIT process. In this post we will take a look at the tools we use to create specifications.&lt;/p&gt;
&lt;h3&gt;User Stories and Text&lt;/h3&gt;
&lt;p&gt;User stories and other text documents are the bread and butter of defining work, and we use them like crazy. Our story practice has evolved over time, and we have come to a place where we feel that, when used appropriately, our stories are very effective. For a deeper look at the guidelines we use to construct stories, I recommend you go check out &lt;a href="http://catschwamm.com/2009/08/09/constructing-effective-user-stories-or-my-user-stories-bring-all-the-boys-to-the-yard/"&gt;Cat’s post&lt;/a&gt; on the subject. Go ahead. I’ll wait.&lt;/p&gt;
&lt;p&gt;Okay, welcome back. Here’s the thing, stories and tasks are only part of the equation. Stories alone aren’t enough to define a system, and trying to define everything in text is a fool’s task. (I’ve been that fool). You need a full arsenal of specification tools to do the best job possible.&lt;/p&gt;
&lt;p&gt;Story Pros: captures textual data well, tells the story&lt;/p&gt;
&lt;p&gt;Story Cons: not everything is meant to be captured in text&lt;/p&gt;
&lt;h3&gt;Mockups&lt;/h3&gt;
&lt;p&gt;Mockups are a very useful tool when specifying details of how things should work. With stories, you really can't add a lot of design and implementation details or the signal to noise ratio becomes too high and shit gets overlooked. A basic rule of thumb we employ on the team is &lt;em&gt;"things that don't get communicated well in text shouldn't be forced into a text medium."&lt;/em&gt; Basically, if you're going to try to describe the way something should look in a story, a) it's probably not going to look the way you actually picture it b) that story is now noisy as crap and people are going to ignore more important parts. With a mockup, you don't have to take forever to do a flashy, literal, perfect screenshot in Fireworks or anything; you can just drag and drop Balsamiq controls around and voila. Ya got an aesthetically pleasing mockup that humans go nuts over. In five minutes I can mock something up in front of a developer, explain how it works, and they are ready to go.&lt;/p&gt;
&lt;p&gt;Another great thing about mockups is that they are extremely useful for getting user feedback on specs without distracting the user that "this is the final product, no more input." You can use a mockup to discuss workflow and layout without getting mired in fine-grained detail. The last time I was at the lab, I went back to my hotel room for a couple of hours and mocked up apps for 4 workspaces, brought them back to the supervisors and was able to get plenty of good feedback and make edits right there in front of them. Gold.&lt;/p&gt;
&lt;p&gt;Mockup Pros: Time-saver, gives the gist of what you want, keeps your stories clean while still conveying what you want, good to show to users.&lt;/p&gt;
&lt;p&gt;Mockup Cons: Can fall into the trap of putting everything on a mockup just like you would put everything into a story and it's inappropriate&lt;/p&gt;
&lt;h3&gt;High Fidelity Design&lt;/h3&gt;
&lt;p&gt;How easy is it to develop from what basically amounts to a screenshot? You know exactly how everything should look, you can strip images out, you don't really have to think about it.&lt;/p&gt;
&lt;p&gt;Wait a minute. There's a red flag.&lt;/p&gt;
&lt;p&gt;You don't have to think about it? That's a paddlin'. A high fidelity screenshot, while beautiful and easy to work from, gives developers a signal that this screen is a specification set in stone. They see what it needs to look like, they build it like that. It's just like BDUF; the high level of detail and granularity means that people won't think about what they're actually building, they'll just duplicate what they are given.&lt;/p&gt;
&lt;p&gt;Screenshot Pros: Hotness, high level of detail, easy to work from&lt;/p&gt;
&lt;p&gt;Screenshot Cons: Removes developer thought, can take a long time to create such a design &lt;/p&gt;
&lt;h3&gt;Conversation and Whiteboarding&lt;/h3&gt;
&lt;p&gt;While each of these mediums has plenty of merit and many benefits, conversation and whiteboarding are my (Cat's..well, OK mine too) favorite method of specifying work. There is nothing like having the team (or pertinent members) together, talking through the workflow of a feature/app, mapping out how everything works, doodling out a rough idea of what things are going to look like and how things will come together. It is so damned valuable to have the working group together, talking through how things are going to work and getting their input. While business analysts and managers can come together to specify the general nature of how things need to work, having different members of the team around will help to eke out edge cases or problems that may not have been thought of in original discussion.&lt;/p&gt;
&lt;p&gt;Conversation is obviously important by itself too; user stories are written to leave plenty of room for conversation. If you lose communication on your team and people just go off to code in the dark, a lot of the intent and original specification is lost.&lt;/p&gt;
&lt;p&gt;Whiteboard Pros: Mapping workflow, multiple sources of input, easy to sketch out an idea/easy to change an idea, whiteboarding is fun as shit, conversation fully fleshes out ideas&lt;/p&gt;
&lt;p&gt;Whiteboard Cons: Easy to get lost if not captured appropriately&lt;/p&gt;
&lt;p&gt;While we’ve clearly chosen a favorite medium, you really can’t use just one.  Each medium has a lot to offer depending on the scenario you are working with, and just like any other thing, you have to use what works naturally for the team in context with what you are doing.&lt;/p&gt;
&lt;!-- Technorati Tags Start --&gt;
&lt;p&gt;Technorati Tags:
&lt;a href="http://technorati.com/tag/how                   4e                  12o                   6t" rel="tag"&gt;how we do it&lt;/a&gt;, &lt;a href="http://technorati.com/tag/improvement" rel="tag"&gt;improvement&lt;/a&gt;, &lt;a href="http://technorati.com/tag/lean" rel="tag"&gt;lean&lt;/a&gt;, &lt;a href="http://technorati.com/tag/management" rel="tag"&gt;management&lt;/a&gt;, &lt;a href="http://technorati.com/tag/quality" rel="tag"&gt;quality&lt;/a&gt;, &lt;a href="http://technorati.com/tag/software" rel="tag"&gt;software&lt;/a&gt;, &lt;a href="http://technorati.com/tag/team" rel="tag"&gt;team&lt;/a&gt;, &lt;a href="http://technorati.com/tag/planning" rel="tag"&gt;planning&lt;/a&gt;
&lt;/p&gt;
&lt;!-- Technorati Tags End --&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=How+We+Do+Things+-+Specification+(Using+the+right+tools)&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fscottcreynolds%2farchive%2f2009%2f11%2f13%2fhow-we-do-things-specification-using-the-right-tools.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fscottcreynolds%2farchive%2f2009%2f11%2f13%2fhow-we-do-things-specification-using-the-right-tools.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30581" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/A609B3C820EAC29BFABDE69A7EDD84F1B36A3508"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/A609B3C820EAC29BFABDE69A7EDD84F1B36A3508"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=_T5TOhxgEVI:TOvJIGBg_2w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=_T5TOhxgEVI:TOvJIGBg_2w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=_T5TOhxgEVI:TOvJIGBg_2w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=_T5TOhxgEVI:TOvJIGBg_2w:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/_T5TOhxgEVI" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/lean/default.aspx">lean</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/management/default.aspx">management</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/mentoring/default.aspx">mentoring</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/software/default.aspx">software</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/quality/default.aspx">quality</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/improvement/default.aspx">improvement</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/how+we+do+it/default.aspx">how we do it</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/team/default.aspx">team</category><feedburner:origLink>http://www.lostechies.com/blogs/scottcreynolds/archive/2009/11/13/how-we-do-things-specification-using-the-right-tools.aspx</feedburner:origLink></item><item><title>How to annoy your teammates</title><link>http://feedproxy.google.com/~r/LosTechies/~3/kd2E-YLhehI/how-to-annoy-your-teammates.aspx</link><pubDate>Fri, 13 Nov 2009 14:22:55 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30578</guid><dc:creator>bogardj</dc:creator><slash:comments>7</slash:comments><description>&lt;p&gt;In 3 easy steps:&lt;/p&gt;  &lt;h3&gt;Step 1: Perform a change that affects many, many files&lt;/h3&gt;  &lt;p&gt;My favorite is a namespace rename.&amp;#160; Other choices include deleting a core marker interface, renaming a layer supertype class, or changing the folder structure in a project.&lt;/p&gt;  &lt;p&gt;Typically, VisualStudio will crash when I do this, though I’m not sure if it’s VS choking or ReSharper.&amp;#160; Either way, a large automatic refactoring will cause a crash.&lt;/p&gt;  &lt;h3&gt;Step 2: After the VS crash, re-open the solution and choose to recover all unsaved files&lt;/h3&gt;  &lt;p&gt;ReSharper likely made it quite a ways through your refactoring before VS crashed.&amp;#160; All those unsaved files were likely cached for recovery by VisualStudio, so you can probably get a lot of those changes back.&amp;#160; Instead of choosing to revert your local changes, go ahead and recover all those files.&amp;#160; It’s key for maximum annoyance.&lt;/p&gt;  &lt;h3&gt;Step 3: Merge these recovered files back to trunk&lt;/h3&gt;  &lt;p&gt;Since this was an &lt;em&gt;enormous&lt;/em&gt; refactoring, maybe affecting hundreds of files, you’ll want to merge your changes back to trunk as soon as possible.&amp;#160; After all, you don’t want to be the sucker merging after everyone else has finished their work.&lt;/p&gt;  &lt;p&gt;When you’re done, your co-workers will be greeted with one annoying merge, and another fun dialog that never seems to quite go away:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/jimmy_5F00_bogard/image_5F00_74481858.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/jimmy_5F00_bogard/image_5F00_thumb_5F00_3AC50861.png" width="451" height="242" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Just when you think you caught the last of the recovered files that had its line endings screwed up, another one pops up.&amp;#160; They’ll hate you once because of the core change that affected so many files, making it quite annoying to merge back to trunk.&amp;#160; But they’ll form that long-lasting, persistent hate because of this dialog box that keeps coming up.&amp;#160; Yes, there is that little checkbox at the bottom, but who reads these things anyway?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=How+to+annoy+your+teammates&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f11%2f13%2fhow-to-annoy-your-teammates.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f11%2f13%2fhow-to-annoy-your-teammates.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30578" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/B5112BEF611D3C5DAA20BE439457ED365A5D13C5"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/B5112BEF611D3C5DAA20BE439457ED365A5D13C5"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=kd2E-YLhehI:9uC5y7JVfNE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=kd2E-YLhehI:9uC5y7JVfNE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=kd2E-YLhehI:9uC5y7JVfNE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=kd2E-YLhehI:9uC5y7JVfNE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/kd2E-YLhehI" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/jimmy_bogard/archive/tags/Misc/default.aspx">Misc</category><feedburner:origLink>http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/11/13/how-to-annoy-your-teammates.aspx</feedburner:origLink></item><item><title>Willed and forced design</title><link>http://feedproxy.google.com/~r/LosTechies/~3/hPccuMKJZC4/willed-and-forced-design.aspx</link><pubDate>Fri, 13 Nov 2009 02:32:19 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30528</guid><dc:creator>bogardj</dc:creator><slash:comments>9</slash:comments><description>&lt;p&gt;Roy Osherove, as a TypeMock employee, presents quite a dilemma from opinionated TDD blog posts simply because whether he has one or not, there’s always the question of agenda.&amp;#160; Which is quite unfortunate, everyone has some sort of selfish agenda at some level.&amp;#160; One of those posts came up in a commentary on &lt;a href="http://weblogs.asp.net/rosherove/archive/2009/11/12/test-driven-design-willed-vs-forced-designs.aspx"&gt;willed and forced design&lt;/a&gt;, with respect to the usage of mocking frameworks:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;#1 Willed Design&lt;/strong&gt;&lt;/p&gt;    &lt;blockquote&gt;     &lt;p&gt;By writing tests, you can observe the usability of your design from a consumer perspective, and can decide whether or not you like it, and change it accordingly&lt;/p&gt;   &lt;/blockquote&gt;    &lt;p&gt;&lt;strong&gt;#2 Forced Design&lt;/strong&gt;&lt;/p&gt;    &lt;blockquote&gt;     &lt;p&gt;By using a subset of the available isolation frameworks(rhino, moq, nmock) or specific techniques *manual mocks and stubs) you discover cases that are not technically “mockable” or “fakeable” and use that as a sign for design change.&lt;/p&gt;   &lt;/blockquote&gt; &lt;/blockquote&gt;  &lt;p&gt;After about 2 seconds of playing around with dynamic languages such as Ruby and JavaScript, the idea that TypeMock is some how “impure” seemed rather silly.&amp;#160; Yes, it bends the CLR in crazy ways, but in and of itself, I believe it has its place.&lt;/p&gt;  &lt;p&gt;However, I highly disagree with Roy that #2 is bad, that a tool shouldn’t force my hand in a design.&amp;#160; But there’s a bit of a straw man here – it’s not the &lt;em&gt;tool&lt;/em&gt; forcing my design, it’s the &lt;em&gt;test&lt;/em&gt; telling me where I need to change my design.&amp;#160; Quite simply, if I run up against something hard to test, my first choice is to isolate that piece.&amp;#160; Here’s an example:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ActionResult &lt;/span&gt;Index()
{
    &lt;span style="color: blue"&gt;var &lt;/span&gt;user = Session[&lt;span style="color: #a31515"&gt;&amp;quot;CurrentUser&amp;quot;&lt;/span&gt;];

    &lt;span style="color: blue"&gt;return &lt;/span&gt;View(user);
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;This piece is awkward to test, even though HttpSessionBase or whatever is a class with virtual methods, and it makes the test ugly.&amp;#160; Yes, I could mock the crap out of this heavyweight object, but that’s not really helping me out, is it?&amp;#160; Instead, I’ll isolate the ugly:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private readonly &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IUserSession &lt;/span&gt;_userSession;

&lt;span style="color: blue"&gt;public &lt;/span&gt;HomeController(&lt;span style="color: #2b91af"&gt;IUserSession &lt;/span&gt;userSession)
{
    _userSession = userSession;
}

&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ActionResult &lt;/span&gt;Index()
{
    &lt;span style="color: blue"&gt;var &lt;/span&gt;user = _userSession.GetUser();

    &lt;span style="color: blue"&gt;return &lt;/span&gt;View(user);
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Instead of using a dictionary directly, I’ll hide that business behind a facade service, keeping the dictionary ugliness and duplication in one highly cohesive class.&amp;#160; But it was the _test_ that led me to do this, because I’m tuned in to pieces that are hard to mock.&amp;#160; File I/O?&amp;#160; Facade.&amp;#160; Web service proxies?&amp;#160; Facade.&amp;#160; Registry, HttpContext, etc. etc?&amp;#160; All facade.&amp;#160; I want to isolate my core application from the untestable pieces, not because they’re necessary untestable, but because I don’t want to couple my application directly to these external services.&amp;#160; Putting these behind targeted facades eliminates all that duplication that directly using these APIs tends to encourage.&lt;/p&gt;

&lt;p&gt;There are plenty of APIs that slapping a simple facade over tends to make things worse, not better, such as:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Workflow Foundation&lt;/li&gt;

  &lt;li&gt;SharePoint&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And any other framework that requires you to tiiiiightly integrate with in order to be successful.&amp;#160; So where does that leave me and TypeMock?&amp;#160; Well, I don’t use any of those frameworks that require tight coupling, and I don’t have any pain with my current tool of choice in .NET (Rhino Mocks), so why switch exactly?&amp;#160; For those rare occasions I might need TypeMock (DateTime.Now), I &lt;a href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/11/09/systemtime-versus-isystemclock-dependencies-revisited.aspx"&gt;already have a solution&lt;/a&gt; I quite like.&amp;#160; Yes, TypeMock could be free, but the only compelling reason I’d switch would be to another free tool with a better, clearer to write, read and scan API.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Willed+and+forced+design&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f11%2f12%2fwilled-and-forced-design.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f11%2f12%2fwilled-and-forced-design.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30528" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/E6CB54A635101C0BBEAFF9241A09CBA6DCE7C038"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/E6CB54A635101C0BBEAFF9241A09CBA6DCE7C038"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=hPccuMKJZC4:zHVs41W1hF4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=hPccuMKJZC4:zHVs41W1hF4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=hPccuMKJZC4:zHVs41W1hF4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=hPccuMKJZC4:zHVs41W1hF4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/hPccuMKJZC4" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/jimmy_bogard/archive/tags/TDD/default.aspx">TDD</category><feedburner:origLink>http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/11/12/willed-and-forced-design.aspx</feedburner:origLink></item><item><title>How We Do Things - Evolving our Specification Practice</title><link>http://feedproxy.google.com/~r/LosTechies/~3/H0iODGhtM5U/how-we-do-things-evolving-our-specification-practice.aspx</link><pubDate>Thu, 12 Nov 2009 21:59:14 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30503</guid><dc:creator>Scott C Reynolds</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;&lt;em&gt;This content comes solely from my experience, study, and a lot of trial and error (mostly error). I make no claims stating that which works for me will work for you. As with all things, your mileage may vary, and you will need to apply all knowledge through the filter of your context in order to strain out the good parts for you. Also, feel free to call BS on anything I say. I write this as much for me to learn as for you.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This is part 6 of the &lt;a href="http://www.lostechies.com/blogs/scottcreynolds/archive/2009/10/04/how-we-do-things-preamble-and-contents.aspx"&gt;How We Do Things&lt;/a&gt; series.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This post was co-written on Google Wave with my colleague &lt;a href="http://www.catschwamm.com"&gt;Cat Schwamm&lt;/a&gt;, who keeps me sane every day.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In this part we will explore how specification practice has evolved in our team, from a very waterfallish BDUF approach to what currently is a very lean approach to specification. In the next part of the series we will talk stories and mockups and other tools we employ to make the magic happen.&lt;/p&gt;
&lt;h3&gt;Where we came from&lt;/h3&gt;
&lt;p&gt;We began our large LIS project in late 2004, starting with about 6 full months of writing specifications and designing the database. We created reams of documentation for each application complete with use cases that we knew we wouldn't even implement until after the first version was released (sidebar: some of those still haven't been done). We defined more than 100 tables of heavily normalized database schema. Before one line of code was written, we had spent six months of project budget.&lt;/p&gt;
&lt;p&gt;As development continued on the project we found ourselves diverging from the specifications that had been created. The documents became little more than a roadmap, with the bold headers on functional groups and the basic usage stories becoming the guidelines that we followed. Much of the detailed specification and database schema went out the window as the system took shape and people began to see and give feedback on what was being produced. Too much specification gave us a false sense of "doing it right" and led us down many wrong paths. Balancingrework with completing planned features became a costly chore.&lt;/p&gt;
&lt;p&gt;By the time the project was complete, it was clear that much of that up-front work had been wasted time and money. Had we top-lined the major milestones of such a large project, detailed a small set of functionality, and started developing iteratively, the system would have taken form much sooner, allowing for a tighter feedback loop and much less overall waste.&lt;/p&gt;
&lt;h3&gt;How we do it now - Overview&lt;/h3&gt;
&lt;p&gt;Lessons learned, we set about improving how we do specification. I already talked a little about this in the posts on planning, so please review those if you haven't seen them yet. &lt;a href="http://www.scottcreynolds.com/archive/2009/10/05/607.aspx"&gt;[part 1]&lt;/a&gt; &lt;a href="http://www.scottcreynolds.com/archive/2009/10/06/609.aspx"&gt;[part 2]&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When planning a new project of any size, we take an iterative approach. We start at a very high level, and strive to understand the goals of the project. What need does it serve? Who will be using it? Are we competing with something else for market share? Is there a strategic timeline? What's the corporate vision here? What are the bullet points? We will fill in details later. We only want broad targets to guide us further.&lt;/p&gt;
&lt;p&gt;When we get closer to development, we start to identify smaller chunks of functionality within each of those broad areas. This is still pretty high level, but done by business analysts and management on the IT team. We start to identify MMFs (minimal marketable features) and group them up in order of importance to help determine next steps.&lt;/p&gt;
&lt;p&gt;MMFs in hand, we take the first one and start defining it further. This is where the information from the planning post comes in. We start to write stories (Cat has a &lt;a href="http://catschwamm.com/2009/08/09/constructing-effective-user-stories-or-my-user-stories-bring-all-the-boys-to-the-yard/"&gt;great post&lt;/a&gt; detailing how to build effective stories). The other information gathered to this point sits dormant, with as little specification work done as possible, until such time as we are getting closer to working on it.&lt;/p&gt;
&lt;p&gt;Over time, and only as needed, we put more and more specification on the system, and this is done in parallel with development. In fact, often the most specific information can only surface during development of those features, as they take shape, and as we understand how users will react. Specification should be every bit as iterative as coding.&lt;/p&gt;
&lt;p&gt;Reduced to its essence, we JIT specification at many levels to allow maximum flexibility to change direction with minimal wasted work.&lt;/p&gt;
&lt;h3&gt;Gemba is an essential part of specification&lt;/h3&gt;
&lt;p&gt;
It's often the case that a team relies on "domain experts" to provide them with the specifications they need to build software. This is the BDUF way - gather in committee and have the all-knowing user tell you what to build. Fail.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Cat sez:&lt;/em&gt;
&lt;/p&gt;&lt;blockquote&gt;
The dev team works out of the corporate office in Florida, while the actual laboratory is located in upstate New York. As a result, it is often an exercise of the imagination to figure out the best way to create things for them. Before I visited the lab, I relied on information from others, emails back and forth to the lab crews working all weird hours of the night, and my knowledge of the applications currently in existence. I really only ever got half the picture, and it was difficult to ensure that the things I was specifying would fit into the lab users workflow well without actually knowing what was going on up there. When I visited the lab my whole world was changed. Actually seeing how users interacted with the software and seeing ways they would work around what we didn't have (open Excel or Word documents on their desktop, a wall covered in post-it notes). Just from walking around talking to people for 2 days, I probably got 50 requests. And they never would have asked for them; they would have just kept suffering. Being there showed me everything about how they worked and a million ways I could improve their lives. The experience was invaluable to both me and them, and each subsequent trip has just improved my knowledge of the way we work and the way they interact with our software.&lt;/blockquote&gt;
&lt;p&gt;There is no substitute for a certain amount of domain expertise being resident in the team room. Your domain experts are experts only in their domain. They may know the workings of a histology laboratory inside and out, but if you ask them to design a system to support that lab, they'll come back with something that looks an awful lot like excel and post-it notes.&lt;/p&gt;
&lt;div style="text-align:center;"&gt;&lt;img src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/scottcreynolds/postits.png" alt="postits.png" border="0" width="604" height="453" /&gt;&lt;br /&gt; &lt;em&gt;Yes...this is a workaround someone had for something our system didn't do. It's been fixed ;)&lt;/em&gt;&lt;/div&gt;
&lt;p&gt;Lean has a concept of the &lt;a href="http://en.wikipedia.org/wiki/Gemba"&gt;gemba attitude&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Genchi_Genbutsu"&gt;genchi genbutsu&lt;/a&gt;, essentially, being in the place where the action happens. Developers and business analysts have to work with the domain experts, in the place where the work happens, and observe the true workflows in place before hoping to design a system to support them. You cannot get this information from sit down meetings and emails with domain experts. You must go and see for yourself, or you will miss things.&lt;/p&gt;
&lt;p&gt;
In the next post we will talk specifically about the tools and techniques we use to specify work, and how we combine them to form complete pictures of a system (spoiler alert: it ain't just stories).&lt;/p&gt;&lt;/div&gt;
&lt;!-- Technorati Tags Start --&gt;
&lt;p&gt;Technorati Tags:
&lt;a href="http://technorati.com/tag/how                   4e                  12o                   4t" rel="tag"&gt;how we do it&lt;/a&gt;, &lt;a href="http://technorati.com/tag/improvement" rel="tag"&gt;improvement&lt;/a&gt;, &lt;a href="http://technorati.com/tag/lean" rel="tag"&gt;lean&lt;/a&gt;, &lt;a href="http://technorati.com/tag/management" rel="tag"&gt;management&lt;/a&gt;, &lt;a href="http://technorati.com/tag/quality" rel="tag"&gt;quality&lt;/a&gt;, &lt;a href="http://technorati.com/tag/software" rel="tag"&gt;software&lt;/a&gt;, &lt;a href="http://technorati.com/tag/team" rel="tag"&gt;team&lt;/a&gt;, &lt;a href="http://technorati.com/tag/planning" rel="tag"&gt;planning&lt;/a&gt;
&lt;/p&gt;
&lt;!-- Technorati Tags End --&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=How+We+Do+Things+-+Evolving+our+Specification+Practice&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fscottcreynolds%2farchive%2f2009%2f11%2f12%2fhow-we-do-things-evolving-our-specification-practice.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fscottcreynolds%2farchive%2f2009%2f11%2f12%2fhow-we-do-things-evolving-our-specification-practice.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30503" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/292D42307DE44656D14125697C667B83D9839F82"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/292D42307DE44656D14125697C667B83D9839F82"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=H0iODGhtM5U:J9nwWDmsfvw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=H0iODGhtM5U:J9nwWDmsfvw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=H0iODGhtM5U:J9nwWDmsfvw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=H0iODGhtM5U:J9nwWDmsfvw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/H0iODGhtM5U" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/lean/default.aspx">lean</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/management/default.aspx">management</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/software/default.aspx">software</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/improvement/default.aspx">improvement</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/how+we+do+it/default.aspx">how we do it</category><category domain="http://www.lostechies.com/blogs/scottcreynolds/archive/tags/team/default.aspx">team</category><feedburner:origLink>http://www.lostechies.com/blogs/scottcreynolds/archive/2009/11/12/how-we-do-things-evolving-our-specification-practice.aspx</feedburner:origLink></item><item><title>Going Away Geek Beers</title><link>http://feedproxy.google.com/~r/LosTechies/~3/SAcVVGt-bmg/going-away-geek-beers.aspx</link><pubDate>Thu, 12 Nov 2009 14:47:43 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30470</guid><dc:creator>Scott C Reynolds</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Most of you have heard by now that I am leaving Florida for the concrete pastures of New York City.&lt;/p&gt;
&lt;p&gt;I'd like to have a get-together of some of the Florida community guys (and gals) Monday, Nov 16, in Ocala at 7pm until we decide to leave.&lt;/p&gt;
&lt;p&gt;It's truly been a pleasure working with this community over the last few years, and I will miss you guys. So..come on out and buy me a beer! ;)&lt;/p&gt;
&lt;p&gt;Location: &lt;a href="http://maps.google.com/maps/place?oe=utf-8&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a&amp;um=1&amp;ie=UTF-8&amp;q=omalley%27s+alley+ocala&amp;fb=1&amp;gl=us&amp;hq=omalley%27s+alley&amp;hnear=ocala&amp;cid=6839249953853431108"&gt;O'Malley's Alley&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My phone is 352.209.0943 drop me a line if you get lost of want to confirm you're coming. So far looks like a real good group will be there, including Cory Foy, Sean Chambers, Scott Densmore, and Will Green, the amazing &lt;a href="http://www.catschwamm.com"&gt;Cat Schwamm&lt;/a&gt; as well as members of my team. Hope to see you Monday!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Going+Away+Geek+Beers&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fscottcreynolds%2farchive%2f2009%2f11%2f12%2fgoing-away-geek-beers.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fscottcreynolds%2farchive%2f2009%2f11%2f12%2fgoing-away-geek-beers.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30470" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/99129E1C0881059A8898C1D711B219D9E050BBC2"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/99129E1C0881059A8898C1D711B219D9E050BBC2"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=SAcVVGt-bmg:wREZzsHGvnI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=SAcVVGt-bmg:wREZzsHGvnI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=SAcVVGt-bmg:wREZzsHGvnI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=SAcVVGt-bmg:wREZzsHGvnI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/SAcVVGt-bmg" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.lostechies.com/blogs/scottcreynolds/archive/2009/11/12/going-away-geek-beers.aspx</feedburner:origLink></item><item><title>Electronic Kanban Tools and WIP Limits: LeanKitKanban and AgileZen Get It!</title><link>http://feedproxy.google.com/~r/LosTechies/~3/qNAH9TNEWuA/electronic-kanban-tools-and-wip-limits-leankitkanban-gets-it.aspx</link><pubDate>Mon, 09 Nov 2009 17:55:24 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30192</guid><dc:creator>derick.bailey</dc:creator><slash:comments>10</slash:comments><description>&lt;p&gt;Most of the electronic Kanban boards that exist simply don’t understand what WIP limits are really about. They all seem to go down the path of forcing any step (column) in the process to have a maximum limit that is very hard and fast. They set it up so that you cannot add any more items to the step than the limit allows. But the truth about WIP limits is that they are not supposed to be hard and fast, mechanical limits. Putting in a hard limit like this is a great way to destroy the productivity of a team and usefulness of a tool when the team finds themselves in a crunch, in a situation with additional resources and needs, or any of a number of other circumstances.&lt;/p&gt;  &lt;p&gt;I know I haven’t been vocal about this online, but it’s something I’ve been complaining about to my coworkers and friends for a while. It bugs me and is one of the major reasons that I’ve stayed away from the major (free) players in the electronic Kanban realm, other than trials and basic testing of the systems.&lt;/p&gt;  &lt;p&gt;But then I got an email from Chris Hefley this morning, about some new features in &lt;a href="http://leankitkanban.com/"&gt;LeanKitKanban&lt;/a&gt;. When I logged in to check them out, I was surprised to see this happen when I tried to exceed a column limit:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derickbailey/image_5F00_0093C96B.png" width="646" height="450" /&gt; &lt;/p&gt;  &lt;p&gt;I can’t tell you how happy I was to see this! Finally, one of the tools vendors in this space is really starting to get it! For this, and a few other reasons that I don’t want to talk about yet, &lt;a href="http://leankitkanban.com/"&gt;LeanKitKanban&lt;/a&gt; is now officially my favorite electronic Kanban / task board around. If you haven’t done so, I highly recommend that you check them out. &lt;/p&gt;  &lt;p&gt;Do any other electronic Kanban boards are heading down this same path and allowing for limit overrides? If your current tool doesn’t support this, it should.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Looks like &lt;a href="http://agilezen.com"&gt;AgileZen&lt;/a&gt; is getting this feature in the next release (see Nate’s comments below). that’s great news! I’ve been impressed by this tool as well. the support for soft WIP limits in multiple tools is starting to show some real competition and innovation in the market space. that’s good news for everyone!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Electronic+Kanban+Tools+and+WIP+Limits%3a+LeanKitKanban+and+AgileZen+Get+It!&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fderickbailey%2farchive%2f2009%2f11%2f09%2felectronic-kanban-tools-and-wip-limits-leankitkanban-gets-it.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fderickbailey%2farchive%2f2009%2f11%2f09%2felectronic-kanban-tools-and-wip-limits-leankitkanban-gets-it.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30192" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/8F6C0CBB9EBB1B3136EBEF51F6EDCCA9C1B83230"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/8F6C0CBB9EBB1B3136EBEF51F6EDCCA9C1B83230"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=qNAH9TNEWuA:-XhSdSglD2I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=qNAH9TNEWuA:-XhSdSglD2I:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=qNAH9TNEWuA:-XhSdSglD2I:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=qNAH9TNEWuA:-XhSdSglD2I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/qNAH9TNEWuA" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/derickbailey/archive/tags/Management/default.aspx">Management</category><category domain="http://www.lostechies.com/blogs/derickbailey/archive/tags/Kanban/default.aspx">Kanban</category><category domain="http://www.lostechies.com/blogs/derickbailey/archive/tags/Metrics/default.aspx">Metrics</category><category domain="http://www.lostechies.com/blogs/derickbailey/archive/tags/Tools+and+Vendors/default.aspx">Tools and Vendors</category><feedburner:origLink>http://www.lostechies.com/blogs/derickbailey/archive/2009/11/09/electronic-kanban-tools-and-wip-limits-leankitkanban-gets-it.aspx</feedburner:origLink></item><item><title>Fields and virtual members</title><link>http://feedproxy.google.com/~r/LosTechies/~3/xiYwfDocNI0/fields-and-virtual-members.aspx</link><pubDate>Mon, 09 Nov 2009 14:40:25 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30181</guid><dc:creator>bogardj</dc:creator><slash:comments>17</slash:comments><description>&lt;p&gt;It seems like the sillier the bug, the more time you’ll spend debugging it, simply because it’s in functionality you just &lt;em&gt;knew&lt;/em&gt; that worked correctly (and had the tests to back it up).&amp;#160; One problem we hit recently was code that used fields to back virtual properties:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public abstract class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Enumeration &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IComparable
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;private readonly int &lt;/span&gt;_value;

    &lt;span style="color: blue"&gt;protected &lt;/span&gt;Enumeration() { }

    &lt;span style="color: blue"&gt;protected &lt;/span&gt;Enumeration(&lt;span style="color: blue"&gt;int &lt;/span&gt;value)
    {
        _value = value;
    }

    &lt;span style="color: blue"&gt;public virtual int &lt;/span&gt;Value
    {
        &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;_value; }
    }

    &lt;span style="color: blue"&gt;public virtual int &lt;/span&gt;CompareTo(&lt;span style="color: blue"&gt;object &lt;/span&gt;other)
    {
        &lt;span style="color: blue"&gt;return &lt;/span&gt;_value.CompareTo(((&lt;span style="color: #2b91af"&gt;Enumeration&lt;/span&gt;)other).Value);
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;This isn’t a problem in and of itself, except in the behavior of that last method.&amp;#160; Notice its logic uses the &lt;em&gt;field&lt;/em&gt; and not the &lt;em&gt;property&lt;/em&gt;.&amp;#160; I can then define a derived type:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PercentDiscount &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;Enumeration
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public override int &lt;/span&gt;Value
    {
        &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;5; }
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;But now my CompareTo method breaks because it isn’t using the correct value.&amp;#160; It uses the uninitialized field, causing all sorts of bizarre behavior.&amp;#160; When you have logic errors in places like GetHashCode, Equals or CompareTo, I can guarantee your application will break in the most hair-pulling ways imaginable.&lt;/p&gt;

&lt;h3&gt;Let’s fix it&lt;/h3&gt;

&lt;p&gt;So what’s a better option?&amp;#160; We could just “make sure” that we don’t use the private field, and only use the virtual property.&amp;#160; But I hate conventions that rely on my memory to not make a mistake, I want to fall into the &lt;a href="http://blogs.msdn.com/brada/archive/2003/10/02/50420.aspx"&gt;pit of success&lt;/a&gt;.&amp;#160; One way to do so is to use automatic properties:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public abstract class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Enumeration &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IComparable
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;protected &lt;/span&gt;Enumeration() { }

    &lt;span style="color: blue"&gt;protected &lt;/span&gt;Enumeration(&lt;span style="color: blue"&gt;int &lt;/span&gt;value)
    {
        Value = value;
    }

    &lt;span style="color: blue"&gt;public virtual int &lt;/span&gt;Value
    { 
        &lt;span style="color: blue"&gt;get&lt;/span&gt;;
        &lt;span style="color: blue"&gt;private set&lt;/span&gt;;
    }

    &lt;span style="color: blue"&gt;public virtual int &lt;/span&gt;CompareTo(&lt;span style="color: blue"&gt;object &lt;/span&gt;other)
    {
        &lt;span style="color: blue"&gt;return &lt;/span&gt;Value.CompareTo(((&lt;span style="color: #2b91af"&gt;Enumeration&lt;/span&gt;)other).Value);
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Instead of a backing field, we’ll use an automatic property, making it impossible to use a non-virtual backing field.&amp;#160; We still get the same access modifiers (a virtual, overridable getter, a private setter), plus the benefits of automatic properties.&amp;#160; So now I’m curious: &lt;strong&gt;are there any valid reasons to keep using fields for holding state&lt;/strong&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Fields+and+virtual+members&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f11%2f09%2ffields-and-virtual-members.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fjimmy_bogard%2farchive%2f2009%2f11%2f09%2ffields-and-virtual-members.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30181" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/F7DB3C52AAFBFC9E9D64A15F2D0AD8F8653C7AD5"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/F7DB3C52AAFBFC9E9D64A15F2D0AD8F8653C7AD5"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=xiYwfDocNI0:WggNhI-E1uU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=xiYwfDocNI0:WggNhI-E1uU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=xiYwfDocNI0:WggNhI-E1uU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=xiYwfDocNI0:WggNhI-E1uU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/xiYwfDocNI0" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/jimmy_bogard/archive/tags/C_2300_/default.aspx">C#</category><feedburner:origLink>http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/11/09/fields-and-virtual-members.aspx</feedburner:origLink></item><item><title>Happy Hack-o-ween: Electronics and a microcontroller spice up the haunt</title><link>http://feedproxy.google.com/~r/LosTechies/~3/RNaKSUaqU74/happy-hack-o-ween-electronics-and-a-microcontroller-spice-up-the-haunt.aspx</link><pubDate>Sun, 08 Nov 2009 16:27:00 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30142</guid><dc:creator>Sharon J. Cichelli</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Ah, Halloween, when a young woman's fancy turns to love. And zombies.&lt;/p&gt;
&lt;p&gt;I had two personal requirements for the costume I would build this year:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It shall be spooky.&lt;/li&gt;
&lt;li&gt;It shall blink.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I'll tell you about the final result, the electronics and the software that went into it, plus the techniques I used to achieve wearable electronics. I'll introduce you to the &lt;a href="http://www.arduino.cc/"&gt;Arduino&lt;/a&gt;, an open-source microcontroller prototyping platform, which is an exhilarating tool/toy for making your software skills manifest in the physical world.&lt;/p&gt;
&lt;p&gt;My husband and I have been teaching ourselves electronics. A few months ago, Dad taught me to solder. I recently read Syuzi Pakhchyan's excellent primer on wearable electronics and smart materials, &lt;a href="http://www.librarything.com/work/5874825/book/47829579"&gt;&lt;i&gt;Fashioning Technology&lt;/i&gt;&lt;/a&gt;. And I've been &lt;a href="http://blog.makezine.com/archive/2009/10/ambient_led_flowerpot_clock.html"&gt;making things&lt;/a&gt; with my Arduino. All these ideas were swirling and combining in my head to inspire this year's Halloween project. Er, &lt;em&gt;costume&lt;/em&gt;. Same difference.&lt;/p&gt;
&lt;p&gt;What was I? I was a nightmare... the thing under your bed... the reason for your well developed sense of paranoia...&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/spyderella/sets/72157622735987434/"&gt;&lt;img src="http://farm3.static.flickr.com/2609/4076005063_851a85338f_m.jpg" width="161" height="240" alt="The thing under your bed" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I sported a crop of writhing eyeballs erupting from my head. Each eyeball has an LED inside it, and they blink randomly and independently, until I trigger a hidden switch, which causes the blinky ones to go dark and two red eyes to pulse menacingly. In the &lt;a href="http://www.flickr.com/photos/spyderella/sets/72157622735987434/"&gt;Flickr photoset&lt;/a&gt;, you can see the construction process.&lt;/p&gt;
&lt;h2&gt;The Arduino Sketch&lt;/h2&gt;
&lt;p&gt;The term "Arduino" is overloaded to mean:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;a particular chip and circuit board which you can buy or build;&lt;/li&gt;
&lt;li&gt;the IDE in which you write programs for the chip;&lt;/li&gt;
&lt;li&gt;the language, which is C-flavored;&lt;/li&gt;
&lt;li&gt;fun.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Arduino programs are called sketches. Every sketch must contain two functions: setup (runs once) and loop (runs continuously). Here's my sketch, with extra explanatory comments, that blinks the six regular eyeballs and responds to the switch by pulsing the red eyeballs.&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 8pt; color: black; background: white; border: 1px solid #ccc; overflow: auto; width: 600px; height: 400px;"&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;#define&lt;/span&gt; SWITCH 8&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;int&lt;/span&gt; ledPins[] = {2, 3, 4, 5, 6, 7};&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; ledPinsCount = 6;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;int&lt;/span&gt; redEyePins[] = {10, 11};&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; redEyePinsCount = 2;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;long&lt;/span&gt; durations[ledPinsCount];&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;int&lt;/span&gt; ledStates[ledPinsCount];&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;long&lt;/span&gt; previousTimes[ledPinsCount];&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;int&lt;/span&gt; i;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;/span&gt; setup()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/span&gt;&amp;nbsp;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/span&gt;&amp;nbsp;&amp;nbsp; pinMode(SWITCH, INPUT); &lt;span style="color: green;"&gt;//Specify the switch pin as an input.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt; (i = 0; i &amp;lt; redEyePinsCount; i++)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/span&gt;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; pinMode(redEyePins, OUTPUT); &lt;span style="color: green;"&gt;//Specify each red-eye LED pin as an output.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/span&gt;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt;(i = 0; i &amp;lt; ledPinsCount; i++)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/span&gt;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; pinMode(ledPins, OUTPUT); &lt;span style="color: green;"&gt;//Specify each regular LED pin as an output.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; ledStates = random(1); &lt;span style="color: green;"&gt;//Randomly set the LEDs to on or off (1 or 0).&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; durations = GetRandomDuration(); &lt;span style="color: green;"&gt;//Define a random duration for each LED to stay in that state.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; previousTimes = 0; &lt;span style="color: green;"&gt;//At time of setup, the "last time we changed" is at 0 milliseconds, the start of time.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/span&gt;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/span&gt;&amp;nbsp;}&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;/span&gt; loop()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/span&gt;&amp;nbsp;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (digitalRead(SWITCH) == HIGH)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/span&gt;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; TurnOffLeds();&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; PulseRedEyes();&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/span&gt;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/span&gt;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt;(i = 0; i &amp;lt; redEyePinsCount; i++)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;40&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; digitalWrite(redEyePins, LOW); &lt;span style="color: green;"&gt;//Turn the red eyes all the way off.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;41&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;42&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;43&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt;(i = 0; i &amp;lt; ledPinsCount; i++) &lt;span style="color: green;"&gt;//For each LED:&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;44&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;45&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (millis() - previousTimes &amp;gt; durations)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;46&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;47&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ChangeLed(i); &lt;span style="color: green;"&gt;//If this one's duration is up, then flip it.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;48&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;49&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;50&lt;/span&gt;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;51&lt;/span&gt;&amp;nbsp;}&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;52&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;53&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;/span&gt; TurnOffLeds()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;54&lt;/span&gt;&amp;nbsp;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;55&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt;(i = 0; i &amp;lt; ledPinsCount; i++)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;56&lt;/span&gt;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;57&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; digitalWrite(ledPins, LOW);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;58&lt;/span&gt;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;59&lt;/span&gt;&amp;nbsp;}&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;60&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;61&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;/span&gt; PulseRedEyes()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;62&lt;/span&gt;&amp;nbsp;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;63&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//Fade on, then off.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;64&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;int&lt;/span&gt; j;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;65&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt;(j = 0; j &amp;lt; 255; j+=5)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;66&lt;/span&gt;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;67&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt;(i = 0; i &amp;lt; redEyePinsCount; i++)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;68&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;69&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; analogWrite(redEyePins, j);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;70&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; delay(10);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;71&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;72&lt;/span&gt;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;73&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt;(j = 255; j &amp;gt; 0; j-=5)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;74&lt;/span&gt;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;75&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt;(i = 0; i &amp;lt; redEyePinsCount; i++)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;76&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;77&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; analogWrite(redEyePins, j);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;78&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; delay(10);&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;79&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;80&lt;/span&gt;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;81&lt;/span&gt;&amp;nbsp;}&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;82&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;83&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;/span&gt; ChangeLed(&lt;span style="color: blue;"&gt;int&lt;/span&gt; ledPin)&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;84&lt;/span&gt;&amp;nbsp;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;85&lt;/span&gt;&amp;nbsp;&amp;nbsp; previousTimes[ledPin] = millis(); &lt;span style="color: green;"&gt;//Update the "last time we changed" to now.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;86&lt;/span&gt;&amp;nbsp;&amp;nbsp; durations[ledPin] = GetRandomDuration(); &lt;span style="color: green;"&gt;//Give it a new random duration.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;87&lt;/span&gt;&amp;nbsp;&amp;nbsp; ledStates[ledPin] = 1 - ledStates[ledPin]; &lt;span style="color: green;"&gt;//Flip the state between on and off.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;88&lt;/span&gt;&amp;nbsp;&amp;nbsp; digitalWrite(ledPins[ledPin], ledStates[ledPin]); &lt;span style="color: green;"&gt;//Set the LED to that state.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;89&lt;/span&gt;&amp;nbsp;}&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;90&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;91&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;long&lt;/span&gt; GetRandomDuration()&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;92&lt;/span&gt;&amp;nbsp;{&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;93&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//Random number between 1 and 10, then multiplied by 400 to give it a detectable duration.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;94&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; random(1, 10) * 400;&lt;/pre&gt;
&lt;pre style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;95&lt;/span&gt;&amp;nbsp;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;I like the way the eyes blink independently. If they all flashed in unison, they would look like Christmas lights, and you would notice that two were "special" because they weren't flashing. Instead, the duration that any given eyeball is lit or dark constantly changes.&lt;/p&gt;
&lt;p&gt;The blinking is managed by a collection of arrays. One array represents each of my LED pins, so that I can address them in a for loop. The three other arrays hold: the state (on/off) of each LED; the duration each LED should stay in that state; the reading from the millisecond counter when the LED last flipped its state. Each time the loop function executes, if the switch is not connected, then I look at each LED; if the difference between the current time and the time when it previously changed is greater than its duration, flip its state (from off to on, or from on to off), randomly assign it a new duration, and record "now" as the new "previously changed" time. If the switch &lt;em&gt;is&lt;/em&gt; connected, then I make the red eyes fade on and fade off.&lt;/p&gt;
&lt;h2&gt;Fading with PWM&lt;/h2&gt;
&lt;p&gt;PWM (Pulse-Width Modulation) is a technique for making a digital component (one that turns on or off) simulate analog behavior (be a little bit on, and then a little bit more on). If you turn an LED off and on really quickly, you won't perceive the flickering, but it will look half as bright, because it is actually off for half the time. If you let it spend a little more time off than on, it will appear even dimmer. So by varying the width of the pulses, you can control how bright the LED looks.&lt;/p&gt;
&lt;p&gt;The Arduino comes with built-in PWM functions; some pins are already set up to be PWM pins. If you plug an LED into one of the PWM pins, then you can write to it as if it were an analog component. That's why, in my sketch above, I set the brightness of the red eyes using &lt;em&gt;analogWrite()&lt;/em&gt;, instead of digitalWrite(). My for loop increments the counter j from 0 to 255, and sets the brightness of both red eyes to the value of j. The Arduino takes care of (imperceptibly) flickering the LEDs with the right ratio of on-time and off-time to achieve a j amount of brightness. So the eyes get gradually brighter, then gradually dimmer. (Then control returns to the main loop function, but if my switch is still connected, the red eyes will throb again.)&lt;/p&gt;
&lt;h2&gt;Snaps: Wearable Plugs&lt;/h2&gt;
&lt;p&gt;A metal sewable snap is like a plug for your clothing, an interface between the world of textiles and the world of wires. This is handy when you need the electronics to be separate while you are getting into the clothing, or if you want to wash the clothing. My Arduino hung out at the base of my neck, to be near the LEDs on my head but hidden underneath my wig, but my control switch was near my hip. I could have run a wire down to the switch, but conductive thread was more subtle and more comfortable.&lt;/p&gt;
&lt;p&gt;To complete the connection, I soldered a short wire to one side of the snap. That wire plugged into a pin on the Arduino. The conductive thread ran from the switch at my hip up to the back of my dress near the Arduino, and I sewed that conductive thread to the other half of the snap. When the two halves are snapped together, the wire and the thread make a complete connection, as if they were one continuous wire.&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/spyderella/4085497865/" title="Soldered snaps / Sewn snaps by Spyderella, on Flickr"&gt;&lt;img src="http://farm3.static.flickr.com/2584/4085497865_a50e4e45d1_m.jpg" width="240" height="180" alt="Soldered snaps / Sewn snaps" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I had two threads (going out to the switch and back), so I encased them each in a bias tape tube, to prevent them from touching each other and shorting out.&lt;/p&gt;
&lt;p&gt;I've been saying "switch," but actually, I simplified at the 11th hour. I tied each thread around a safety pin, and stuck the pins to my dress. When the safety pins touched each other, they completed the circuit, which the Arduino sketch interpreted as triggering the switch&amp;mdash;cue red-eye glare.&lt;/p&gt;
&lt;h2&gt;What's Next&lt;/h2&gt;
&lt;p&gt;Soldering and sewing are both liberating skills to possess&amp;mdash;they free up your creativity to make wilder and more integrated stuff. If you are currently proficient with only one, ask around and see if you can find a buddy who's good at the other, and teach each other.&lt;/p&gt;
&lt;p&gt;The Arduino comes with a great community of hackers and makers, lots of people to learn from and collaborate with. Definitely check it out. There is lots of fun to be had, and blinking LEDs is the barest beginning of what it can do.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Happy+Hack-o-ween%3a+Electronics+and+a+microcontroller+spice+up+the+haunt&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fsharoncichelli%2farchive%2f2009%2f11%2f08%2fhappy-hack-o-ween-electronics-and-a-microcontroller-spice-up-the-haunt.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fsharoncichelli%2farchive%2f2009%2f11%2f08%2fhappy-hack-o-ween-electronics-and-a-microcontroller-spice-up-the-haunt.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30142" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/23258D2FE3F087E35338325DEBB3132CFF6FE4C9"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/23258D2FE3F087E35338325DEBB3132CFF6FE4C9"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=RNaKSUaqU74:E_4YBAmsTYw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=RNaKSUaqU74:E_4YBAmsTYw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=RNaKSUaqU74:E_4YBAmsTYw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=RNaKSUaqU74:E_4YBAmsTYw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/RNaKSUaqU74" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/sharoncichelli/archive/tags/arduino/default.aspx">arduino</category><category domain="http://www.lostechies.com/blogs/sharoncichelli/archive/tags/electronics/default.aspx">electronics</category><feedburner:origLink>http://www.lostechies.com/blogs/sharoncichelli/archive/2009/11/08/happy-hack-o-ween-electronics-and-a-microcontroller-spice-up-the-haunt.aspx</feedburner:origLink></item><item><title>Using MSDeploy to automate your Enterprise Application remote deployments.</title><link>http://feedproxy.google.com/~r/LosTechies/~3/_nfNP-Tnt7k/using-msdeploy-to-automate-your-enterprise-application-remote-deployments.aspx</link><pubDate>Fri, 06 Nov 2009 17:00:00 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:29992</guid><dc:creator>erichexter</dc:creator><slash:comments>9</slash:comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;MsDeploy is a newish technology that is a bit schizophrenic.&amp;#160; What I mean is that it is a tool that is useful to both Developers and Administrators but it is not clear from the documentation how to best use the technology and how to approach it. I believe it stated as a Server Administrator tool and the team was able to work in an integration with Visual Studio which made it into a more robust framework, but at the same time left is command line interface with so many options that it is challenging to get a grasp on.&amp;#160; To top that off the Web Platform Installer uses the MsDeploy packages as a way to distribute packages through that tool.&amp;#160; After working through some various ways to use the technology I have settled into some commands that work well for our projects. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Let me set the context of how we are using the tool and what we already had in place so that you can better understand if my use of MsDeploy will work for you. At &lt;a href="http://www.headspringsystems.com/"&gt;Headspring&lt;/a&gt; we use Continuous Integration on all of our projects and as a result, once our software is built by our build server the next logical step is to deploy our software to a server and than run User Interface tests against the application. Most of our projects are web applications running on ASP.Net MVC using Sql Server as the back end.&amp;#160; We install our software using a lightweight zipfile that contains the web application files, database migration scripts and a deployment script which can poke config files and execute our database migration tool.&amp;#160; We already have all the pieces in place to deploy our application on a local machine.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Up until know we have used two methods to deploy instances to remote machines.&amp;#160; The first methods was to install Cruise Control.Net on the server and have it monitor our source control repository for a new installation package being committed to the repository. Once it sees a new package CCNet will pull down the package, install it locally and go on its merry way.&amp;#160; The second method, is to kick off the deployment from the build server and connect over the network to the target database to run upgrades and then xcopy the files to a unc share.&amp;#160; Both of these methods require setting up some configuration on our target servers. My goal with our deployments is to reduce the amount of per server configuration we do on each server and use some conventions to make each server look similar to one from a different project.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Using MSDeploy allows us to do the following.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;1. Remove the need to install cruise control on the target server and update the configuration for cruise control on each target server.&amp;#160; We do have to install MSDeploy on each server but we do not have to mess with any configuration after that.&lt;/p&gt;    &lt;p&gt;2. We do not have to mess with setting up unc shares and deal with the mess.&amp;#160; It sounds like a silly thing but by getting away from the unc share we can also test our deployments from any machine and msdeploy is actually firewall friendly.&amp;#160; xcopy to a unc share is not firewall friendly which means that we cannot use it for all of our clients which means variations between our projects.&amp;#160; &lt;/p&gt;    &lt;p&gt;3. We use msdeploy as a mechanism to distribute our deployment packages and then remotely execute the packages.&amp;#160; This means I can have a single instance of our Continuous Integration server which reduces the number of places to maintain configuration.&amp;#160; That is a big win.&amp;#160; This also means the log files for all of the deployments can be tracked in a single place.&lt;/p&gt;    &lt;p&gt;4. Another benefit of using msdeploy to push our deployments means that I can easily setup new instances of a test configuration and push it to multiple servers without having to log into each machine.. This is good for efficiency.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt; Our use of MSDeploy now boils down to two steps.&amp;#160; Distribute and Execute.&amp;#160; We have some of our scripts in NAnt and we are in the process of migrating to PowerShell now that version 2.0 is available from the older operating systems.&amp;#160; Below is a sample of executing msdeploy from a NAnt script.&lt;/p&gt;  &lt;p&gt;Calling MsDeploy from Nant&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_4912CCA3.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_19E0E10C.png" width="1028" height="249" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;dirPath&lt;/strong&gt;&amp;#160; command tells MSDeploy to synchronize a directory from the source computer a target computer. This is a pretty easy command to understand.&lt;/p&gt;  &lt;p&gt;The second command is the &lt;strong&gt;runCommand&lt;/strong&gt; this command was added between the RC and 1.0 release of MSDeploy and I am so happy they added it. The run command is told to execute a command on the remote machine.&amp;#160; Since we are running installation scripts, they do not execute instantly and as a result the waitInterval and waitAttempts need to be specified so that the command does not timeout before it has completed running. other than that the output of the console application is piped back to the source computer.&amp;#160; The one caveat about the run command is that when it starts it runs from the C:\windows\system32 directory.&amp;#160; In order to work around this issue I have found that passing the directory of the command into the batch file that I run allows my batch files to first cd to that directory as its first step.&amp;#160; This is a pretty harmless thing to do and works pretty well.&lt;/p&gt;  &lt;p&gt;This is what a sample deployment batch files looks like.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;cd %1     &lt;br /&gt;rd ..\codeToDeploy\ /s /q      &lt;br /&gt;applicationNamePackage.exe -o..\CodeToDeploy\ -y      &lt;br /&gt;cd ..\CodeToDeploy\      &lt;br /&gt;cmd /c %systemroot%\system32\inetsrv\appcmd stop site applicationName_dev      &lt;br /&gt;iisreset      &lt;br /&gt;call dev.bat      &lt;br /&gt;cmd /c %systemroot%\system32\inetsrv\appcmd start site applicationName_dev&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is pretty basic and does some IIS commands as well.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I am sure I left some information out, but I wanted to get a brain dump of our use of MSDeploy.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Long term I would like to see the use of PowerShell driving msdeploy and adding some configuration around each Server Role in an application and tie it to the servers needed for each environment.&amp;#160; I have started a project to put this together called psTrami but I have not put any of the code together yet, just some small spikes to prove it out.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;More to come sometime soon…..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Using+MSDeploy+to+automate+your+Enterprise+Application+remote+deployments.&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f06%2fusing-msdeploy-to-automate-your-enterprise-application-remote-deployments.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f06%2fusing-msdeploy-to-automate-your-enterprise-application-remote-deployments.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=29992" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/DC5506424A84B71C0B7EC7BC3D84306E84B07D25"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/DC5506424A84B71C0B7EC7BC3D84306E84B07D25"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=_nfNP-Tnt7k:ii2ScNduSqA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=_nfNP-Tnt7k:ii2ScNduSqA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=_nfNP-Tnt7k:ii2ScNduSqA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=_nfNP-Tnt7k:ii2ScNduSqA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/_nfNP-Tnt7k" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net/default.aspx">Asp.Net</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/CC.Net/default.aspx">CC.Net</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/continous+integration/default.aspx">continous integration</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Open+Source+Software/default.aspx">Open Source Software</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/MSDeploy/default.aspx">MSDeploy</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Deployment/default.aspx">Deployment</category><feedburner:origLink>http://www.lostechies.com/blogs/hex/archive/2009/11/06/using-msdeploy-to-automate-your-enterprise-application-remote-deployments.aspx</feedburner:origLink></item><item><title>Hang in there baby birds, I'll feed you</title><link>http://feedproxy.google.com/~r/LosTechies/~3/ZMeYNL0JZPw/hang-in-there-baby-birds-i-ll-feed-you.aspx</link><pubDate>Thu, 05 Nov 2009 20:19:29 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30063</guid><dc:creator>Scott C Reynolds</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Quick housekeeping note - How We Do Things series is not cancelled, I haven't given up on it or run out of steam, it will still press forward.&lt;/p&gt;
&lt;p&gt;Trying to get a lot wrapped up both at home and at work in preparation for my move to New York, so I lapsed a bit, but I will be back on it soon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Hang+in+there+baby+birds%2c+I%27ll+feed+you&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fscottcreynolds%2farchive%2f2009%2f11%2f05%2fhang-in-there-baby-birds-i-ll-feed-you.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fscottcreynolds%2farchive%2f2009%2f11%2f05%2fhang-in-there-baby-birds-i-ll-feed-you.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30063" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/C60B4DC4580CAA86EF9DF89C3202C3EADA16C987"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/C60B4DC4580CAA86EF9DF89C3202C3EADA16C987"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=ZMeYNL0JZPw:aCLwbTtJ6MM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=ZMeYNL0JZPw:aCLwbTtJ6MM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=ZMeYNL0JZPw:aCLwbTtJ6MM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=ZMeYNL0JZPw:aCLwbTtJ6MM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/ZMeYNL0JZPw" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.lostechies.com/blogs/scottcreynolds/archive/2009/11/05/hang-in-there-baby-birds-i-ll-feed-you.aspx</feedburner:origLink></item><item><title>Automapper Auto Profile Registration.</title><link>http://feedproxy.google.com/~r/LosTechies/~3/yBJxCxOGC8Q/automapper-auto-profile-registration.aspx</link><pubDate>Thu, 05 Nov 2009 03:24:15 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30035</guid><dc:creator>erichexter</dc:creator><slash:comments>8</slash:comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;On some of our projects we have been experimenting with smaller AutoMapper profiles.&amp;#160; The idea is that it is easier to digest a smaller profile. We have gone so far as creating a profile for each Domain object and handle all of the mappings to and from the domain object.&amp;#160; We are also trying out a Profile per scenario.&amp;#160; While these smaller profiles are easier to dig in and understand, the registration of them are a little painful.&amp;#160; So I put together a quick way to auto register all the profiles for automapper.&amp;#160; Below is the code to discover all the profiles in an assembly than register them with AutoMapper.&amp;#160; There is nothing fancy here and I could certainly spend more time making it better performing, but realistically this is startup code that runs once at application start up.&amp;#160; That being said I would rather focus performance optimization efforts on places that actually make a difference to the End User Experience. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is the sample.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_1C949FF2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_344BD758.png" width="1028" height="337" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It is important to know that we have full code coverage over our application including integration tests, so that if something were to break as a result of loading this in a non deterministic order, we would know before we commit our changes to source control. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is the code for the ForEach extension method, since I breezed over it.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_322ED88F.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_3875AF1D.png" width="1028" height="169" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This is a smaller post than I normally put together.. is this small of a post useful? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=Automapper+Auto+Profile+Registration.&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f04%2fautomapper-auto-profile-registration.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f04%2fautomapper-auto-profile-registration.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30035" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/A24734D2C6556C1C07A76A0540C722C3E8017A8B"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/A24734D2C6556C1C07A76A0540C722C3E8017A8B"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=yBJxCxOGC8Q:bOnVnK1EFqc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=yBJxCxOGC8Q:bOnVnK1EFqc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=yBJxCxOGC8Q:bOnVnK1EFqc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=yBJxCxOGC8Q:bOnVnK1EFqc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/yBJxCxOGC8Q" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/hex/archive/tags/c_2300_/default.aspx">c#</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/.Net/default.aspx">.Net</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Open+Source+Software/default.aspx">Open Source Software</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/AutoMapper/default.aspx">AutoMapper</category><feedburner:origLink>http://www.lostechies.com/blogs/hex/archive/2009/11/04/automapper-auto-profile-registration.aspx</feedburner:origLink></item><item><title>A Time For Change</title><link>http://feedproxy.google.com/~r/LosTechies/~3/ke1CCcdXZDc/a-time-for-change.aspx</link><pubDate>Wed, 04 Nov 2009 15:36:03 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:30014</guid><dc:creator>derick.bailey</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;Change comes in groups of three, right? Well, I have &lt;a href="http://www.lostechies.com/blogs/derickbailey/archive/2009/10/08/the-ultimate-hello-world.aspx"&gt;a 4 week old baby girl&lt;/a&gt; (I can hardly believe she’s 4 weeks old already). That would be change #1.&amp;#160; For change #2, I turned in my two week notice to &lt;a href="http://www.mclaneat.com"&gt;my current employer&lt;/a&gt; on Monday.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derickbailey/image_5F00_32033071.png" width="180" height="37" /&gt;&lt;/p&gt;  &lt;p&gt;Starting on November 16th, I’ll be joining up with fellow LosTechie, &lt;a href="http://www.lostechies.com/blogs/joeydotnet/default.aspx"&gt;Joey Beninghove&lt;/a&gt;, over at &lt;a href="http://trackabout.com"&gt;TrackAbout.com&lt;/a&gt;.&amp;#160; I’m excited about the opportunity. There’s a great bunch of developers on that team and it should be a lot of fun and a significant challenge for me, at the same time.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now I just have to wait and see what change #3 is going to be…&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=A+Time+For+Change&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fderickbailey%2farchive%2f2009%2f11%2f04%2fa-time-for-change.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fderickbailey%2farchive%2f2009%2f11%2f04%2fa-time-for-change.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=30014" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/7ED137F862F65FC66C2A485482CA901AC9A8BC60"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/7ED137F862F65FC66C2A485482CA901AC9A8BC60"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=ke1CCcdXZDc:tE2c8IVA4_I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=ke1CCcdXZDc:tE2c8IVA4_I:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=ke1CCcdXZDc:tE2c8IVA4_I:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=ke1CCcdXZDc:tE2c8IVA4_I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/ke1CCcdXZDc" height="1" width="1"/&gt;</description><feedburner:origLink>http://www.lostechies.com/blogs/derickbailey/archive/2009/11/04/a-time-for-change.aspx</feedburner:origLink></item><item><title>ASP.Net MVC Portable Area – Part 4 IoC framework support.</title><link>http://feedproxy.google.com/~r/LosTechies/~3/PKYYqEQSLMY/asp-net-mvc-portable-area-part-4-ioc-framework-support.aspx</link><pubDate>Wed, 04 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:29898</guid><dc:creator>erichexter</dc:creator><slash:comments>10</slash:comments><description>&lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/01/asp-net-mvc-portable-areas-via-mvccontrib.aspx"&gt;Part 1 – Introduction&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/02/asp-net-mvc-portable-areas-part-2.aspx"&gt;Part 2 – Sample Portable Area&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/03/asp-net-mvc-portable-areas-part-3.aspx"&gt;Part 3 – Using of a Portable Area&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Part 4 – Using an Inversion of Control Framework.&amp;#160; (this post) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Using an Inversion of Control Container is a common scenario that would be needed by a Message Handler.&amp;#160; The Bus has an extensibility point to create the handlers. The model for this should feel similar to the ControllerFactory extension point in the ASP.Net MVC framework.&amp;#160; The sample below shows how to create a Message Handler factory for the StructureMap framework.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_600BF09E.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_2CCFB735.png" width="644" height="179" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The SetMessageHandlerFactory method should be called once at application startup.&amp;#160;&amp;#160; Other than that … this is a pretty simple way to add a Dependency Injection Framework support to the Portable Area infrastructure.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This makes it pretty simple for your message handlers to use constructor injection to manage their dependencies.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=ASP.Net+MVC+Portable+Area+%e2%80%93+Part+4+IoC+framework+support.&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f04%2fasp-net-mvc-portable-area-part-4-ioc-framework-support.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f04%2fasp-net-mvc-portable-area-part-4-ioc-framework-support.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=29898" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/1103C809368D0BC980CC4819F9CD00E0D955EC8A"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/1103C809368D0BC980CC4819F9CD00E0D955EC8A"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=PKYYqEQSLMY:b2W03fw8C3s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=PKYYqEQSLMY:b2W03fw8C3s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=PKYYqEQSLMY:b2W03fw8C3s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=PKYYqEQSLMY:b2W03fw8C3s:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/PKYYqEQSLMY" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net/default.aspx">Asp.Net</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net+MVC/default.aspx">Asp.Net MVC</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Portable+Area/default.aspx">Portable Area</category><feedburner:origLink>http://www.lostechies.com/blogs/hex/archive/2009/11/04/asp-net-mvc-portable-area-part-4-ioc-framework-support.aspx</feedburner:origLink></item><item><title>ASP.Net MVC Portable Areas – Part 3</title><link>http://feedproxy.google.com/~r/LosTechies/~3/AzYKPWLtz68/asp-net-mvc-portable-areas-part-3.aspx</link><pubDate>Tue, 03 Nov 2009 17:00:00 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:29897</guid><dc:creator>erichexter</dc:creator><slash:comments>10</slash:comments><description>&lt;h1&gt;Using a Portable Area&lt;/h1&gt;
&lt;p&gt;This is the third part in a series about using a Portable Area (PA) using MvcContrib.&amp;nbsp; This sample walks through the Host Application side of consuming the Login Portable area.&amp;nbsp; This example demonstrates how&amp;nbsp;a portable area such as a login can send messages and recieve responses from the host application.&amp;nbsp; This allows the host application to control the core of the application and lets the Portable Area solve the User Interface portion of the Login.&amp;nbsp; While this is a pretty simple example it is important to look at the concept of what a Portable Area could solve.&amp;nbsp; A portable Area could just handling wiring up multiple user interface screens and deal with simple form validation while leaving a lot of from for the host application to control the parts that are important to the application.&amp;nbsp; Or a Portable Area could provide an entire self contained piece of functionality like a Blog engine, or mulit-instance forum.&amp;nbsp; There is a large spectrum for how much the Portable Area could provide.&amp;nbsp; This example focuses on an example where the Portable Area provides the UI and lets the host application own the domain logic.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/01/asp-net-mvc-portable-areas-via-mvccontrib.aspx"&gt;Part 1 &amp;ndash; Introduction&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/02/asp-net-mvc-portable-areas-part-2.aspx"&gt;Part 2 &amp;ndash; Sample Portable Area&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Part 3 &amp;ndash; Using of a Portable Area&amp;nbsp; (this post) &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/04/asp-net-mvc-portable-area-part-4-ioc-framework-support.aspx"&gt;Part 4 &amp;ndash; Using an Inversion of Control Framework.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In order to use a Portable Area (PA), the following references need to be added to your MVC project: &lt;a target="_blank" href="http://www.mvccontrib.org"&gt;MvcContrib&lt;/a&gt; &amp;amp; the assembly of the Portable Area.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_77F3C39A.png"&gt;&lt;img height="218" width="244" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_3E70B3A3.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Wiring up the Portable Area to the application is done at startup.&amp;nbsp; Portable Areas use the message bus as a way to communicate between the PA and the application. The main method for integrating with a portable area is to register a Message Handler. The sample below demonstrates wiring up a LogAllMessagesObserver,&amp;nbsp;LoginHandler, and a ForgotPassword Handler&amp;nbsp;for the Login Portable Area.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The call to the InputBuilder.Bootstrap() is required to initialize the Embedded Resource view engine used by this Portable Area infrastructure.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_1D7D40FC.png"&gt;&lt;img height="289" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_14AD38B0.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Here is an example of an Observer message handler.&amp;nbsp; This handler simply logs the message to the debugger. This could be used to collect metrics about the system, or log messages to a loggin framework.&amp;nbsp; The idea of an observer is that it is looking at the base message and not modifying the state of the message.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_52C65361.png"&gt;&lt;img height="198" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_2AB3A442.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The Login Message Handler receives the login request and than sets the result object which is part of the contract that is specified by the LoginPortableArea from Part 2.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_02A0F523.png"&gt;&lt;img height="290" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_210B360C.png" alt="image" border="0" title="image" style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this example the main logic for login is still in a authentication service.&amp;nbsp; The handler is just used to wire up the message and response of the portable area to the host applications domain services.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Whats Next?&lt;/h2&gt;
&lt;p&gt;The constructor of the LoginHandler takes an IAuthenticationService as a dependency and my next post will walk through how an Inversion of Control container can be connected to the Bus to allow the framework of your choice to put your pieces together.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=ASP.Net+MVC+Portable+Areas+%e2%80%93+Part+3&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f03%2fasp-net-mvc-portable-areas-part-3.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f03%2fasp-net-mvc-portable-areas-part-3.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=29897" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/B9AECACB853BD52B64A39FDC28976654271C3076"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/B9AECACB853BD52B64A39FDC28976654271C3076"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=AzYKPWLtz68:bp659Roen-8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=AzYKPWLtz68:bp659Roen-8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=AzYKPWLtz68:bp659Roen-8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=AzYKPWLtz68:bp659Roen-8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/AzYKPWLtz68" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net/default.aspx">Asp.Net</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/.Net/default.aspx">.Net</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net+MVC/default.aspx">Asp.Net MVC</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Portable+Area/default.aspx">Portable Area</category><feedburner:origLink>http://www.lostechies.com/blogs/hex/archive/2009/11/03/asp-net-mvc-portable-areas-part-3.aspx</feedburner:origLink></item><item><title>ASP.Net MVC Portable Areas – Part 2</title><link>http://feedproxy.google.com/~r/LosTechies/~3/MPRIpzOSGRY/asp-net-mvc-portable-areas-part-2.aspx</link><pubDate>Mon, 02 Nov 2009 17:00:00 GMT</pubDate><guid isPermaLink="false">ded273ab-9e87-4979-8222-e4e2e46f1b46:29877</guid><dc:creator>erichexter</dc:creator><slash:comments>11</slash:comments><description>&lt;h1&gt;Sample Portable Area&lt;/h1&gt;
&lt;p&gt;This is the second part in a series about creating a Portable Area (PA) using MvcContrib&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/01/asp-net-mvc-portable-areas-via-mvccontrib.aspx"&gt;Part 1 &amp;ndash; Introduction&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Part 2 &amp;ndash; Sample Portable Area (this post)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/03/asp-net-mvc-portable-areas-part-3.aspx"&gt;Part 3 &amp;ndash; Usage of a Portable Area&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.lostechies.com/blogs/hex/archive/2009/11/04/asp-net-mvc-portable-area-part-4-ioc-framework-support.aspx"&gt;Part 4 - IoC Framework Support&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;To create a Portable Area, the first step is to create a separate class library project for the Portable Area.&amp;nbsp; The output assembly is the single file needed to add this functionality to applications which wish to consumer it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;The minimal references required for the Portable Area are shown below: &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_39B36C13.png"&gt;&lt;img height="393" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_7C43078B.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;While DataAnnotations is not required to build a PA, using DataAnnotations for Model validation makes distribution of the PA very easy, since the MVC2 DefaultModelBinder supports the DataAnnotations validation out of the box. &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;If you choose a different validation framework than you would need to distribute those assemblies or possible IL Merge them into your PA.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;The sample PA in the MvcContrib project is a Login Portable Area, this is a pretty simple example, but demonstrates how a PA and application can integrate.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;This is also a piece of functionality that most applications need.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;Below is the code listing and structure for the project.&amp;nbsp; It looks identical to a mulit-project ASP.Net MVC Area.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_27A72886.png"&gt;&lt;img height="385" width="318" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_0000AC5C.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;The first difference between creating a Portable Area and a standard area from the files perspective is how the Views are registered with the project. The views Build Action should be changed from content to an &lt;a href="http://msdn.microsoft.com/en-us/library/0c6xyb66.aspx"&gt;&lt;span style="color: #669966; mso-bidi-font-size: 11.0pt;"&gt;Embedded Resource&lt;/span&gt;&lt;/a&gt;. This allows the views to be embedded into the output assembly so that they view folders and files to not have to be manually copied into each application that uses it.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;Instead a special view engine will pull these views out of the assembly at run time and render them the same way that a physical view would be rendered.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_585A3031.png"&gt;&lt;img height="365" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_7E4FE087.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;The second item that is needed to create a Portable Area is a specialized registration class for the that inherits from PortableAreaRegistration. This class provides an extended RegisterArea method that sends in the MVC AreaRegistrationContext and a IApplicationBus object to the method.&amp;nbsp; The IApplicationBus &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;is the mechanism&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;that a Portable Area uses to send messages to the hosting application during. &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;The use of the bus during registration is not required, but it is available in case and specific start up logic is needed to correctly configure the Portable Area. &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;The last line of the method show how the Portable Area registers the embedded views with the view engine, using the call to the RegisterTheViewsInTheEmmeddedViewEngine method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;An important caveat around the setup of the Registration class is to make sure that the Registration class is sitting in the same Namespace as the controllers and views.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;If the Namespaces do not match the views will not be able to be located. &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;Since the namespace for the Embedded Resource views cannot be specified declaratively they are created using the Assemblies Default Namespace and the folder structure that they are stored in.&amp;nbsp; So keeping all of these properties consistent will make everything work.&amp;nbsp; If you change the default namespace of the project, you will need to update the namespace of your registration and controller classes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_0998F4C5.png"&gt;&lt;img height="398" width="1028" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_68394F28.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;The first call in this registration method sends a message to the hosting application.&amp;nbsp; This is a contrived example but it demonstrates sending a tracing message that can be used by an observer message handler to log the registration activity.&amp;nbsp; This tracing can be useful since the Portable Areas use the built in MVC registration mechanism for auto discovery and there is not a lot of visibility into the built in registration process. This example shows how a message can be sent between the PA and the hosting application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_10F4B472.png"&gt;&lt;img height="335" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_2C2D0D73.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;The LoginController demonstrates the functionality needed to handle displaying the login form and then handling the form post. There are two Actions in the controller, one to render a Login View and a second Action to process the form post and redirect the user on success or , in the case of a login failure, display the login error messages to the user.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_35A5CBE9.png"&gt;&lt;img height="428" width="1028" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_2937A8C0.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;The message bus is the main mechanism for communicating between a portable area and the hosting application.&amp;nbsp;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;This is a very simplistic mechanism that allows the Portable Areas to communicate with the hosting application in a synchronous manner. &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;For some scenarios, like when the area should not implement its own database, the host application can own how the domain model is persisted in data storage and the Portable Area can worry about handling the multi-page user interface and other user interface concerns like validating simple data types.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;The messages that are passed to the Bus are shown below.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_38F73DC4.png"&gt;&lt;img height="172" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_29E05EEA.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;The LoginInput represents the data that is collected from the Login screen. It is using the built in &lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;DataAnnotations attributes to handle the simple validation rules.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_7DC361F8.png"&gt;&lt;img height="220" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_484A9FD3.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 115%; font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;The result object is used to determine if the credentials were valid for the host application and are then used to either display the error message or redirect to a protected page. Since the LoginInputMessage is passed to the bus with a reference, the handlers in the host application can change the Result object's state and the portable area can than access the Result and determine the correct logic to perform given that result.&amp;nbsp; The implementation for the handlers will be in the next post in this series.&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_7C129624.png"&gt;&lt;img height="253" width="644" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_22747970.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family: 'Trebuchet MS','sans-serif'; font-size: 10.5pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';"&gt;The Index view for the login uses the MvcContrib Input Builders to render a standard form to the page.&amp;nbsp; The use of the Input Builder allows an host application to override any of the html mark up using the Input Builder partials.&amp;nbsp; This means that the Portable Area and Input Builders play very nicely with each other.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_4C0844A3.png"&gt;&lt;img height="203" width="1028" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_51E2E83C.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This is what the view looks like in a browser.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_4912DFF0.png"&gt;&lt;img height="772" width="899" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_072BFAA2.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This is the validation errors that are handled by the Portable Area, using the MVC 2 default model binder.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_0A7D6C7D.png"&gt;&lt;img height="772" width="899" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_1D51F027.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This shows an error message that is passed back from the resulting application. Other rules could be applied as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_2B60B957.png"&gt;&lt;img height="772" width="899" src="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/hex/image_5F00_thumb_5F00_57310D46.png" alt="image" border="0" title="image" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is the approach for creating a Portable Area (PA) using the MvcContrib Portable Area feature.&amp;nbsp; Let me know what you think about this approach, we tried to stay with the simplest approach that could possible work, and focused on making it easy to both develop and consume the Portable Areas.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please leave your comments on what you think of the approach.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;a href="http://www.dotnetkicks.com/kick/?title=ASP.Net+MVC+Portable+Areas+%e2%80%93+Part+2&amp;url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f02%2fasp-net-mvc-portable-areas-part-2.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.lostechies.com%2fblogs%2fhex%2farchive%2f2009%2f11%2f02%2fasp-net-mvc-portable-areas-part-2.aspx" border="0" alt="Kick It on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;img src="http://www.lostechies.com/aggbug.aspx?PostID=29877" width="1" height="1"&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/LOSTECHIES/EFD08A5F402C1ED2C296157DD3226C2D802F5AAA"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/LOSTECHIES/EFD08A5F402C1ED2C296157DD3226C2D802F5AAA"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=MPRIpzOSGRY:4CsHAgBUG7Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=MPRIpzOSGRY:4CsHAgBUG7Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?i=MPRIpzOSGRY:4CsHAgBUG7Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/LosTechies?a=MPRIpzOSGRY:4CsHAgBUG7Q:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/LosTechies?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LosTechies/~4/MPRIpzOSGRY" height="1" width="1"/&gt;</description><category domain="http://www.lostechies.com/blogs/hex/archive/tags/mvc/default.aspx">mvc</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/mvccontrib/default.aspx">mvccontrib</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net/default.aspx">Asp.Net</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/.Net/default.aspx">.Net</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Asp.Net+MVC/default.aspx">Asp.Net MVC</category><category domain="http://www.lostechies.com/blogs/hex/archive/tags/Portable+Area/default.aspx">Portable Area</category><feedburner:origLink>http://www.lostechies.com/blogs/hex/archive/2009/11/02/asp-net-mvc-portable-areas-part-2.aspx</feedburner:origLink></item></channel></rss>
