<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Developing UX</title>
	<atom:link href="http://developingux.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://developingux.com</link>
	<description>Caleb Jenkins on Silverlight &#124; .NET &#124; Design &#124; Development &#124; Architecture &#124; Community</description>
	<lastBuildDate>Thu, 11 Mar 2010 00:45:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		
	<item>
		<title>Practice Software Patterns &#8211; Component Patterns</title>
		<link>http://developingux.com/2010/03/10/practice-software-patterns/</link>
		<comments>http://developingux.com/2010/03/10/practice-software-patterns/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 23:46:39 +0000</pubDate>
		<dc:creator>Caleb Jenkins</dc:creator>
				<category><![CDATA[10 Developement Practices]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[10-practices]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[software patterns]]></category>

		<guid isPermaLink="false">http://developingux.com/?p=917</guid>
		<description><![CDATA[
			
				
			
		This post is the 6th in a series that started with the 10 practices that every developer needs to start right now
 The first time that someone taught me about Software Design Patterns it went something like this:

Them: “… and so that is the pattern.” 
Me: “That’s it” 
Them: “Well, yeah.” 
Me: “But that’s how I’ve always [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; z-order:25;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F03%2F10%2Fpractice-software-patterns%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F03%2F10%2Fpractice-software-patterns%2F&amp;source=calebjenkins&amp;style=normal" height="61" width="50" />
			</a>
		</div><p>This post is the 6th in a <a href="http://developingux.com/topic/10-developement-practices/">series</a> that started with the <a href="http://developingux.com/2010/01/06/10-practices-every-developer-needs-right-now/">10 practices that every developer needs to start right now</a></p>
<p><a href="http://developingux.com/wp-content/uploads/2010/03/image.png"><img style="border-right-width: 0px; margin: 0px auto 10px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/03/image_thumb.png" border="0" alt="image" width="534" height="268" /></a> The first time that someone taught me about Software Design Patterns it went something like this:</p>
<ul style="list-style-type: none">
<li>Them: “… and so that is the pattern.” </li>
<li>Me: “That’s it” </li>
<li>Them: “Well, yeah.” </li>
<li>Me: “But that’s how I’ve always done that.” </li>
<li>Them: “Well, then you’ve always been following that pattern” </li>
</ul>
<p>I find that is how a lot of people react when they first learn about patterns. “So a pattern is just giving a name to good software development” Well, yes and no. On the one hand – yes, a <strong>software pattern is recognizing common software challenges and the approaches that have worked in the past to over come those challenges</strong> – and naming it. On the other hand, don’t underestimate the power of giving something a name.</p>
<p><span id="more-917"></span></p>
<h3>Vocabulary</h3>
<p>There is power in a common vocabulary. Think about it, every profession has one. From the dentist that cleans your teeth to the short order cook at Denny’s; from the mechanic that works on your car to the contractor that built your house. Every profession has it’s own vocabulary that gives people a fast and efficient way to communicate.</p>
<p>So that instead of taking time to walk through all of the details of your architecture and application design, you can have a conversation that goes something like this “We’re writing a facade layer here, and utilizing a DI container to act as our Abstract Factory, accessing our persistence layer with a repository pattern utilizing Interception for logging and MVVM to composite all of our UI.”</p>
<p>OK, so I know that there were a lot of buzz words thrown in there, but I hope you’re getting the point &#8211; a lot can be communicated in a couple of sentences.</p>
<h3>Patterns</h3>
<p>Let’s face it – there is more to learn than any of us has time for. Patterns are like that. There’s a pattern for everything &#8211; like a bad Apple commercial, there’s a <em>pattern</em> for that. The important part is not learning every pattern under the sun – but learning the common patterns for the common challenges is where you’ll get the most bang for your buck.</p>
<h4>Component Patterns</h4>
<p>Strategy | Factory | Abstract Factory – all related.</p>
<p><strong>Factory.</strong> The goal of a factory pattern is to conceal the creation of an object from the consumers of the object. This is especially important for complex objects that take a lot of dependencies or configurations when you create them. Instead of repeating the set up code through out your application you move it to one place (the factory) and then call that from your code.</p>
<p><strong>take this (slightly contrived) code example…</strong></p>
<p><code> </code></p>
<p><code> </code></p>
<p><code> </code></p>
<p> </p>
<p><code> </code></p>
<p><code>
<pre><pre class="brush: csharp;">
            SqlCommand cmd = new SqlCommand();

            SqlParameter parm1 = new SqlParameter();
            parm1.Direction = ParameterDirection.Input;
            parm1.ParameterName = &amp;amp;amp;amp;amp;quot;Id&amp;amp;amp;amp;amp;quot;;
            parm1.Value = 5;
            cmd.Parameters.Add(parm1);

            SqlParameter parm2 = new SqlParameter();
            parm2.Direction = ParameterDirection.Input;
            parm2.ParameterName = &amp;amp;amp;amp;amp;quot;State&amp;amp;amp;amp;amp;quot;;
            parm2.Value = &amp;amp;amp;amp;amp;quot;TX&amp;amp;amp;amp;amp;quot;;
            cmd.Parameters.Add(parm2);

            // etc...
       </pre></pre>
<p> </code></p>
<p><code> </code></p>
<p> </p>
<p><code> </code></p>
<p><code> </code></p>
<p>It would be much nicer to implement a reusable method as so&#8230;</p>
<p><code> </code></p>
<p><code> </code></p>
<p> </p>
<p><code> </code></p>
<p><code>
<pre><pre class="brush: csharp;">
      SqlCommand cmd = new SqlCommand();
            cmd.Parameters.Add(getInParm(&amp;amp;amp;amp;amp;quot;Id&amp;amp;amp;amp;amp;quot;, 5));
            cmd.Parameters.Add(getInParm(&amp;amp;amp;amp;amp;quot;State&amp;amp;amp;amp;amp;quot;, &amp;amp;amp;amp;amp;quot;TX&amp;amp;amp;amp;amp;quot;));

            // etc...
        }

        SqlParameter getInParm(string name, object value)
        {
            SqlParameter parm = new SqlParameter();
            parm.Direction = ParameterDirection.Input;
            parm.ParameterName = name;
            parm.Value = value;
            return parm;
        }

       </pre></pre>
<p> </code></p>
<p><code> </code></p>
<p> </p>
<p><code> </code></p>
<p><code> </code></p>
<p>This probably seems like an obvious and simple example (because it is), but the point is that not all patterns are ground breaking or earth shattering, just simple approaches to make your code more usable, maintainable and testable.</p>
<p><strong>Abstract Factory.</strong> If you set up your factory to return an Interface instead of a concrete class then it is an abstract factory. This is especially useful when you want to return different implementations in different scenarios. For example, you might have an IDataLayer and in some cases you want to return a fake version for testing, or perhaps you need a local storage version for offline scenarios etc.. moving the creation of your data layer, it’s configuration and set up to a factory would make a lot of sense. By the way, this is also a text book definition of Object Oriented Polymorphism – the same interface with different behaviors with various implementations. And that brings us to the Strategy Pattern.</p>
<p>Take our example above, if we were to move that bit of code in to a shared data access helper class, we might want to consider a more generic approach.</p>
<p><code> </code></p>
<p><code> </code></p>
<p> </p>
<p><code> </code></p>
<p><code>
<pre><pre class="brush: csharp;">
      IDbDataParameter getInParm(string name, object value)
       </pre></pre>
<pre> </pre>
<p> </code></p>
<p><code> </code></p>
<p> </p>
<p><code> </code></p>
<p><code> </code></p>
<p><strong>Strategy Pattern.</strong> The original goal of the strategy pattern was the grouping various algorithms in to common interfaces. So, for example, working with <a href="http://en.wikipedia.org/wiki/Data_Encryption_Standard">DES</a>, <a href="http://en.wikipedia.org/wiki/Triple_DES">Triple DES</a> or <a href="http://en.wikipedia.org/wiki/Blowfish_(cipher)">Blowfish</a> encryption shouldn’t be any different than driving a V8 is different from driving a 4 cylinder car – what’s under the hood (the implementation) doesn’t matter as long as you know hot to use the steering wheel and pedals (Interface). No code examples here. Go take a look at encryption in .NET, or the common approaches that ADO uses for data access. Also, hang on, we’ll go in deeper to code examples in just a bit when we talk about composition over inheritance (which is closely related to Strategy Pattern)</p>
<p><strong>Up next:</strong> UI Patterns for Testability, Maintainability and Extensibility!</p>
<p>(Followed by Composition over Inheritance)</p>
<h4><span style="font-size: xx-small;">Images Credit: </span><a href="http://www.flickr.com/photos/webtreatsetc/4229661317/sizes/o/"><span style="font-size: xx-small;">http://www.flickr.com/photos/webtreatsetc/4229661317/sizes/o/</span></a></h4>
]]></content:encoded>
			<wfw:commentRss>http://developingux.com/2010/03/10/practice-software-patterns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lessons learned from speaking at the North Dallas .NET Users Group</title>
		<link>http://developingux.com/2010/03/04/lessons-learned-from-north-dallas-net-users-group/</link>
		<comments>http://developingux.com/2010/03/04/lessons-learned-from-north-dallas-net-users-group/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 18:53:03 +0000</pubDate>
		<dc:creator>Caleb Jenkins</dc:creator>
				<category><![CDATA[INETA]]></category>
		<category><![CDATA[Speaking]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Family]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[nddnug]]></category>

		<guid isPermaLink="false">http://developingux.com/?p=898</guid>
		<description><![CDATA[
			
				
			
		
Bring your A game, do your best, leave it all on the field. That’s how I roll… until last night. Last night I presented on MVVM in Silverlight at the North Dallas .NET Users Group. It was a great turn out with a lot of interaction and excellent questions. Huge thanks to the organizers for [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; z-order:25;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F03%2F04%2Flessons-learned-from-north-dallas-net-users-group%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F03%2F04%2Flessons-learned-from-north-dallas-net-users-group%2F&amp;source=calebjenkins&amp;style=normal" height="61" width="50" />
			</a>
		</div><p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="nddnug" src="http://developingux.com/wp-content/uploads/2010/03/nddnug.gif" border="0" alt="nddnug" width="295" height="103" /></p>
<p><em>Bring your A game</em>, do your best, leave it all on the field. That’s how I roll… until last night. Last night I presented on MVVM in Silverlight at the <a href="http://northdallas.net/">North Dallas .NET Users Group</a>. It was a great turn out with a lot of interaction and excellent questions. Huge thanks to the organizers for having me, and to every one that turned out for it!</p>
<p>OK, I learned two big lessons last night. First, don’t prep your demo’s with a source control system that you are not 100% comfortable with yet.. second, don’t keep your speaking engagements when you’ve been taking care of sick people all week.</p>
<p><span id="more-898"></span></p>
<h3>Don’t get sick</h3>
<p>This week, my family got hit bad with <a href="http://en.wikipedia.org/wiki/Rotavirus">Rotavirus</a>. I’m not going to sugar coat it, this was a bad week in the Jenkins home. We had to deal with this bug once before when our oldest son was a baby… it was bad then, now times that by five. My wife, son, and 3 daughters have had a rough week to put it mildly. Fortunately, I work for a <a href="http://developingux.com/2009/07/21/improving-elsewhere/">great company</a> that let me work from home this week so that I could help take care of them. I’m also fortunate that I’ve been fine this whole week… until last night.</p>
<p>Right in the middle of my talk it hit me, whoa.. light headed… oh no, I might need that trash can… ugh. I’ve never gotten sick in the middle of a talk before – not fun.</p>
<p>Fortunately I was able to take a 5 minute break, get some fresh air, and then finish my talk. I came home with a fever and have been laying in bed since. I’m grateful for the <a href="https://www.advocare.com/08121113/Products/default.aspx">awesome vitamins</a> that we take (especially the <a href="https://www.advocare.com/08121113/Store/ItemDetail.aspx?itemCode=W3812&amp;id=D">pro-biotics</a>) because here I am &#8211; just over 12 hours later – feeling much better.</p>
<p>The last time that I was scheduled to speak at the NDDNUG I got a chest cold leading up to it, fortunately my friend <a href="http://nomadic-developer.com/">Aaron Erickson</a> was in town and filled in with a great talk on Dynamic Languages and the DLR. <strong>Note to self: If you could be sick </strong>(it’s hard because I really don’t get sick that often) <strong>find a replacement presenter. </strong></p>
<h3>Using GIT</h3>
<p>It’s all <a href="http://blog.davidohara.net/">David’s</a> fault. <img src='http://developingux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Well, Dave and TekPub.    <br />My friend Dave (<a href="http://twitter.com/davidmohara">@davidmohara</a>) is constantly pulling out and showing off the cool shiny toys. He’s the one that got me to start using <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX/">CodeRush</a> (no seriously, he’s a CodeRush ninja), he’s the one that got me to look at ASP.NET MVC completely differently, and then recently he’s become the unofficial GIT guide to several of us at the <a href="http://developingux.com/2010/02/21/microsoft-mvp-summit-2010/">MVP Summit</a>. So, Dave, combined with a 1 month subscription to <a href="http://www.tekpub.com/">TekPub</a> that I won at the last <a href="http://www.c4mvc.net/">Community for MVC.NET</a> group got me interested in using GIT.</p>
<p>By the way… TekPub is awesome, I’ll talk more about them for another time, for now, go check out the <a href="http://www.tekpub.com/preview/git">preview to using GIT</a>.</p>
<p>The nice thing about <a href="http://git-scm.com/">GIT</a> is that you can quickly and easily create local branches and commits without standing up a server anywhere. It sounded like a great way to fork out my demos so that I could work in a single directly and just take snapshots (branches) along the way while I was prepping the talk. I still think I’ll end up using GIT for that, but last night in the middle of my talk I couldn’t remember how to roll back changes to one branch in order to switch to a different branch. You can’t leave a branch that has uncommitted changes, you either have to commit them or roll out of them. For anyone interested – the command that I was looking for was <strong>“<a href="http://www.kernel.org/pub/software/scm/git/docs/git-reset.html">git reset –hard [name of branch]</a></strong><strong>”</strong> – would have come in handy last night. <img src='http://developingux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So my own stumbling over git combined with a mid-talk fever made for an interesting night! Again, a big thanks to the organizers and attendees, and my  apologies for giving you my <em>C game</em>.</p>
<p>Hopefully, Lesson learned.</p>
]]></content:encoded>
			<wfw:commentRss>http://developingux.com/2010/03/04/lessons-learned-from-north-dallas-net-users-group/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Speaking in March</title>
		<link>http://developingux.com/2010/02/27/speaking-in-march/</link>
		<comments>http://developingux.com/2010/02/27/speaking-in-march/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 17:12:11 +0000</pubDate>
		<dc:creator>Caleb Jenkins</dc:creator>
				<category><![CDATA[CommunityCast Events]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Leadership]]></category>
		<category><![CDATA[Speaking]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[dallas]]></category>
		<category><![CDATA[dfw]]></category>
		<category><![CDATA[DI]]></category>
		<category><![CDATA[INETA]]></category>
		<category><![CDATA[nddnug]]></category>
		<category><![CDATA[presenter]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://developingux.com/?p=892</guid>
		<description><![CDATA[
			
				
			
		This is just a quick note that I’ll be presenting at two different events in the DFW area this month. Hope you can make it!

North Dallas .NET Users Group – March 3rd
First, Wednesday March 3rd, I’ll be at the North Dallas .NET Users Group talking about Model View View-Models (MVVM) for your Silverlight Applications. If [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; z-order:25;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F27%2Fspeaking-in-march%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F27%2Fspeaking-in-march%2F&amp;source=calebjenkins&amp;style=normal" height="61" width="50" />
			</a>
		</div><p>This is just a quick note that I’ll be presenting at two different events in the DFW area this month. Hope you can make it!</p>
<p><a href="http://nddnug.net/"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image23.png" border="0" alt="image" width="525" height="394" /></a></p>
<h3>North Dallas .NET Users Group – March 3rd</h3>
<p>First, Wednesday March 3rd, I’ll be at the <a href="http://nddnug.net/">North Dallas .NET Users Group</a> talking about Model View View-Models (MVVM) for your Silverlight Applications. If you’ve ever seen my <a href="http://developingux.com/2008/12/18/dependency-injection-with-silverlight/">Dependency Injection for Silverlight</a> talk, this is pretty much the follow up to that. (above is a snapshot from the <a href="http://nddnug.net/videos/caleb-jenkins-silverlight-2/">last time</a> that I spoke there.)</p>
<h3>Technically Speaking DFW – March 27</h3>
<p>Have you ever wanted to be a <a href="http://technicallyspeaking.dfwnav.com/">technical presenter</a>, but you weren&#8217;t sure how to get started? Or do you want to take your technical presentation skills to the “next level”? This this is the event for you! I love the idea of events like this, and I was honored to be invited to participate. Maybe this will spark more interest in groups like <a href="http://presentermentor.org/">Presenter Mentor</a>?</p>
<p><a href="http://twitter.com/t_burger">Teresa Burger</a>, awesome community member and talented developer over at <a href="http://www.woot.com/">Woot!</a> is organizing this event. It’s $50 to attend, includes lunch, and is a full day of <a href="http://mindimensions.ideamappingsuccess.com/IdeaMappingBlogs/about/">Dave Gunby</a>, Microsoft’s <a href="http://chriskoenig.net/">Chris Koenig</a>, MVP extraordinaire <a href="http://timrayburn.net/">Tim Rayburn</a> and also <a href="http://developingux.com/about">yours truly</a>.</p>
<p align="center"><a href="http://mindimensions.ideamappingsuccess.com/IdeaMappingBlogs/about/"><img style="margin: 0px 5px 0px 0px" src="http://technicallyspeaking.dfwnav.com/images/DaveGunby.png" alt="Dave Gunby" width="100" height="140" /></a><a href="http://chriskoenig.net/"><img style="margin: 0px 5px 0px 0px" src="http://technicallyspeaking.dfwnav.com/images/ChrisKoenig.jpg" alt="Chris Koenig" width="105" height="140" /></a><a href="http://developingux.com"><img style="margin: 0px 5px 0px 0px" src="http://technicallyspeaking.dfwnav.com/images/calebjenkins_profile_crop.png" alt="Caleb Jenkins" width="143" height="140" /></a><a href="http://timrayburn.net/"><img style="margin: 0px" src="http://timrayburn.net/TimRayburn-Web.png" alt="" width="106" height="140" /></a></p>
<h3>Register for both!</h3>
<ul>
<li><a href="http://nddnug.net/">Register for the North Dallas DNUG</a> – Wednesday March 3rd (Free)</li>
<li><a href="http://technicallyspeaking.dfwnav.com/">Register for Technically Speaking DFW</a> – Saturday March 27 ($50)</li>
</ul>
<p>Yep, this is going to be a fun month! Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://developingux.com/2010/02/27/speaking-in-march/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Thinking about games&#8230;</title>
		<link>http://developingux.com/2010/02/25/game-theory-application-design/</link>
		<comments>http://developingux.com/2010/02/25/game-theory-application-design/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 15:40:54 +0000</pubDate>
		<dc:creator>Caleb Jenkins</dc:creator>
				<category><![CDATA[CommunityCast Events]]></category>
		<category><![CDATA[Design and UX]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[gametheory]]></category>
		<category><![CDATA[innovation]]></category>
		<category><![CDATA[jesseschell]]></category>
		<category><![CDATA[stephenanderson]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://developingux.com/?p=886</guid>
		<description><![CDATA[
			
				
			
		Stephen was the first person that really got me to think about game theory as it relates to general application design. Then my friends at Improving Enterprises introduced me to Luke Hohmann and his Innovation Games approach to product management and games like “buy a feature”. I’m certain that their is much more work that [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; z-order:25;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F25%2Fgame-theory-application-design%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F25%2Fgame-theory-application-design%2F&amp;source=calebjenkins&amp;style=normal" height="61" width="50" />
			</a>
		</div><p><a href="http://www.poetpainter.com/">Stephen</a> was the first person that <a href="http://www.slideshare.net/stephenpa/seductive-interactions-idea-09-version">really</a> got me to think about game theory as it relates to general application design. Then my <a href="http://www.tmgirvin.com/">friends</a> at <a href="http://improvingenterprises.com/">Improving Enterprises</a> introduced me to <a href="http://innovationgames.com/about/team/luke-hohmann/">Luke Hohmann</a> and his <a href="http://innovationgames.com/">Innovation Games</a> approach to product management and games like “<a href="http://buyafeature.com/">buy a feature</a>”. I’m certain that their is much more work that needs to be done in this field. Think about it. Game theory flips “traditional” usability on it heels. <strong>Every application that I’ve ever worked on “easy to use” was one of the requirements. In games, “too easy” is a negative.</strong> Challenging, engaging, rewarding and FUN are the goals the rule the day. This <a href="http://g4tv.com/videos/44277/DICE-2010-Design-Outside-the-Box-Presentation/">talk</a> by Jesse Schell really drove this point home for me.</p>
<p><object id="VideoPlayerLg44277" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="418" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="src" value="http://g4tv.com/lv3/44277" /><param name="name" value="VideoPlayer" /><param name="allowfullscreen" value="true" /><embed id="VideoPlayerLg44277" type="application/x-shockwave-flash" width="480" height="418" src="http://g4tv.com/lv3/44277" name="VideoPlayer" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
<blockquote><p>Carnegie Mellon University Professor, Jesse Schell, dives into a world of game development which will emerge from the popular &#8220;Facebook Games&#8221; era.</p>
</blockquote>
<p>- Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://developingux.com/2010/02/25/game-theory-application-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft MVP Summit &#8211; 2010</title>
		<link>http://developingux.com/2010/02/21/microsoft-mvp-summit-2010/</link>
		<comments>http://developingux.com/2010/02/21/microsoft-mvp-summit-2010/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 05:02:28 +0000</pubDate>
		<dc:creator>Caleb Jenkins</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Speaking]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[mvp]]></category>
		<category><![CDATA[mvpsummit]]></category>
		<category><![CDATA[seattle]]></category>

		<guid isPermaLink="false">http://developingux.com/?p=873</guid>
		<description><![CDATA[
			
				
			
		
Last week I had the privilege of attending Microsoft’s Global MVP Summit in Bellevue Washington. While I can’t talk about most of what was covered (NDA) I wanted to mention two projects that I learned about while there and mention some of my thoughts from the event.

First, check out these two Silverlight projects on Codeplex.


The [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; z-order:25;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F21%2Fmicrosoft-mvp-summit-2010%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F21%2Fmicrosoft-mvp-summit-2010%2F&amp;source=calebjenkins&amp;style=normal" height="61" width="50" />
			</a>
		</div><p><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image21.png" border="0" alt="image" width="535" height="318" /></p>
<p>Last week I had the privilege of attending Microsoft’s <a href="http://www.mvpsummit2010.com/">Global MVP Summit</a> in Bellevue Washington. While I can’t talk about most of what was covered (<a href="http://en.wikipedia.org/wiki/Non-disclosure_agreement">NDA</a>) I wanted to mention two projects that I learned about while there and mention some of my thoughts from the event.</p>
<p><span id="more-873"></span></p>
<p>First, check out these two <a href="http://silverlight.net/">Silverlight</a> projects on <a href="https://www.codeplex.com/">Codeplex</a>.</p>
<ul>
<li>
<p>The <a href="http://silverlighthvp.codeplex.com/">Silverlight Hyper Video Player</a> <br />On Thursday, <a href="http://blogs.silverlight.net/blogs/jesseliberty/">Jessie Liberty</a> presented on this <a href="http://silverlighthvp.codeplex.com/">project</a> that he’s been leading. I actually got to see a preview of this project last year with one of the developers, but they weren’t sure back then if they were going to be able to release this project as <a href="http://en.wikipedia.org/wiki/Open_source_software">OSS</a> or not. Glad to see that it was! Go check out the project, it’s a great Silverlight project demonstrating <a href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a> in Silverlight as well as using the new features of <a href="http://www.codeplex.com/MEF">MEF</a> for <a href="http://en.wikipedia.org/wiki/Object_composition">composition</a> that are built in <a href="http://silverlight.net/getstarted/silverlight-4-beta/">Silverlight 4</a>.</p>
</li>
<li>The <a href="http://silverlightugstarter.codeplex.com/">Silverlight User Group Website Starter Kit</a> <br />A friend of mine, <a href="http://www.community-credit.com/AboutUs.aspx">David Silverlight</a>, brought this <a href="http://silverlightugstarter.codeplex.com/">project</a> to my attention. I love this idea! He and a talented group of developers and designers are working on this project to give user groups a great starting point and some excellent features to leverage. I’ve actually been added to <a href="http://silverlightugstarter.codeplex.com/team/view">the team</a> and hope that I’ll be able to provide add to the final result!</li>
</ul>
<h3><img style="border-bottom: 0px; border-left: 0px; margin: 0px 15px 5px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image22.png" border="0" alt="image" width="223" height="308" align="left" />Final thoughts</h3>
<p>There are multiple reasons that Microsoft organizes and hosts the MVP Summit. Part of it is developer satisfaction and to show appreciation for the work that MVP’s do around the world. MVP’s attend to gain insights in to Microsoft’s direction, network with product teams and gain a deeper understanding of the products that they work with day in and day out.</p>
<p>The last reason that I want to mention is to give the MVP’s a chance to provide input back in to the products that Microsoft is building, to be able to tell the product teams what they are doing right, what they are doing wrong, and help prioritize the features that the product teams should be working on.</p>
<p>This was my fourth Summit to attend, and <strong>the first time that I really saw this last point taken to heart</strong> across the board from multiple teams. I was really excited by the feedback that the product teams were actively soliciting from the MVP’s. I consistently saw and participated in agile techniques like <a href="http://en.wikipedia.org/wiki/Dotmocracy">dot voting</a> and <a href="http://buyafeature.com/">buy a feature</a> around broad functionality, specific features and general direction for the product teams. It was very refreshing and opened up a ton of conversations that probably wouldn’t have happened otherwise. Thanks Microsoft!</p>
<p> </p>
<p><span style="font-size: xx-small;">Microsoft Campus Photo Credit: </span><a href="http://denisgobo.blogspot.com/2010/02/recap-of-mvp-summit-2010.html"><span style="font-size: xx-small;">Denis Gobo</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://developingux.com/2010/02/21/microsoft-mvp-summit-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Secure Coding 101</title>
		<link>http://developingux.com/2010/02/10/secure-coding-101/</link>
		<comments>http://developingux.com/2010/02/10/secure-coding-101/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 06:21:27 +0000</pubDate>
		<dc:creator>Caleb Jenkins</dc:creator>
				<category><![CDATA[10 Developement Practices]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[developer practices]]></category>
		<category><![CDATA[secure coding]]></category>

		<guid isPermaLink="false">http://developingux.com/?p=827</guid>
		<description><![CDATA[
			
				
			
		This post is the 5th in a series that started with the 10 practices that every developer needs to start right now  When writing software, we often don’t think about the security implications of our actions. Probably because we write software to do something, we’re not always aware of what it shouldn’t do. Their [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; z-order:25;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F10%2Fsecure-coding-101%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F10%2Fsecure-coding-101%2F&amp;source=calebjenkins&amp;style=normal" height="61" width="50" />
			</a>
		</div><p>This post is the 5th in a <a href="http://developingux.com/topic/10-developement-practices/">series</a> that started with the <a href="http://developingux.com/2010/01/06/10-practices-every-developer-needs-right-now/">10 practices that every developer needs to start right now</a></p> <p><a href="http://developingux.com/wp-content/uploads/2010/02/image10.png"><img style="border-right-width: 0px; margin: 0px auto 10px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb5.png" border="0" alt="image" width="527" height="243" /></a> When writing software, we often don’t think about the security implications of our actions. Probably because we write software to <em>do something</em>, we’re not always aware of what it <em>shouldn’t do</em>. Their are a lot of guidelines for writing secure code, and designing secure systems. Rather than going in to all of the areas, let me just hit on some of the especially important topics that I’ve come across…</p> <p><span id="more-827"></span></p> <p>In addition to this post, I’ve included a slide deck that I use when I give talks about writing secure code. A lot of the original slides I got from a talk that <a href="http://ronjacobs.com/">Ron Jacobs</a> did at TechEd. I hope you enjoy both!</p> <div id="__ss_3128295" style="text-align: center; width: 512px; height: 414px;"><a style="margin: 12px 0px 3px; display: block; font: 14px helvetica,arial,sans-serif; text-decoration: underline" title="Threat Modeling - Writing Secure Code" href="http://www.slideshare.net/calebjenkins/threat-modeling-writing-secure-code">Threat Modeling - Writing Secure Code</a><object style="margin:0px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=threatmodeling-100210175558-phpapp02&amp;stripped_title=threat-modeling-writing-secure-code" /><param name="allowfullscreen" value="true" /><embed style="margin:0px" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=threatmodeling-100210175558-phpapp02&amp;stripped_title=threat-modeling-writing-secure-code" allowscriptaccess="always" allowfullscreen="true"></embed></object><br /> <div style="font-family: tahoma,arial; height: 26px; font-size: 11px; padding-top: 2px;">View more <a style="text-decoration: underline" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration: underline" href="http://www.slideshare.net/calebjenkins">Caleb Jenkins</a>.</div> <p> </p></div> <h3>Buffer Overflows and Overruns</h3> <p>OK… so I’m mostly going to deal with issues that affect .NET developers. .NET prevents <a href="http://en.wikipedia.org/wiki/Buffer_overrun">Buffer overflows</a> by not giving your code direct access to memory addresses and instead by managing memory access for you and by making sure that everything is type safe.</p> <p>Here’s my non-technical version of what a Buffer Overflow is. First, a Buffer overflow is something that affects unmanaged code (or unsafe C#). Let’s say that a memory address is designed to hold 9 bits of user input, and instead the user forces 10 bits a information in to it. Normally, the last bit of memory is a return address and tells the code where to go next. In a Buffer overflow attack, a different return address is forced in to that last slot so that the attack can control the flow of the code.</p> <p>For example, the code might say something like, “If the user is not authorized return to login” and instead the attack forces a return code so that it ends up doing something like this “If the user is not authorized go to the bank account withdrawal screen”. By simply changing the flow of an application, and attacker can do really bad things.</p> <p>Fixes:</p> <ol> <li>Use .NET (and get out of that unmanaged C++ code <img src='http://developingux.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  )</li> <li>Use safe libraries. Many of the C++ common libraries have been re-written to help prevent Buffer Overflow exposure. Make sure that you are using the updated libraries. </li> <li>Check out the “<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6aed14bd-4766-4d9d-9ee2-fa86aad1e3c9&amp;displaylang=en">Banned.h</a>” header file from Microsoft. It’s is a sanitizing resource which supports the SDL requirement to remove banned functions from a code. It lists all banned APIs <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6aed14bd-4766-4d9d-9ee2-fa86aad1e3c9&amp;displaylang=en">Download</a>. </li> <li>Use the <a href="http://msdn.microsoft.com/en-us/library/8dbf701c(VS.71).aspx">/GS Compiler switch</a>. This was introduced by Microsoft to automatically add safety checking to your code when it compiles. </li> </ol> <h3>XSS</h3> <p>XSS is an abbreviation for <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">Cross Site Scripting</a> attack. (I know, but CSS was already taken <img src='http://developingux.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ) XSS attacks are something that has affected every major web site at one time or another.</p> <p><strong>Background:</strong> When you connect to a website, like amazon or ebay (or any other site that you log in to) it often uses a session cookie to know who you are, and what you are allowed to see (your account info for example). Cookies are not a problem in and of them selves, in fact, your browser makes sure that it only send cookies to the web site that it was issued from. See – your browser trusts the site that you are on.</p> <p><strong>What is it:</strong> In a XSS attack, a malicious user figures out how to load their JavaScript to a trusted site. So that when your browser sends them your cookie, the malicious JavaScript has access to your cookie and forwards it on to the attacker. Then the attacker can impersonate you and access your information.</p> <p>How it works: Have you ever searched for a random product on a site, like foo, and received a response message that said something like “your search for foo was not found.”? Try searching for “&lt;b&gt;foo&lt;/b&gt;”. What happened? If the message looks like this: “your search for <strong>foo</strong> was now found.”, then they are probably not sufficiently checking the user input. Now image searching for this:</p> <p><a href="http://developingux.com/wp-content/uploads/2010/02/image11.png"><img style="border-right-width: 0px; margin: 0px auto 10px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb6.png" border="0" alt="image" width="240" height="29" /></a>If you get a pop up that say’s “oh noes!” then this site is definitely vulnerable.  You see, as far as your browser is concerned, this JavaScript is coming from the server that is generating the result page. Now imagine sending someone an email with a link to go check out this great deal on a new bike [inline]  <a onclick="alert('oh noes!');" href="#">http://newbikesforSale.com</a>[/inline]!</p> <p>The link above looks legitimate, but it’s actually a link that contains JavaScript to open an simple alert box. You can trust it (it won’t hurt you I promise), but in a XSS attack an attacker uses HTML mixed with JavaScript to embed their JS code in an email link, or more likely on a comment thread, in a blog review, or any place that will let it in.</p> <p><strong>Fix: </strong>All user input is considered evil until proven otherwise. The problem is that we haven’t traditionally considered search forms and product reviews as user input in to our systems, but they are. You can scrub user input easily enough by doing something like string SafeToDisplay = Server.HTMLEncode(userInput); but really you should look at incorporating some of the libraries that are specifically designed to handle these scenarios. Check out <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=051ee83c-5ccf-48ed-8463-02f56a6bfc09&amp;displaylang=en">Microsoft’s Anti-Cross Site Scripting Library</a>, it’s very comprehensive and covers many more scenarios.</p> <h3>SQL Injection</h3> <p>All user input should be considered evil until proven otherwise. This has never been more true than it is with SQL Injection vulnerabilities.</p> <p><a href="http://xkcd.com/327/"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image12.png" border="0" alt="image" width="529" height="165" /></a></p> <p><strong>How it works:</strong> Imagine that you have an application with a log in: User name and password.     <br /><strong><a href="http://developingux.com/wp-content/uploads/2010/02/image13.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb7.png" border="0" alt="image" width="212" height="86" /></a></strong> <br />Pretty simple so for huh? Now think about the SQL that you would write to validate a user…  It *might* start off looking something like this:</p> <p><a href="http://developingux.com/wp-content/uploads/2010/02/image15.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb8.png" border="0" alt="image" width="356" height="75" /></a></p> <p>So far so good… as long as everyone enters a user name and password in to the correct textbox on the screen this should validate them perfectly…</p> <p><a href="http://developingux.com/wp-content/uploads/2010/02/image16.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb9.png" border="0" alt="image" width="244" height="76" /></a></p> <p>but what happens when you enter something unexpected in to one of the boxes..<a href="http://developingux.com/wp-content/uploads/2010/02/image17.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb10.png" border="0" alt="image" width="205" height="101" /></a></p> <p>what would the resulting SQL?    <br /><a href="http://developingux.com/wp-content/uploads/2010/02/image18.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb11.png" border="0" alt="image" width="244" height="51" /></a></p> <p>the problem here is that the text from the form is now being executed as part of the SQL statement itself. SQL injection just allowed this person to operate this application with the username BillG… I’m sure that wouldn’t be a problem!</p> <p><strong>Not just Log In Screens.</strong> Any place that user input is translated in to a query to the database is open to attack. Search fields are a notoriously overlooked place for SQL Injections, and not just for logging, at this point the attack can do anything that the application can do. Even worse, many application run as SA (Sql Administrator) just to make “life easy” on the developer. That opens up a whole new problem. Imagine a random user being able to log in to your system, add themselves as an administrator, shut down your server, rewrite your website, reformat your hard rive all from a search box. See the problem?</p> <p><strong>Fix</strong>: the fix is easy, don’t let user input run as SQL. You can prevent SQL Injection by moving away from concatenated string for building sql queries. if you need the flexibility of ad-hoc sql, then write your adhoc sql using <a href="http://www.codinghorror.com/blog/archives/000275.html">parameterized SQL</a>.  Otherwise you can move to <a href="http://msdn.microsoft.com/en-us/library/yy6y35y8(VS.80).aspx">stored procedures</a> or an <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">ORM</a> like <a href="http://msdn.microsoft.com/en-in/data/cc298428(en-us).aspx">Linq to SQL</a>, Microsoft’s <a href="http://msdn.microsoft.com/en-in/data/ee720194(en-us).aspx">Entity Framework</a>, or <a href="https://www.hibernate.org/">nHibernate</a> that will automatically use parameterized sql for you.</p> <h4>White List vs Black List Principle</h4> <p>One thing that I want to call out at this point. It is very tempting to try and “sanitized” every user input instead of moving to one of the more robust solutions mentioned above. I had a friend (a very good developer) that was sanitizing all user input for “bad” words before he would process it. In his words, “we don’t have any products called drop, delete, execute… so I should be able to do a string.Replace on those words and then be fine.</p> <p>Here’s the problem with that. In Security there is a concept of White List vs Black Lists. A white list approach says, here is what I will allow, and throw away anything else. A Black list take the approach that says, “here is what I won’t allow, I’ll let in anything else that’s not on this list.” The problem with the black list approach is that security is a moving target, there are vulnerabilities today that we didn’t know about yesterday, there will be more tomorrow that I don’t know about today. Just because something isn’t on my “bad” list today, doesn’t mean that it shouldn’t be.</p> <p>I went to my friends bad word scrubber and entered this : ‘del<strong>delete</strong>ete” do you see the word delete in there? What will  happen after your scrubber removes it… you’ll be left with “delete”. He started using parameterized SQL.</p> <h3>Encryption</h3> <p>I once interviewed a really smart computer science guy that wanted to come work for our consulting company (primarily focus on business applications). Saying this guy was smart is an understatement. He was a Computer Science PhD candidate with cross disciplines in artificial intelligence and game theory. wow! The problem was that he had very little knowledge or experience writing actual applications. When I asked him about if we should write out own encryption for some application that we were working on, he got all excited and started to go in the details about what it would take to implement out own encryption. I’m pretty sure he had taken a class on this, wrote some thesis on it or something because he was really excited that I had asked him about this topic. Here the thing, never write your own encryption.</p> <p>Getting encryption done right is hard.. like really hard. In fact, if you are good at it, maybe you should go work for the government, or a university, or RSA directly, but you have no business trying to do that for a business application. Use the tried and true, multiple encryption, publically available libraries to do it right.</p> <h4>3-Types of encryption.</h4> <p><strong>Private Private Key</strong>, also known as a symmetrical encryption uses the same key to encrypt and unencrypt. Symmetrical encryption is very fast, so it’s great for encryption transmissions and it used for things like secure communication and SSL. the problem is that it’s less secure because you have to have a secure way to hand out the private key.</p> <p><strong>Public Private Key</strong>, also known as asymmetrical encryption uses two different keys. One key (the public key)<a href="http://developingux.com/wp-content/uploads/2010/02/ssl_handshake.png"><img style="border-right-width: 0px; margin: 5px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ssl_handshake" src="http://developingux.com/wp-content/uploads/2010/02/ssl_handshake_thumb.png" border="0" alt="ssl_handshake" width="232" height="244" align="right" /></a> is used for encryption, the private key is used for decryption. The benefit here, is that you can yell out for the world to here your public key, but only the person with the private key can do the decrypting. The problem is that it’s very slow and computationally expensive.</p> <p>So how can two computers talk securely to each other in an open environment like the Internet? The answer is a combination of the above. SSL, or secure socket layer uses a public key to securely transmit a “session” key that will be used for symmetrical encryption for the rest of the communication.</p> <p><strong>1-Way Hashes</strong> cannot be encrypted. How is that helpful? It’s very helpful. A hash can me used to make sure that two values are equal without actually knowing what the values are. For example, my application should never store plain text passwords. If they did it might be possible for those passwords to become compromised. By storing a 1-way hash instead the password cannot be retrieved even if the database (or a backup of the database) is compromised. How do I log user in to the system then? Simple, I take the password they give me, I has it using the same method and compare the two results.</p> <p>Digital Certificates – Digital Certificate use a combination of the above concepts to support secure communication and identification. We’re just not going to go in to all of that now. <img src='http://developingux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p> <h3>Least Privilege Principle</h3> <p>Reduce your Attack Surface – if you don’t need a service, turn it off. If your application doesn’t need permission to do something, don’t supply it. By limiting the scope of what can be done, you also limit what can be broken if and when things go bad.</p> <p>Default to Fail – Here’s an example.</p> <p><a href="http://developingux.com/wp-content/uploads/2010/02/image19.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb12.png" border="0" alt="image" width="244" height="163" align="left" /></a> What’s wrong with this code? (ok, a lot <img src='http://developingux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) But what we want to focus on is that if there is an exception along the way, it will default to the user being authenticated. The [valid] should have been set to false, until proven otherwise.</p> <p>Don’t reveal more than is helpful to the user. Be helpful, but you don’t have to thrown up every SQL exception on your users.. log that stuff, let the debug team look at it, but knowing what version of SQL server you’re running or what the stack address is completely useless to your users… but bad people love that stuff.</p> <p><a href="http://developingux.com/wp-content/uploads/2010/02/image20.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb13.png" border="0" alt="image" width="219" height="231" align="left" /></a>I love this screen shot. Is that error helpful to you? It says “Error 0x80090022” but it means “No smart card inserted in reader.</p> <p>Don’t give away your system internals, at the same time make sure that your user errors are helpful!</p> <h3>More resources…</h3> <p>OK.. as you can imagine there’s a lot more that we could cover, but instead take a look at some of these resources.</p> <p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=A48CCCB1-814B-47B6-9D17-1E273F65AE19&amp;displaylang=en">Threat Modeling Tool</a> – Threat modeling is all about identifying assets, vulnerabilities, resolutions, evaluating a business value on assets, then balance the cost of a resolution with real business value.</p> <p><a href="http://www.microsoft.com/security/sdl/getstarted/processtemplate.aspx">SDL Process Template for Team System</a> – SDL is the Security Development Lifecycle, it’s a set of practices and tools that help integrate secure development in to all aspects of SDLC (Software Development Life Cycle). This is Microsoft’s template to integrate SDL with Team Foundation Server (Microsoft’s Application Lifecycle Management Server).</p> <p><a href="http://www.microsoft.com/security/sdl/getstarted/tools.aspx">SDL Process Tools</a> – There’s a ton here, check it out.</p> <p><a href="http://msdn.microsoft.com/en-us/security/default.aspx">MSDN Security</a> – Read the blogs, latest news, and downloads regarding Microsoft security and development.</p> <p><a href="http://11011.net/software/vspaste"></a></p> <p>Happy Coding (securely)!</p> <p> </p> <p>Images Credit: <a href="http://www.flickr.com/photos/carbonnyc/2294144289/">http://www.flickr.com/photos/carbonnyc/2294144289/</a></p>]]></content:encoded>
			<wfw:commentRss>http://developingux.com/2010/02/10/secure-coding-101/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>We don&#8217;t give 5&#8217;s&#8230; and other antiquated management techniques.</title>
		<link>http://developingux.com/2010/02/09/dont-give-5-management-techniques/</link>
		<comments>http://developingux.com/2010/02/09/dont-give-5-management-techniques/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 04:59:45 +0000</pubDate>
		<dc:creator>Caleb Jenkins</dc:creator>
				<category><![CDATA[Leadership]]></category>
		<category><![CDATA[Career]]></category>
		<category><![CDATA[management]]></category>

		<guid isPermaLink="false">http://developingux.com/?p=816</guid>
		<description><![CDATA[
			
				
			
		  I was talking to a friend of mine last month that had just had mid-year reviews at his company. I received his permission to relay some of our conversation and my response to him here. “So I walk in to sit with my manager for my mid-year review… we’re ranked on 12 different categories [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; z-order:25;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F09%2Fdont-give-5-management-techniques%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F09%2Fdont-give-5-management-techniques%2F&amp;source=calebjenkins&amp;style=normal" height="61" width="50" />
			</a>
		</div><p> </p> <p><a href="http://www.youtube.com/watch?v=_v90q0ydxMI"><img style="border-right-width: 0px; margin: 0px auto 10px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image9.png" border="0" alt="image" width="531" height="229" /></a>I was talking to a friend of mine last month that had just had mid-year reviews at his company. I received his permission to relay some of our conversation and my response to him here.</p> <blockquote><p>“So I walk in to sit with my manager for my mid-year review… we’re ranked on 12 different categories on a scale of 1 to 5, there are 9 of us that report to him”</p></blockquote> <p>Sounds normal, makes sense.</p> <blockquote><p>“First thing my manager says in going over my review is, just so you know, and I’ve told everyone this: I don’t give 5’s”</p></blockquote> <p>Wait what?! Um, if that’s the case then why not just have a scale that goes from 1 to 4? Let’s think about that for a minute. No really, let that sink in. Why call it 1 to 5, if it’s really 1 to 4?</p> <p><span id="more-816"></span></p> <p>A 5 does not mean perfect, only one person in history was ever perfect. Nor does a 5 mean that’s there’s no room for improvement, there is always some room for improvement.</p> <p>A 5 (or whatever your top score is) means that the person that you are reviewing is awesome in that category. That they completely exceed your expectations on that metric, nothing more.</p> <h3>Also, rank is relative.</h3> <p>A 5 for a “fresh out of school” with a fresh out of school paycheck … might be the equivalent performance of a 3 for a more seasoned developer – because more is expected from the seasoned person.</p> <blockquote><p>“He went on to say that his boss… the senior VP of our group, told him that he automatically bumps 5’s down to 4’s anyways.”</p></blockquote> <p>Oh, so it’s a systemic problem with the culture of your company, not just one manager… good to know. One more thing on that, I would push back, because at least if your manager went to his boss and said, this person is excellent at this, then, even if the VP bumped it down to a 4, he still heard the praise from your boss first.</p> <p>Here’s my thought, if you are a manager, and there’s not one person on your team that is awesome in any of those 12 categories, then you hired the wrong people.</p> <h3>That’s worth repeating…</h3> <h1>If there’s not one person on your team that is awesome in at least one of those areas, then you hired the wrong people and it’s your fault.</h1> <p> </p> <h3>Here’s a tip</h3> <p><strong>if you want people to perform at their best, recognize what they are doing right, reward them for it</strong>, and they’ll want to do more of those things plus they’ll want to figure out how to excel in more areas. Nothing takes the wind out of your teams’ sails like effectively telling them, “no matter how hard you try, or how much work you put in, you’ll never be excellent, because I don’t give 5’s” Talk about <a href="http://www.despair.com/viewall.html">demotivating</a>!</p> <p>I let my friend know that culture change at a company is not easy.. but it is a worth wile endeavor and can have huge payoffs.</p> <p>Finally, I will leave you with this little gem that was posted on <a href="http://www.slideshare.net/BillHerring/how-netflix-fosters-culture-of-success">SlideShare</a> <br />it’s worth the read.</p> <div style="text-align: center; width: 524px; height: 386px;"><a style="margin: 12px 0px 3px; display: block; font: 14px helvetica,arial,sans-serif; text-decoration: underline" title="How NetFlix Fosters Culture Of Success" href="http://www.slideshare.net/BillHerring/how-netflix-fosters-culture-of-success">How NetFlix Fosters Culture Of Success</a><object style="margin:0px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=hownetflixfosterscultureofsuccess-12500778206503-phpapp01&amp;stripped_title=how-netflix-fosters-culture-of-success" /><param name="allowfullscreen" value="true" /><embed style="margin:0px" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=hownetflixfosterscultureofsuccess-12500778206503-phpapp01&amp;stripped_title=how-netflix-fosters-culture-of-success" allowscriptaccess="always" allowfullscreen="true"></embed></object></div> <p> </p> <p>Enjoy!</p>]]></content:encoded>
			<wfw:commentRss>http://developingux.com/2010/02/09/dont-give-5-management-techniques/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SOLID: Software that works.</title>
		<link>http://developingux.com/2010/02/09/solid-development/</link>
		<comments>http://developingux.com/2010/02/09/solid-development/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 06:06:04 +0000</pubDate>
		<dc:creator>Caleb Jenkins</dc:creator>
				<category><![CDATA[10 Developement Practices]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[dependencyinjection]]></category>
		<category><![CDATA[developer practices]]></category>
		<category><![CDATA[DI]]></category>
		<category><![CDATA[IoC]]></category>
		<category><![CDATA[solid]]></category>

		<guid isPermaLink="false">http://developingux.com/?p=809</guid>
		<description><![CDATA[
			
				
			
		This post is a part of a series that I started with "10 Practices that Every Developer Needs to Start Right Now". Update: This post was picked up by DZone, go vote it up!  Ok, before you dig in to the post, let’s get two things out of the way first.  1.Go read the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; z-order:25;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F09%2Fsolid-development%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F09%2Fsolid-development%2F&amp;source=calebjenkins&amp;style=normal" height="61" width="50" />
			</a>
		</div><p>This post is a part of a <a href="http://developingux.com/topic/10-developement-practices/">series</a> that I started with "<a href="http://developingux.com/2010/01/06/10-practices-every-developer-needs-right-now/">10 Practices that Every Developer Needs to Start Right Now</a>".</p> <p><strong>Update</strong>: This post was picked up by DZone, <a href="http://dotnet.dzone.com/news/solid-software-works">go vote it up</a>!</p> <p><a href="http://www.lostechies.com/blogs/derickbailey/archive/2009/02/11/solid-development-principles-in-motivational-pictures.aspx"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="solid_thumb" src="http://developingux.com/wp-content/uploads/2010/02/solid_thumb.jpg" border="0" alt="solid_thumb" width="511" height="409" /></a></p> <p>Ok, before you dig in to the post, let’s get two things out of the way first.  1.Go read the authority on <a href="http://www.butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">SOLID principles</a> from the man himself, <a href="http://www.butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">Uncle Bob Martin</a>.  2nd.Go get the very cool <a href="http://www.lostechies.com/blogs/derickbailey/archive/2009/02/11/solid-development-principles-in-motivational-pictures.aspx">Inspirational SOLID</a> images from the guys over at Los Techies. They released them under a Creative Commons License which I think is pretty cool! Alright, got that out of the way? Good. Let’s get started.</p> <p>Few things have come a long OO history that resonate so well with so many developers than the SOLID principle. One of the reasons they resonate with so many developers is because they communicate several practices that many developers have been doing all along. The beauty and power of the SOLID principals in in there ability to communicate, what I call <a href="http://developingux.com/2009/09/14/dependency-injection-on-microsoft-arcast-tv/">code architecture</a>, in such a memorable and practical way.</p> <p>Like any good thing, however, taken to an extreme can become a hindrance on any project. So, I’m going to tackle these principals like I tackle everything in this series… give you my take on it. So here you go: SOLID according to Caleb.</p> <p><span id="more-809"></span></p> <p>[SOLID Motivational Posters, by <a href="http://www.lostechies.com/blogs/derickbailey/archive/2009/02/11/solid-development-principles-in-motivational-pictures.aspx">Derick Bailey</a>, is licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/us/">Creative Commons Attribution-Share Alike 3.0 United States License</a>. <a href="http://www.lostechies.com/blogs/derickbailey/archive/2009/02/11/solid-development-principles-in-motivational-pictures.aspx">Get them here</a>.]</p> <p><a name="srp"></a><a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derickbailey/SingleResponsibilityPrinciple2_5F00_71060858.jpg"><img style="border-right-width: 0px; margin: 0px auto 10px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image8.png" border="0" alt="image" width="511" height="185" /></a></p> <h3>S – Single Responsibility Principal <a href="#srp">#</a></h3> <p>"There should never be more than one reason for a class to change." — Robert Martin, SRP paper linked from <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">The Principles of OOD</a></p> <p><strong>Abuse</strong>: I’ve seen this taken to an extreme. I’ve seen good clean readable code turned in to multiple classes (even multiple projects) to break up “responsibility”. The end result was much harder to maintain and even harder to read.</p> <p><strong>Applied</strong>: “One reason to change” does not mean that every class has one and only one thing (that would be called a method), it does mean that you should focus on the area (or areas) of responsibility that a class should have and then stick with those boundaries. <a href="http://en.wikipedia.org/wiki/Code_bloat">Code bloat</a> (overly large classes with overly large methods) is a real <a href="http://en.wikipedia.org/wiki/Code_smell">code smell</a> that you need to watch out for. The more things that a class is responsible for, the more likely you’ll have to change it and the harder it will be to test.</p> <p>Your code should be broken in to manageable pieces, reduce any unnecessary couplings… Practice writing Libraries not Frameworks.</p> <p> </p> <p><a name="ocp"></a><a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derickbailey/OpenClosedPrinciple2_5F00_2C596E17.jpg"><img style="border-right-width: 0px; margin: 0px auto 10px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image14.png" border="0" alt="image" width="511" height="247" /></a></p> <h3>O – Open Closed Principle <a href="#ocp">#</a></h3> <p>"Software entities should be open for extension, but closed for modification." — Robert Martin paraphrasing Bertrand Meyer, OCP paper linked from <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">The Principles of OOD</a></p> <p><strong>Abuses</strong> – I’ve worked on code bases that were so extensible, so configurable, so full of <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">AOP</a> indirection and configuration that following the flow of what they were actually doing was almost impossible.</p> <p><strong>Applied </strong>– Code is going to change, that’s a part of life. The Open Closed Principal is more about reducing how often you have to change your code and in how many places. In other words: Code to Interfaces and maintain your abstraction boundaries.</p> <p>I recently worked with a <a href="http://msdn.microsoft.com/en-in/data/cc298428(en-us).aspx">Linq to SQL</a> project where the <a href="http://msdn.microsoft.com/en-in/library/system.data.linq.datacontext(en-us).aspx">Data Context</a> object was being passed around through out all of the layers in the application. That meant that most of the application was impossible to unit test and if I were to change a column or table in the database I would have to go through the entire code base and find all of the places that broke. We fixed that by creating a specific data interface that all interactions had to go through, only passing domain objects (<a href="http://en.wikipedia.org/wiki/Data_Transfer_Object">DTO</a> Models). We kept the DB Context in the Data Layer implementation where it was super useful, but no longer forced us to recompile the entire source for simple data changes. I like how approach that Jeffery Palermo described and an <a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-1/">Onion Architecture</a>.</p> <p>I also worked on another project where 8 layers of abstract classes were used to distinguish between three different types of physical devices… any change in the application behavior had to be propagated across all of the implementations. We fixed that by concealing the device differences behind a single command interface that was then injected in to the application “behaviors” via an abstract factory.</p> <h4>What did you just say?</h4> <p>So in other words… imagine having three different devices (blue, red, green) that all needed to be turned on (behavior), but the command to turn on each was different and defined by the manufacture… the code *might* look like this:</p> <pre><a href="http://developingux.com/wp-content/uploads/2010/02/image1.png"><img style="border-right-width: 0px; margin: 0px 15px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb1.png" border="0" alt="image" width="232" height="243" align="left" /></a></pre> <p>Now imagine that there were multiple points within your application where you were working with the devices… now, every time you need to support a new device you end up with this if/else statement being redone just about everywhere…</p> <p><a href="http://developingux.com/wp-content/uploads/2010/02/image2.png"><img style="border-right-width: 0px; margin: 5px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb2.png" border="0" alt="image" width="289" height="57" /></a></p> <p>By externalizing the device differences behind a factory and encapsulating them in an Interface you now only have one place to change to add a new device. You could reduce that further using an extension manager like <a href="http://mef.codeplex.com/">Microsoft MEF</a>, but we won’t go in to that right now.</p> <p> </p> <h3><a name="lsp"></a><a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derickbailey/LiskovSubtitutionPrinciple_5F00_52BB5162.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image3.png" border="0" alt="image" width="511" height="218" /></a> L – Liskov Substitution Principle <a href="#lsp">#</a></h3> <p>"Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it." — Robert Martin, LSP paper linked from <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">The Principles of OOD</a></p> <p><strong>Abuses:</strong> I like to think of this principle as “Use Interfaces”.  I haven’t really seen abuses of this practice, but I have seen some bad implementations. The rough ones, are where developers rely on a <a href="http://msdn.microsoft.com/en-us/library/ms173150.aspx">base abstract class</a> instead of an <a href="http://msdn.microsoft.com/en-us/library/ms173156.aspx">Interface</a> also. The doesn’t sound like a problem until you start putting parameters in the constructor of the base class. Now any derived classed have to enforce those same dependencies even if you are creating an entirely different implementation.</p> <p><strong>Applied:</strong> Use Interfaces. If you find that a base class would meet some of your needs more closely, that’s fine, just make sure that you back that base class up with an Interface, and then code to the Interface.. you’ll thank me later.</p> <p>Side Note: Their are different schools of thought around backing domain models with Interfaces. I do, the main reason is that even if I end up using an ORM (like <a href="http://msdn.microsoft.com/en-in/data/aa937723(en-us).aspx">Entity Framework</a>, or <a href="http://msdn.microsoft.com/en-in/data/cc298428(en-us).aspx">LinqToSQL</a>) that “forces*” me to a specific domain model implementation, I can save myself a lot of headache later and make my models more mobile if I connect those domain models to an Interface.</p> <p>* – no toolkit should force your architecture or design, any implementation can be abstracted around, Domain Model Interfaces help move your DTO’s through layers of your application without carrying heavy dependencies with you.</p> <p> </p> <h3><a name="isp"></a><a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derickbailey/InterfaceSegregationPrinciple_5F00_60216468.jpg"><img style="border-right-width: 0px; margin: 0px auto 10px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image4.png" border="0" alt="image" width="511" height="185" /></a> I – Interface Segregation Principle <a href="#isp">#</a></h3> <p>"Clients should not be forced to depend upon interfaces that they do not use." — Robert Martin, ISP paper linked from <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">The Principles of OOD</a></p> <p>Let’s say you have a service class for working with Invoices, your IManageInvoices interface exposes three methods, Add(IInvoice), Delete(IInvoice) and Update(IInvoice). Because of deployment and security concerns you are going to create two different classes to implement this.</p> <p>One, InvoiceCreator will implement the Add method and run in untrusted environments. The other class, InvoiceUpdater, will implement the other two methods and will only run in secure, verified and authenticated context. So what should each class do with the other methods?</p> <p><strong>Violated: </strong>One “option” would be to implement them, but then throw a “Not-Implemented Exception” or set up Void methods that don’t actually do anything, both of those options are ugly and bad choices.</p> <p><strong>Applied: </strong>The better option is to split your Interface, create a ICreateInvoices Interface with the Add method, and a IUpdateInvoices interface with the other methods. That way, you are actually implementing the methods of your interface, and are not hiding are making implementation decisions that break your abstraction and require special knowledge of the class.</p> <p> </p> <h3><a name="di"></a><a href="http://www.lostechies.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derickbailey/DependencyInversionPrinciple_5F00_0278F9E2.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image5.png" border="0" alt="image" width="511" height="147" /></a> D – Dependency Inversion Principle <a href="#di">#</a></h3> <p>"(A) High level modules should not depend upon low level modules. Both should depend upon abstractions. (B) Abstractions should not depend upon details. Details should depend upon abstractions." — Robert Martin, DIP paper linked from <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">The Principles of OOD</a></p> <p>All code has dependencies, the question is how to you resolve those dependencies.</p> <p>Example: my class will access a service, I could write it like this:</p> <p><a href="http://developingux.com/wp-content/uploads/2010/02/image6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb3.png" border="0" alt="image" width="345" height="190" /></a></p> <p>or like this:</p> <p><a href="http://developingux.com/wp-content/uploads/2010/02/image7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb4.png" border="0" alt="image" width="342" height="179" /></a></p> <p>Can you spot the difference? It’s subtle, yet very very powerful. In the first instance, you are using an Interface to define your Shipping Service (and that’s a good thing!), but then you are forcing your class to be dependent on the UPS shipping service… I don’t have anything again UPS, but I do know that company contracts are constantly changing, and just because <em>we were using UPS </em>when we designed and had the customer (business owner) sign off on the application, doesn’t mean that that’s who we are going to use when we go to production!</p> <p>You might be tempted just to replace the “new UPS” instantiation with an Abstract Shipping Factory ( shipService = factory.getShippingService() )… that wouldn’t necessarily be a bad idea, except now you’ve shifted your code from a UPS dependency to a factory dependency.</p> <p>Notice in the second option, we hand our class the implementation that we want to use through the constructor. That’s called constructor injection, we could have also used a property or method to set the shipping service. I like constructor injectors for anything that my class requires to operate. This allows us to define our IShipping service implementation completely independent of the class that’s consuming it.</p> <p>This also makes are code much easier to test by allowing us to creating a mock (fake) version of our IShipping service for testing the main class. We might even use something like <a href="http://ayende.com/projects/rhino-mocks.aspx">RhinoMocks</a> to help our automated unit tests even more, but we’ll save that discussion for another time.</p> <h4>No Framework Required</h4> <p>You may have noticed that this <strong>dependency injection is not dependent on any special tooling or frameworks</strong> (so we’re not introducing new dependencies just to get rid of another!)</p> <p>Dependency Injection or DI, is really a style of coding that makes your code more composable, testable and maintainable. DI Frameworks (or Containers) are specifically designed to be used in two stages.</p> <h4>Register, then Resolve</h4> <p>First, you register your Interface to Class mappings, then you can reference the container anytime and resolve an Interface to a concrete class. Containers can also provide other nice benefits like controlling the life cycle of an object (singelton, vs per thread, vs per request for example). Some DI frameworks also provide the ability register special handlers (or Interceptors) that get invoked whenever a method or a property is called. This in a concept known as AOP or Aspect Oriented Programming that is useful for cross-cutting concerns like automatic logging and security checks.</p> <p>For more information on Dependency Injection and Inversion of control I suggest checking out my <a href="http://developingux.com/di/">DI</a> in <a href="http://developingux.com/2008/12/18/dependency-injection-with-silverlight/">Silverlight slide deck</a>, as well as the <a href="http://ninject.org/">Ninject</a>, <a href="http://castleproject.org">Castle</a>, <a href="http://unity.codeplex.com/">Microsoft Unity</a> and <a href="http://structuremap.sourceforge.net/">Structure Map</a> projects.</p> <p>Enjoy!</p>]]></content:encoded>
			<wfw:commentRss>http://developingux.com/2010/02/09/solid-development/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Buying a new computer.</title>
		<link>http://developingux.com/2010/02/01/buying-a-new-computer/</link>
		<comments>http://developingux.com/2010/02/01/buying-a-new-computer/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 21:25:55 +0000</pubDate>
		<dc:creator>Caleb Jenkins</dc:creator>
				<category><![CDATA[Family]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[buying]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[non-techie]]></category>

		<guid isPermaLink="false">http://developingux.com/?p=787</guid>
		<description><![CDATA[
			
				
			
		I’m in the market for a new computer… which one should I get?  Like a lot of people in the computer industry I get asked this question *a lot*. Friends, family, third cousins once removed all seem to hunt me down when they are in the market for a new computer. I don’t mind, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; z-order:25;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F01%2Fbuying-a-new-computer%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F02%2F01%2Fbuying-a-new-computer%2F&amp;source=calebjenkins&amp;style=normal" height="61" width="50" />
			</a>
		</div><blockquote><h1>I’m in the market for a new computer… which one should I get?</h1></blockquote> <p><a href="http://developingux.com/wp-content/uploads/2010/02/image.png"><img style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin: 0px auto 10px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/02/image_thumb.png" border="0" alt="image" width="533" height="340" /></a> Like a lot of people in the computer industry I get asked this question <strong>*a lot*</strong>. Friends, family, third cousins once removed all seem to hunt me down when they are in the market for a new computer. I don’t mind, but I’ve gotten used to giving the same answer. I’m posting my answer here as a reference to myself, them, and anyone else this might help…</p> <p><span id="more-787"></span></p> <h3>Whichever one you pick, it will be out dated in a month</h3> <p>Before you buy a computer you should accept that this is part of the technology world we live in. In three months you will see a better laptop for less money with more features. Accept that fact and move on.</p> <h3>Any laptop will work… seriously… it doesn’t matter.</h3> <p>Unless you are a serious gamer, doing auto-cad or some sort of 3D rendering: any modern computer on the market right now will do what you want.</p> <h3>Start at Best Buy</h3> <p>My advice is to go to <a href="http://www.bestbuy.com/">Best Buy</a> – not the website, go in to the store. Figure out how much you want to spend, what features are important to you and then pick one out. I honestly and consistently find the sales people at Best Buy to be pretty helpful and informative. If you have time, you can watch the papers, shop and compare, but at least you'll have a better idea of what you are looking for and what's available. I pretty much use Best Buy as the base line or starting point for that. Some good places to check next: <a href="http://www.frys.com/">Fry’s</a>, <a href="http://www.newegg.com/">New Egg</a>, <a href="http://www.staples.com/">Staples</a>, <a href="http://www.dell.com/">Dell</a>, <a href="http://www.dell.com/refurbished">Refurbished Dells</a></p> <h3>Don’t pay for the extras.</h3> <p>I would go to Best Buy - see what they have to offer, just don’t sucked in to all of their add-ons and up sales. They will offer to sell you a bag, Anti-Virus, Software Removal/Installation. Anything that they offer you can do on your own or is probably available for free (ex: <a href="http://www.microsoft.com/security_essentials/">Anti-Virus</a>/<a href="http://www.microsoft.com/windows/windows-vista/features/firewall.aspx">Firewall</a> - don't let them sale you those)</p> <p>They offer so many “services” that the price of your computer could easily double. For some people this could be a great service, but for most – these are things that you can do on your own, and would probably benefit from learning how to do them anyway. I understand why they offer these services, and why people buy them… I pay to get my oil changed on my car (because I’m not a car guy) some people would never think to pay someone else to change their oil… I guess that’s how I feel about the “extras” they offer.</p> <h3>Warrantee? Maybe.</h3> <p>Probably the single biggest up sale that they offer is the warrantees. I have mixed feeling about these. One one hand, I expect products to last more than a year, and hate paying extra for that assurance. On the other hand… I did purchase an extended warranty on a laptop once (from Staples). Normally , I wouldn't pay the money for that , but that was specifically because that laptop was for work, I was traveling a lot at the time and if anything happened to it, I'd be dead in the water - also - my work was paying for half of the laptop. I don’t buy warrantees for computers that are going to stay at home.</p> <h3>Buy RAM not CPU</h3> <p>If you have the money, invest in more RAM than processor speed. If you are going to go with a 64 bit processor, then I would try to go to 6 GB of RAM or 3 GB of RAM for a 32 bit OS. Also, check around – often you can find RAM at substantially discounted prices after market. Apple is notorious for charging outrageous prices on extra RAM.</p> <h3>Buy New</h3> <p>I would not buy a used or 3rd party laptop. New ones are plenty cheap right now, and a much better value. Sorry eBay – I don’t want a used computer, and I want to know that the support and warrantee are going to be there.</p> <h3>What about a NetBook?</h3> <p>For about $300.00 you can get a <a href="http://www.bestbuy.com/site/Computers-PCs/Netbooks/pcmcat163300050051.c?id=pcmcat163300050051">Netbook</a>. For around $400.00 you can get a <a href="http://www.bestbuy.com/site/olstemplatemapper.jsp?_dyncharset=ISO-8859-1&amp;id=pcmcat138500050001&amp;type=category&amp;usc=abcat0500000&amp;cp=1&amp;sp=%2Bcurrentprice+skuid&amp;nrp=15&amp;qp=crootcategoryid%23%23-1%23%23-1~~q2a~~cabcat0500000%23%23d%23%231i8~~ncabcat0502000%23%234%23%2328&amp;pagetype=listing">laptop that does much much more</a> and is much more powerful. I have a friend that bought a Netbook because he was writing a book. He loved it, and it worked great for him. But he specifically bought it for a single purpose, to use <a href="http://office.microsoft.com/en-us/word/FX100487981033.aspx">Word</a> and write his book. It was a second computer for him, and he wanted the portability and flexibility that it provided. I would not consider a Netbook for a primary laptop. For a little more money you can get something that will be much more powerful and versatile.</p> <h3>Anything will work</h3> <p>Again, almost anything on the market will work. Just figure out what you want it to do. For most people that involves using Word and surfing the Internet.. and anything will work. If you are going to do a lot of gaming, development or something where you need more power… then this blog post is not for you.  <img src='http://developingux.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p> <p>OK, that’s it for me. What are your suggestions? Add them to the comments below.</p> <p>Happy Shopping!</p> <p>Photo Credit: <a href="http://www.flickr.com/photos/calebjenkins/2405088004/">http://www.flickr.com/photos/calebjenkins/2405088004/</a></p>]]></content:encoded>
			<wfw:commentRss>http://developingux.com/2010/02/01/buying-a-new-computer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Learning to Write (Software)</title>
		<link>http://developingux.com/2010/01/25/learning-to-write-software/</link>
		<comments>http://developingux.com/2010/01/25/learning-to-write-software/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 19:48:00 +0000</pubDate>
		<dc:creator>Caleb Jenkins</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[learning]]></category>

		<guid isPermaLink="false">http://developingux.com/?p=779</guid>
		<description><![CDATA[
			
				
			
		I received a message on Facebook last week from a friend of mine that asked this question: I have recently decided that I would love to go to school to learn programming. I just wanted to know if you had any advice or suggestions that could help me out (I know it's a very open [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; z-order:25;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F01%2F25%2Flearning-to-write-software%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdevelopingux.com%2F2010%2F01%2F25%2Flearning-to-write-software%2F&amp;source=calebjenkins&amp;style=normal" height="61" width="50" />
			</a>
		</div><p>I received a message on <a href="http://www.facebook.com/silverlightexpert">Facebook</a> last week from a friend of mine that asked this question:</p> <blockquote><p>I have recently decided that I would love to go to school to learn programming. I just wanted to know if you had any advice or suggestions that could help me out (I know it's a very open ended question)? Also I wanted to know if you had any suggestions on books to read regarding Design Patterns (particularly related to web development).</p></blockquote> <p>Great question. Let’s tackle those starting with the second part…</p> <p><span id="more-779"></span></p><blockquote><p>any suggestions on books to read regarding Design Patterns      <br />(particularly related to web development).</p></blockquote> <p>Seriously, you can’t go wrong with the Head First Series.</p> <p><a href="http://www.amazon.com/First-Design-Patterns-Elisabeth-Freeman/dp/0596007124"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image5.png" border="0" alt="image" width="180" height="206" /></a> <a href="http://www.amazon.com/Head-First-Object-Oriented-Analysis-Design/dp/0596008678"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image6.png" border="0" alt="image" width="181" height="205" /></a> <a href="http://www.amazon.com/Head-First-HTML-CSS-XHTML/dp/059610197X"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image7.png" border="0" alt="image" width="184" height="212" /></a> <a href="http://www.amazon.com/Head-First-C-Andrew-Stellman/dp/0596514824"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image8.png" border="0" alt="image" width="178" height="206" /></a></p> <p>I know that the covers are a little hard to take seriously, but I what I really like about these books is that they are designed for <em>learnability</em>. <a href="http://www.webmonkey.com/"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 5px 5px 0px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image9.png" border="0" alt="image" width="240" height="103" align="right" /></a>They are not designed to be reference books or course curriculum. This is the same reason that I liked learning from <a href="http://www.webmonkey.com/">WebMonkey</a> (back in the day… when they had current and relevant articles)</p> <p>OK, now for the first part of the question.</p> <blockquote><p>I would love to go to school to learn programming. I just wanted to know if you had any advice or suggestions that could help me out</p></blockquote> <p>Here’s the thing. I don’t think that I learned any of the really good practices that I use today in school. I find that most <a href="http://en.wikipedia.org/wiki/Computer_Science">CS</a> programs are geared for people that want their PhD in CS… or want to work for Intel developing the next CPU chip or want to right super fast machine code for networking drivers and pace makers. These are all good, but most of them miss the point and the sort of <a href="http://en.wikipedia.org/wiki/Software_engineering">Software Engineering</a> that is required for solid, maintainable, reliable business applications (98+ % of the consulting that I do)</p> <p>I don’t know of a single school that teaches, TDD/BDD, CI, DI/IoC, SOLID… I DO think that you can learn the fundamentals of programming (syntax) and even some of the good OO principals (but even that usually goes overboard with too much theory and not enough tangible reality).</p> <p>So it really depends on your goals.</p> <p>If you want to work towards your PhD – go to a university and get your B.S.</p> <p>If you want to develop web (UI) – I would look at the the offerings at most community colleges. I find that community colleges are often more agile to the market place with certification programs and other offerings than many Universities.</p> <p>If you want to learn the really good practices for maintainable, testable software…</p> <p><a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image10.png" border="0" alt="image" width="82" height="105" /></a> <a href="http://www.amazon.com/Agile-Principles-Patterns-Practices-C/dp/0131857258"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin-left: 0px; margin-right: 0px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image11.png" border="0" alt="image" width="78" height="102" /></a> <a href="http://www.amazon.com/Art-Unit-Testing-Examples-Net/dp/1933988274"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image12.png" border="0" alt="image" width="81" height="104" /></a> <a href="http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image13.png" border="0" alt="image" width="83" height="100" /></a> <a href="http://www.amazon.com/Passionate-Programmer-Remarkable-Development-Pragmatic/dp/1934356344"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image14.png" border="0" alt="image" width="63" height="97" /></a></p> <p>go listen to this <a href="http://www.hanselminutes.com/default.aspx?showID=163">HanselMinutes episode</a>, find as many <a href="http://blog.objectmentor.com/">sources</a> of <a href="http://codebetter.com/">quality</a> <a href="http://msdn.microsoft.com/en-in/cc531155(en-us).aspx">content</a> <a href="http://msdn.microsoft.com/en-in/bb629407(en-us).aspx">that</a> <a href="http://channel9.msdn.com/shows/">you</a> can <a href="http://feeds.feedburner.com/netRocksFullMp3Downloads">latch</a> on to and absorb them…   plus. I’d go <a href="http://feeds.feedburner.com/calebjenkins">subscribe</a> to the blog series that I’m writing on <a href="http://developingux.com/10-practices">development practices</a>.  <img src='http://developingux.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p> <h3><a href="http://twtpoll.com/0nxpu1"><img style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" title="image" src="http://developingux.com/wp-content/uploads/2010/01/image15.png" border="0" alt="image" width="161" height="164" align="right" /></a>What advice am I missing?</h3> <p>Take a second to answer this <a href="http://twtpoll.com/0nxpu1">quick poll on where you learned to write software</a>.  I’ll post the answers when the poll closes on Feb 20th – last day of the upcoming Microsoft MVP Summit</p> <p> </p> <p>Happy Coding!</p>]]></content:encoded>
			<wfw:commentRss>http://developingux.com/2010/01/25/learning-to-write-software/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	<div class="post-cnt">
<p>Caleb Jenkins, is a recognized Silverlight expert and Senior Architect Team Lead at Six Flags Corp, a National Speaker for INETA, a Technical Editor for Wrox Press and is a Microsoft MVP. He lives in the Dallas, TX area where he continues to date his beautiful wife and busy himself playing Candy Land and xBox 360 with their four incredible children. Eventually he’ll post some of the gazillion interviews that he's recorded on CommunityCast.tv or blog more... or stop speaking of himself in the third person. <a href="/about/">more...</a></p>

<p>If you're still reading this, then take a minute to <a href="http://feeds.feedburner.com/CalebJenkins">subscribe to my RSS feed</a> or sign up to <a href="http://www.feedburner.com/fb/a/emailverifySubmit?feedId=1320550&loc=en_US">receive updates by email</a></p></div>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.515 seconds -->
<!-- Cached page served by WP-Cache -->
