<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Devlicio.us - Just the Tasty Bits</title><link>http://devlicio.us/blogs/</link><description>Your Agile .NET Community</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Devlicious" /><feedburner:info uri="devlicious" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Parsing Twitter Date format to .Net DateTime</title><link>http://feedproxy.google.com/~r/Devlicious/~3/3H3CZnLnrF0/parsing-twitter-date-format-to-net-datetime.aspx</link><pubDate>Thu, 24 May 2012 12:53:17 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69758</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Recently when I needed to parse the twitter datetime format into a .Net DateTime I found this &lt;a href="http://blog.tacticalnuclearstrike.com/2009/05/twitter-date-parsing-in-c/"&gt;post&lt;/a&gt; on the web showing how to do it.&amp;#160; However, the format string in the post is setup for non-us format so I thought I would share how to do it for US formatted datetime.&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;const string format = &amp;quot;ddd MMMM dd HH:mm:ss zzzz yyyy&amp;quot;;

var d = DateTime.ParseExact(&amp;quot;Thu May 24 11:43:52 +0000 2012&amp;quot;, format, System.Globalization.CultureInfo.InvariantCulture)
&lt;/pre&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69758" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/3H3CZnLnrF0" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net/default.aspx">.Net</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/HowTo/default.aspx">HowTo</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/05/24/parsing-twitter-date-format-to-net-datetime.aspx</feedburner:origLink></item><item><title>EntityCollection or EntityReferece error in EF when using .ToList()</title><link>http://feedproxy.google.com/~r/Devlicious/~3/HidCFCTd3zo/entitycollection-or-entityreferece-error-in-ef-when-using-tolist.aspx</link><pubDate>Fri, 18 May 2012 11:38:02 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69752</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;This is just odd and I am hoping someone can explain it to me.&amp;#160; Today when doing a EF query (see below) I received the following error.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_38633DC7.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_5CA82249.png" width="475" height="289" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here is the original EF Query which was causing the error&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_1C05D5DA.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_0950DC23.png" width="851" height="167" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;At first I was a bit stumped because this same query worked inside of LINQPad, which I know is using Linq-to-sql not Linq-to-Entities but they are close enough.&lt;/p&gt;  &lt;p&gt;After a bit of thinking and staring at the code I thought maybe it was the compiler warning about access to disposed closures when accessing the ‘db’ variable, but that was not the issue either.&amp;#160; &lt;/p&gt;  &lt;p&gt;For grins I decided to remove the .ToList() from my statement (making it look like below) and it simply worked.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_6CD3EA42.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_28275001.png" width="842" height="164" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;What I don’t understand really is WHY?&amp;#160; Does anyone out there know the reason why?&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69752" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/HidCFCTd3zo" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/05/18/entitycollection-or-entityreferece-error-in-ef-when-using-tolist.aspx</feedburner:origLink></item><item><title>Using TPL to access Async WCF Endpoints in ASP.net MVC</title><link>http://feedproxy.google.com/~r/Devlicious/~3/vhbxNQFVe0I/using-tpl-to-access-async-wcf-endpoints-in-asp-net-mvc.aspx</link><pubDate>Sun, 13 May 2012 20:07:37 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69746</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I am in the process of building out a internal portal/dashboard for our company which will allow us to get a status of what is going on behind the scenes in our application.&amp;#160; I want this site to utilize our existing WCF endpoint and as much existing code as possible.&amp;#160; When doing this I realized pretty quickly that I needed to create Async Controller actions to hit our async endpoints which was a first for me.&amp;#160; Of course the first thing I did was a quick Bing search to see if I could find some existing examples to help me a long.&amp;#160; However, every example I found assumed that we were using the automatically generated proxy to access our endpoints rather than spinning up the connection manually via ChannelFactory and the service interface.&amp;#160; Because I struggled to get this working I thought I would share my experiances in case others are having the same issue.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Our WCF Endpoint Definition &lt;/strong&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;    [ServiceContract]
    public interface IScheduledEventsService
    {
        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginScheduledEvents(ScheduledEventsRequest request, AsyncCallback callback, object state);
        Result&amp;lt;IList&amp;lt;ScheduledEvent&amp;gt;&amp;gt; EndScheduledEvents(IAsyncResult result);

    }&lt;/pre&gt;

&lt;p&gt;One thing to point out about the code above, the actual return value from our endpoint is a Result&amp;lt;T&amp;gt;.&amp;#160; The result class is a simple container envelope which provides us back some metadata, this is not something to worry about or to try to find online, you can simply ignore this for your needs&lt;/p&gt;

&lt;p&gt;My MVC controller definition 
  &lt;br /&gt;&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;public class ScheduledActivitiesController : AsyncController
{
        public Task&amp;lt;PartialViewResult&amp;gt; Listing()
        {            
            return Task.Factory
                .StartNew(() =&amp;gt; GetScheduleActivitiesAsync())
                .ContinueWith(x =&amp;gt; PartialView(&amp;quot;_Listing&amp;quot;, x.Result.ToList()));
        }

        private IList GetScheduleActivitiesAsync()
        {
            var baseUrl = ConfigurationManager.AppSettings[&amp;quot;BaseWcfServerUrl&amp;quot;];

            var channel = ChannelHelper.CreateFor&amp;lt;IScheduledEventsService&amp;gt;(baseUrl);

            var myTask = Task.Factory
                .FromAsync(channel.BeginScheduledEvents,
                           new Func&amp;lt;IAsyncResult, Result&amp;lt;IList&amp;lt;ScheduledEvent&amp;gt;&amp;gt;&amp;gt;(channel.EndScheduledEvents),
                           new ScheduledEventsRequest(), 
                           null, 
                           TaskCreationOptions.None);

            var taskResult = myTask.Result;

            return taskResult.ResultItem;            
        }
}&lt;/pre&gt;

&lt;p&gt;The above code is our entire controller (well at least the important parts her).&amp;#160; Please take note of 3 things&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Our controller inherits off of &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.asynccontroller.aspx"&gt;AsyncController&lt;/a&gt; which is required to do async controller actions in MVC &lt;/li&gt;

  &lt;li&gt;My return type is a Task&amp;lt;PartialView&amp;gt; for the action, this is required &lt;/li&gt;

  &lt;li&gt;In the .ContinueWith I am returning the correct PartialView w/ the data &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One thing I want to point out here is that when trying to get the .&lt;a href="http://msdn.microsoft.com/en-us/library/system.threading.tasks.taskfactory.fromasync.aspx"&gt;FromAsync&lt;/a&gt; logic to work I keep getting compiler warnings telling me about a mismatch.&amp;#160; This was because at first I was NOT declaring my two Func&amp;lt;T&amp;gt; and just assumed the compiler knew what I meant (guess not).&amp;#160; As soon as I actually defined my 2 Func&amp;lt;T&amp;gt; signatures (I have removed the first one as R# told me it was not needed and sure enough it was not) the compiler was happy.&lt;/p&gt;

&lt;p&gt;As you can see, once you make the compiler happy (pesky compiler) this is pretty straight forward.&amp;#160; Hope this helps someone.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69746" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/vhbxNQFVe0I" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/ASP.Net+MVC/default.aspx">ASP.Net MVC</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WCF/default.aspx">WCF</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/05/13/using-tpl-to-access-async-wcf-endpoints-in-asp-net-mvc.aspx</feedburner:origLink></item><item><title>Caliburn.Micro and MVVM on InfoQ</title><link>http://feedproxy.google.com/~r/Devlicious/~3/0ADtUfZ3N3U/caliburn-micro-and-mvvm-on-infoq.aspx</link><pubDate>Mon, 07 May 2012 17:06:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69736</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you are interested to hear some of the back story behind Caliburn.Micro&amp;hellip;or just curious about my own conception of MVVM and how it fits in with other popular UI design patterns, I hope you will &lt;a target="_blank" href="http://www.infoq.com/articles/Rob-Eisenberg-Caliburn"&gt;check out this interview on InfoQ&lt;/a&gt;.&amp;nbsp; As always, feedback is much appreciated. Happy Monday and have a blessed week &lt;img src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rob_5F00_eisenberg/wlEmoticon_2D00_smile_5F00_6BC217C5.png" alt="Smile" class="wlEmoticon wlEmoticon-smile" style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none;" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69736" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/0ADtUfZ3N3U" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Xaml/default.aspx">Xaml</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/MVVM/default.aspx">MVVM</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn+Micro/default.aspx">Caliburn Micro</category><feedburner:origLink>http://devlicio.us/blogs/rob_eisenberg/archive/2012/05/07/caliburn-micro-and-mvvm-on-infoq.aspx</feedburner:origLink></item><item><title>Using GridView ItemTemplate and ItemTemplateSelector at the same time</title><link>http://feedproxy.google.com/~r/Devlicious/~3/CrXs8ukjivE/using-gridview-itemtemplate-and-itemtemplateselector-at-the-same-time.aspx</link><pubDate>Fri, 04 May 2012 17:56:49 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69731</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you are building a XAML based WinRT application which uses a GridView it is very likely you are going to use an ItemTemplate style OR use the ItemTemplateSelector to determine which style to use.&amp;#160; This is great and using either of these could not be any easier.&amp;#160; HOWEVER, make sure you do not have both of them set at the same time in your XAML.&amp;#160; Because if you do use them both you will be left to wonder why your TemplateSelector code is NOT working, but your provided style is.&lt;/p&gt;  &lt;p&gt;As far as I can tell the ItemTemplate trumps the ItemTemplateSelector and your selector will NEVER get executed.&lt;/p&gt;  &lt;p&gt;You will want to either use just the ItemTemplate OR use the ItemTemplateSelector.&lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69731" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/CrXs8ukjivE" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WinRT/default.aspx">WinRT</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/05/04/using-gridview-itemtemplate-and-itemtemplateselector-at-the-same-time.aspx</feedburner:origLink></item><item><title>Render Action</title><link>http://feedproxy.google.com/~r/Devlicious/~3/hGPgW5MY1F0/render-action.aspx</link><pubDate>Mon, 30 Apr 2012 17:55:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69726</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;It&amp;#8217;s common for a single web page to include data from many sources. Consider this screen shot from &lt;a href="http://silk.codeplex.com/"&gt;Project Silk&lt;/a&gt;. There are four separate items displayed.&lt;/p&gt;

&lt;p&gt;&lt;img class="right" src="http://dev.bennage.com/images/posts/many-concerns.png" alt="" /&gt;&lt;/p&gt;

&lt;p&gt;The primary concern of the page is displaying a list of vehicles. However it also displays some statistics and a set of reminders. I labeled the stats and reminders as orthogonal because they are (in a sense) independent of the primary concern. Finally, there is the ambient data of the currently logged in user. I call this data ambient because we expect it to be present on all the pages in the application.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s a common practice in MVC-style applications to map a single controller action to a view. That is, it is the responsibility of a single action to produce everything that is needed to render a particular web page.&lt;/p&gt;

&lt;p&gt;The difficulty with this approach is that &lt;em&gt;other pages&lt;/em&gt; often need to render the same orthogonal data. Let&amp;#8217;s examine the code for the action invoked by &lt;code&gt;\vehicle\list&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public ActionResult List()
{
    AddCountryListToViewBag();

    var vehicles = Using&amp;lt;GetVehicleListForUser&amp;gt;()
        .Execute(CurrentUserId);

    var imminentReminders = Using&amp;lt;GetImminentRemindersForUser&amp;gt;()
        .Execute(CurrentUserId, DateTime.UtcNow);

    var statistics = Using&amp;lt;GetFleetSummaryStatistics&amp;gt;()
        .Execute(CurrentUserId);

    var model = new DashboardViewModel
                    {
                        User = CurrentUser,
                        VehicleListViewModel = new VehicleListViewModel(vehicles),
                        ImminentReminders = imminentReminders,
                        FleetSummaryStatistics = statistics
                    };

    return View(model);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Disregarding how you might feel about the &lt;code&gt;Using&amp;lt;T&amp;gt;&lt;/code&gt; method to invoke commands and other such details, I want you to focus on the fact that the controller is &lt;em&gt;composing&lt;/em&gt; a model. We generate a number of smaller viewmodels and then compose them into an instance of &lt;code&gt;DashboardViewModel&lt;/code&gt;. The class &lt;code&gt;DashboardViewModel&lt;/code&gt; only exists to tie together the four, otherwise independent data.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Personally, I prefer to avoid classes like &lt;code&gt;DashboardViewModel&lt;/code&gt; and simply rely on dynamic typing in the view. However, others feel strongly about having IntelliSense support in the view.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Project Silk had separate actions just to serve up JSON:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public JsonResult JsonList()
    {
        var list = Using&amp;lt;GetVehicleListForUser&amp;gt;()
            .Execute(CurrentUserId)
            .Select(x =&amp;gt; ToJsonVehicleViewModel(x))
            .ToList();

        return Json(list);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You&amp;#8217;ll notice that both &lt;code&gt;JsonList&lt;/code&gt; and &lt;code&gt;List&lt;/code&gt; use the same &lt;code&gt;GetVehicleListForUser&lt;/code&gt; command for retrieving their data. &lt;code&gt;JsonList&lt;/code&gt; also projected the data to a slightly different viewmodel.&lt;/p&gt;

&lt;h2&gt;Reducing the Code&lt;/h2&gt;

&lt;p&gt;While reevaluating this code for &lt;a href="https://github.com/liike/"&gt;Project Liike&lt;/a&gt;, we decided to employ &lt;a href="http://en.wikipedia.org/wiki/Content_negotiation"&gt;content negotiation&lt;/a&gt;. That is, we wanted a single endpoint, such as &lt;code&gt;\vehicle\list&lt;/code&gt;, to return different representations of the data based upon a requested format. If the browser requested JSON, then &lt;code&gt;\vehicle\list&lt;/code&gt; should return a list of the vehicles in JSON. If the browser requested markup, then the same endpoint should return HTML.&lt;/p&gt;

&lt;p&gt;First, we needed to eliminate the differences between the JSON viewmodel and the HTML viewmodel. Without going deep into details, this wasn&amp;#8217;t hard to do. In fact, it revealed that we had some presentation logic in the view that should not have been there. The real problem was that I wanted the action to look more like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public ActionResult List()
{
    var vehicles = Using&amp;lt;GetVehicleListForUser&amp;gt;()
        .Execute(CurrentUserId);

    return new ContentTypeAwareResult(vehicles);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Only, the view still needed the additional data of statistics and reminders. How should the view get it?&lt;/p&gt;

&lt;p&gt;We decided to use &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.html.childactionextensions.renderaction.aspx"&gt;RenderAction&lt;/a&gt;. RenderAction allows a view to invoke another action and render the results into the current view.&lt;/p&gt;

&lt;p&gt;We needed to break out the other concerns into their own actions. For the sake of example, we&amp;#8217;ll assume they are both on the &lt;code&gt;VehicleController&lt;/code&gt; and named &lt;code&gt;Reminders&lt;/code&gt; and &lt;code&gt;Statistics&lt;/code&gt;. Each of these action would be responsible for getting a focused set of data. Then in the (imaginary) view for &lt;code&gt;List&lt;/code&gt; we could invoke the actions like so:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// List.cshtml 
&amp;lt;ul&amp;gt;
@foreach (var vehicle in Model)
{
    &amp;lt;li&amp;gt;@vehicle.Name&amp;lt;/li&amp;gt;
}
&amp;lt;/ul&amp;gt;

&amp;lt;section role=&amp;quot;reminders&amp;quot;&amp;gt;
@{ Html.RenderAction( &amp;quot;Reminders&amp;quot;, &amp;quot;Vehicle&amp;quot;) }
&amp;lt;/section&amp;gt;

&amp;lt;section role=&amp;quot;statistics&amp;quot;&amp;gt;
@{ Html.RenderAction( &amp;quot;Statistics&amp;quot;, &amp;quot;Vehicle&amp;quot;) }
&amp;lt;/section&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Note that each action has it&amp;#8217;s on associated view.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The value of using RenderAction is that we where able to create very simple actions on our controllers. We were also able to reuse the actions for rendering both markup and JSON.&lt;/p&gt;

&lt;p&gt;A secondary benefit is the separation of concerns. For example, because we moved the responsibility of composition from the controller into the view, a designer could now revise the view for the &lt;code&gt;\vehicle\list&lt;/code&gt; without needing to touch the code. They could remove any of the orthogonal concerns or even add new ones without introducing any breaking changes.&lt;/p&gt;

&lt;h2&gt;The Downside&lt;/h2&gt;

&lt;p&gt;There are a few caveats with this approach.&lt;/p&gt;

&lt;p&gt;First, don&amp;#8217;t confuse RenderAction with &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.html.renderpartialextensions.renderpartial.aspx"&gt;RenderPartial&lt;/a&gt;. RenderAction is for invoking a completely independent action, with its own view and model. RenderPartial is simply for renders a view based on a model passed to it (generally derived from the main viewmodel).&lt;/p&gt;

&lt;p&gt;Secondly, avoid using RenderAction to render a form. It&amp;#8217;s likely won&amp;#8217;t work the way you&amp;#8217;d expect.This means that any form rendering will need to occur in your primary view.&lt;/p&gt;

&lt;p&gt;Thirdly, using RenderAction breaks the &lt;a href="http://en.wikipedia.org/wiki/Model-view-controller#Overview"&gt;model-view-controller&lt;/a&gt; pattern. What I mean is that, in MVC, it&amp;#8217;s assumed that the view does nothing more than render a model. Controllers invoke a view, and not vice versa. Using RenderAction breaks this rule. Personally, I have no problem breaking the rule when it results in code that is more simple and more easily maintained. Isn&amp;#8217;t that the whole &lt;a href="http://dev.bennage.com/blog/2008/03/30/the-roots-of-best-practices/"&gt;point of best practices&lt;/a&gt; anyway?&lt;/p&gt;


&lt;em&gt;Comment on this post at &lt;a href="http://dev.bennage.com/blog/2012/04/27/render-action/"&gt;dev.bennage.com&lt;/a&gt;&lt;/em&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69726" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/hGPgW5MY1F0" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/web/default.aspx">web</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/asp.net+mvc/default.aspx">asp.net mvc</category><feedburner:origLink>http://devlicio.us/blogs/christopher_bennage/archive/2012/04/30/render-action.aspx</feedburner:origLink></item><item><title>Incorrect Image Format Error --  x86 vs x64 vs Any CPU</title><link>http://feedproxy.google.com/~r/Devlicious/~3/luXA8QvixzE/incorrect-image-format-error-x86-vs-x64-vs-any-cpu.aspx</link><pubDate>Wed, 25 Apr 2012 15:23:42 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69715</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;Today I was trying to wrap one of our .dll projects in a wcf endpoint and ran into an odd issue that took 3 hours to resolve and the mad skills of my co-worker &lt;a href="http://blog.sublogic.com/"&gt;James&lt;/a&gt; to help resolve.&lt;/p&gt;  &lt;p&gt;Long story short, when I would F5 my web project which was hosting our WCF endpoints I would get the following message in the browser.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_68167460.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_58B2EC84.png" width="644" height="89" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Of course when I got this I immediately jumped to the referencing project and made sure I had referenced all the needed child assemblies.&amp;#160; When this checked out I then jumped to the BIN folder to make sure they were copied correctly, they were.&amp;#160; When THIS failed I fired up Just Decompile to ensure that the version of the assemblies were right… All of this lead me NO WHERE.&lt;/p&gt;  &lt;p&gt;Now that I have done the typical checks I resorted to firing up the Fusion Log viewer with hopes that this would help… Yea that did nothing….&lt;/p&gt;  &lt;p&gt;At this point I was beating my head against the desk, this was also the point that I enlisted the skills and knowledge of James.&amp;#160; As we were talking through the problem and looking around we made our way over to the project properties of the dll I was referencing.&amp;#160; When looking over the properties James noticed that my target platform was x86 (seen below), &lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_30A03D65.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_570220B0.png" width="360" height="44" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;which immediately sent up the red flag for him (it did nothing for me).&amp;#160; Of course the question of ‘why is this x86’ was asked to which I answered ‘I don’t know’ but I did know the that project was originally a console app project prior to being switched to a library project…. Ding, Ding, Ding….&amp;#160; Console apps are set to x86 by default not Any CPU.&lt;/p&gt;  &lt;p&gt;Once we changed it to Any CPU and recompiled my issues were resolved (seen below)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_4F76B143.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_01021ED9.png" width="360" height="39" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The moral of the story is that if you get the ‘bad image’ error make sure you are not trying to reference an x86 assembly in your x64 projects.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69715" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/luXA8QvixzE" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net/default.aspx">.Net</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/ASP.Net+MVC/default.aspx">ASP.Net MVC</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WCF/default.aspx">WCF</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/04/25/incorrect-image-format-error-x86-vs-x64-vs-any-cpu.aspx</feedburner:origLink></item><item><title>EF + Overriding Equals == Massive headache</title><link>http://feedproxy.google.com/~r/Devlicious/~3/QUo5Ot0ClA0/ef-overriding-equals-massive-headache.aspx</link><pubDate>Tue, 24 Apr 2012 09:46:50 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69710</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;Do you ever have one of those ‘Doh’ days?&amp;#160; One of those days where you spend like 6 hours trying to replicate a bug simply so you can debug it.&amp;#160; One of those days you wish you could have back?&amp;#160; Well I had one of those last week, let me explain.&lt;/p&gt;  &lt;p&gt;Recently I was trying to debug an issue where when I would add an instance of an object to the db contenxt sometimes it would take it and sometimes it would not.&amp;#160; I tried for hours to replicate the exact steps so I could narrow down the issue but was not able to.&amp;#160; Here is what I was essentially doing.&lt;/p&gt;  &lt;p&gt;dbContext.MyCollection.Add( instance1 );    &lt;br /&gt;dbContext.MyCollection.Add( instance2 );     &lt;br /&gt;dbContext.MyCollection.Add( instance3 );     &lt;br /&gt;&lt;em&gt;&lt;font size="1"&gt;(of course my logic was not like this in the actual code, but it did boil down to this)&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;At the end of my 3 adds I would do dbContext.MyCollection.Count and expect to see 3, but in almost ALL cases I would get&amp;#160; a 1, color me perplexed.&amp;#160; To make it even more perplexing for me is that after each .Add I would check .EntityState of the newly added instance and in EVERY case it was NEW.&amp;#160; I would also hashcode for each instance to ensure they were different and as you may have guessed they were….. WTF&lt;/p&gt;  &lt;p&gt;Fast forward a few more hours of my swearing like a drunk sailor, beating my head on my desk I decided to chat with a co-worker of mine whose knowledge in EF is order of magnitude larger than mine.&amp;#160; Although he did not know the direct reason for my pain he did make a magic assertion which lead me to remember something I did a few weeks back.&amp;#160; He said,&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Well when you add an instance to the collection EF will essentially just check that object for equality versus all the other objects in the collection to make sure they were different.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The minute he finished that sentence the ‘ah &lt;a href="mailto:F@CK&amp;rsquo;"&gt;F@CK’&lt;/a&gt; bomb went off in my head.&amp;#160; See a few weeks prior, during very early development of this feature I had this brilliant idea that I needed to override the .Equals() method on my entity objects (yea I know, that was dumb) so I did.&amp;#160; However, as my logic matured over time the .Equals did not keep up because at some point I had realized that I did not need to override that but I was entirely to lazy to delete my overridden method, oh that came back to hurt.&lt;/p&gt;  &lt;p&gt;As soon as I realized that this may be the issue I blew away the .Equals() along with my override of GetHashCode() (which actually was simply a pass through to the base implementation) and what do you know, everything simply worked.&lt;/p&gt;  &lt;p&gt;The moral of the story here is that when dealing with EF (or any ORM for that matter) I would highly suggest you do not override the .Equals() on your objects, unless you like pain and suffering&lt;/p&gt;  &lt;p&gt;till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69710" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/QUo5Ot0ClA0" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/04/24/ef-overriding-equals-massive-headache.aspx</feedburner:origLink></item><item><title>The Manifold Blunders of Xaml–Part 1: Version and Platform Hell</title><link>http://feedproxy.google.com/~r/Devlicious/~3/CD_oHjPJWys/the-manifold-blunders-of-xaml-part-1-version-and-platform-hell.aspx</link><pubDate>Wed, 18 Apr 2012 15:43:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69682</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>22</slash:comments><description>&lt;p&gt;I started work with &amp;ldquo;Xaml-based&amp;rdquo; platforms in the pre-Beta days of WPF, so I&amp;rsquo;ve been working with this technology longer than most. Back then I was utterly awed and inspired by it&amp;rsquo;s capabilities. Today I&amp;rsquo;m frustrated and sometimes outraged. As I&amp;rsquo;ve traveled to various conferences, worked with various companies and interacted with the many &lt;a href="http://caliburnmicro.codeplex.com/discussions" target="_blank"&gt;Caliburn.Micro&lt;/a&gt; users, I&amp;rsquo;ve discovered that I&amp;rsquo;m not the only one who feels this way. This blog series attempts to catalog a number of the issues, some of which have been there from the very beginning; others creeping in over time. This is an aggregate of my own observations and those of the community.&lt;/p&gt;
&lt;h2&gt;Versions &lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s take a brief stroll through the platform timeline:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2006 &amp;ndash; WPF 3.0 &lt;/li&gt;
&lt;li&gt;2007 &amp;ndash; Silverlight 1 &lt;/li&gt;
&lt;li&gt;2007&amp;ndash; WPF 3.5 &lt;/li&gt;
&lt;li&gt;2008 &amp;ndash; Silverlight 2 &lt;/li&gt;
&lt;li&gt;2008 &amp;ndash; WPF3.5 sp1 &lt;/li&gt;
&lt;li&gt;2009 &amp;ndash; Silverlight 3 &lt;/li&gt;
&lt;li&gt;2010 - Silverlight 4 &lt;/li&gt;
&lt;li&gt;2010 &amp;ndash; WP7 &lt;/li&gt;
&lt;li&gt;2010 &amp;ndash; WPF4.0 &lt;/li&gt;
&lt;li&gt;2011 &amp;ndash; Silverlight 5 &lt;/li&gt;
&lt;li&gt;2011 &amp;ndash; WP7 Mango &lt;/li&gt;
&lt;li&gt;2011 &amp;ndash; Lakeshore&lt;sup&gt;1&lt;/sup&gt; &lt;/li&gt;
&lt;li&gt;2012 &amp;ndash; WinRT/Metro&lt;sup&gt;2&lt;/sup&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If we focus on the platforms and ignore their various versions, we have something like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2006 &amp;ndash; WPF &lt;/li&gt;
&lt;li&gt;2007 Silverlight 1.0 (no CLR) &lt;/li&gt;
&lt;li&gt;2008 &amp;ndash; Silverlight 2.0 (CLR) &lt;/li&gt;
&lt;li&gt;2010 &amp;ndash; WP7 &lt;/li&gt;
&lt;li&gt;2011 &amp;ndash; Lakeshore &lt;/li&gt;
&lt;li&gt;2012 &amp;ndash; WinRT/Metro &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, it appears that Microsoft has released a new UI platform at least every two years! Let&amp;rsquo;s contrast that to the timeline for pre-Xaml UI technologies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1985?&amp;ndash; Win16 &lt;/li&gt;
&lt;li&gt;1995 &amp;ndash; Win32 &lt;/li&gt;
&lt;li&gt;2001 &amp;ndash; WinForms &lt;/li&gt;
&lt;li&gt;2006 &amp;ndash; WPF &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Interesting. We have at least 5 &amp;ndash; 6 years between platforms prior to Xaml, but it&amp;rsquo;s actually about 10yrs due to the fact that WinForms is just making Win32 available to managed languages. It&amp;rsquo;s just a wrapper around existing APIs. Each of the Xaml platforms is actually a different runtime altogether. So as far as platforms go, we&amp;rsquo;ve gone from one every 10yrs to one every 2 years. But that&amp;rsquo;s not all, let&amp;rsquo;s look at Xaml itself:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2006 &amp;ndash; Xaml 2006 Spec &lt;/li&gt;
&lt;li&gt;2008 &amp;ndash; Silverlight 1 Xaml &lt;/li&gt;
&lt;li&gt;2009 &amp;ndash; Xaml 2009 Spec &lt;/li&gt;
&lt;li&gt;2011 &amp;ndash; Silverlight 5 Xaml &lt;/li&gt;
&lt;li&gt;2012 &amp;ndash; WinRT/Metro Xaml &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Aside from the actual platforms released, we have a parallel divergence in Xaml markup capabilities. In 2006 the first version of Xaml was released. It was &lt;a href="http://msdn.microsoft.com/en-us/library/dd361852(v=prot.10).aspx" target="_blank"&gt;formally defined and released as a spec&lt;/a&gt; shortly after. When Silverlight came along, Microsoft failed to create a Xaml language compatible with their own specification. In fact, even Silverlight 5 doesn&amp;rsquo;t comply with the Xaml 2006 spec. In 2009 Microsoft released a new version of Xaml that fixed several important shortcomings with the 2006 spec&amp;hellip;.but not a single platform implemented it. WP7 is still playing catch-up with Silverlight and WPF. WinRT/Metro Xaml has less Xaml features than any platform. Furthermore, it significantly changes some aspects of Xaml altogether, making it compatible with almost nothing. Furthermore, some of the changes they are making will prevent it from ever becoming compatible in the future.&lt;/p&gt;
&lt;p&gt;When I step back and try to look at this information objectively, the most natural conclusion I can come to is that Microsoft UI technologies are, and have been for the last five years, in a state of complete &lt;em&gt;&lt;strong&gt;instability&lt;/strong&gt;&lt;/em&gt;&amp;hellip;and it doesn&amp;rsquo;t show any signs of change (esp. with the rumors that WP8 will not use Silverlight, but some &lt;em&gt;variant&lt;/em&gt; of WinRT). You can&amp;rsquo;t count on anything. If we forget about app developers for a moment, and think about the ecosystem, imagine the effect this has on third party products, control vendors, open source frameworks and tooling. Every time MS spits out a new platform or Xaml flavor, the entire ecosystem has to start over. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;My own Experience&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I first wrote Caliburn for WPF when there was no word on anything like Silverlight existing. When Silverlight was first announced, it was branded WPF/e so I thought my framework would port. Unfortunately, when SL2 was made available, there were so many differences that I had no choice but to completely re-write Caliburn. Then, when WP7 was announced, I started porting Caliburn to that, only to discover that it was &lt;em&gt;not possible&lt;/em&gt;. So, I did another complete re-write resulting in Caliburn.Micro. Now we have WinRT/Metro. I &lt;em&gt;think&lt;/em&gt; I can port it, albeit, with a ton of conditional code. But, I&amp;rsquo;m not 100% sure yet. If it looks like another re-write&amp;hellip;I&amp;rsquo;m done with this game.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Maintenance and Innovation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are lots of negative side-effects to this sort of instability. The one that hits me most is that it creates a battle between maintenance and innovation. Again, speaking of my own project, I have plenty of ideas about how to improve Caliburn.Micro. I think some of them are minor niceties, but others are more along the innovative lines. But, you will never see any of them come to fruition. Why? Because the instability of the underlying platform, the constant release of new platforms&amp;hellip;has put my project into a state of &lt;em&gt;&lt;strong&gt;perpetual maintenance&lt;/strong&gt;&lt;/em&gt;. I can&amp;rsquo;t innovate because I&amp;rsquo;m still trying to deal with the differences in WP7.5 and I&amp;rsquo;ve got developers (who can blame them?) banging down my door wanting to know when WinRT/Metro version will be available. It&amp;rsquo;s been discussed much in recent years as to why innovation seams to happen in non-Microsoft open source and on other platforms like Mac&amp;hellip;while very little happens in Windows software. Could it be because we are spending our time re-writing everything every two years? and don&amp;rsquo;t have time to develop anything forward thinking?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Careless and Arbitrary&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Sadly, many of the API and Xaml differences were completely avoidable. I remember one particular bug I had in Caliburn. It resulted from the fact that List&amp;lt;T&amp;gt;.Remove was implemented differently between WPF and Silverlight. In a particular scenario it would work fine on one platform and crash your app on another. There are hundreds, probably thousands of such issues, from the BCL all the way up through the UI stack.&amp;nbsp; We aren&amp;rsquo;t talking about missing features here. We are talking about the same features which exhibit different behavior or have altered APIs.&amp;nbsp; Sure, Microsoft worked hard to improve this with successive releases of Silverlight. But then came WP7, which stepped us back in time. Now look at WinRT. There are a number of changes that are completely arbitrary. They serve no technical purpose and don&amp;rsquo;t improve the API. They just make more work for developers who want to port code. If you want another fine example, just try to write a cross-framework design mode check.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A Lack of Understanding&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Sigh. This one perfectly ironic issue really troubles me sometimes. Through all of this, I&amp;rsquo;ve realized that Microsoft doesn&amp;rsquo;t understand their own platform. I&amp;rsquo;ve got more to say on this later, but let&amp;rsquo;s look at this from an API perspective here. Consider this: every control specific to WP7 development could have been built on top of Silverlight without a need for a modified runtime. Most controls could have been implemented simply by styling an existing control or applying a template. For example, the Pivot control can be implemented using a tab control with a custom template and some attached behaviors. In fact, wouldn&amp;rsquo;t it have been cool if you could just use a Tab control in WP7 and it just changed it&amp;rsquo;s appearance to work on the phone?! Wait, wasn&amp;rsquo;t that the idea behind templating and adaptive layout to begin with? Here&amp;rsquo;s another example: Behaviors. Perhaps you didn&amp;rsquo;t know that Microsoft built this twice? In WPF there were Triggers. In fact, in both WPF and the Blend behavior system, there is a class called TriggerBase. They have the same name! They do the same thing! But, you can&amp;rsquo;t create custom triggers or actions in WPF because the ctor is marked internal. Did it not occur to anyone that they should just remove that instead of re-inventing the wheel? As a result, we now have two methods of doing triggers, and you have to know which to use for what. It&amp;rsquo;s even true in Silverlight, which has limited support for &amp;ldquo;traditional&amp;rdquo; triggers, but does have some. Ridiculous. I could go on and on about the types of internal and cross-platform inconsistencies MS has created by not simply understanding the core capabilities of their own framework.&lt;/p&gt;
&lt;p&gt;All of this get&amp;rsquo;s really interesting if you consider that Mac is the platform that is considered most cutting edge and innovative in terms of UX&amp;hellip;and they&amp;rsquo;ve scarcely had any major breaking changes since 2002. Considering that their phone apps run on their tablet and they are porting a number iOS features back to OSX&amp;hellip;it must be nice only having to worry about two platforms and knowing that the OS vendor is making a visible, tangible effort to unify those two platforms&amp;hellip;..but I&amp;rsquo;m getting off topic now.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End of Part One&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are lots of problems with Xaml, but I chose to start this series with one of my particular pain points. Some developers neither care nor are affected (yet) by these sorts of version issues, but they have a big effect on the surrounding ecosystem and are going to be with us for the next decade. Over the next several blog posts, we&amp;rsquo;ll discuss many other problems, some technical, some not so much, but all have been singled out by multiple members of the community (read: not just me) as problems. It is my hope that Microsoft employees working on these technologies will read this and seriously consider what they can do to improve things going forward or at least not perpetuate the same mistakes again. I also hope that .NET developers will take a long, hard look at this part of the platform and make an honest valuation of its strengths and weaknesses.&lt;/p&gt;
&lt;h3&gt;Footnotes&lt;/h3&gt;
&lt;p&gt;1. Lakeshore is the name I&amp;rsquo;ve been hearing thrown around for the Xaml-runtime for XBox, which sources say is Silverlight-based, but drastically altered. I have no official word from Microsoft on this. It&amp;rsquo;s just what I heard through the grapevine, though I&amp;rsquo;m fairly confident in the accuracy of the information. Supposedly this is what is powering the &amp;ldquo;apps&amp;rdquo; in the new XBox dashboard which was released around last Thanksgiving. &amp;nbsp;EDIT: Apparently the XBox version is called Lakeview not Lakeshore.&lt;/p&gt;
&lt;p&gt;2. I don&amp;rsquo;t actually know when WinRT/Metro will be released. I imagine that 2012 is a reasonable guess.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69682" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/CD_oHjPJWys" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF/default.aspx">WPF</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.0/default.aspx">.NET 3.0</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Xaml/default.aspx">Xaml</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/databinding/default.aspx">databinding</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WPF_2F00_e/default.aspx">WPF/e</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/.NET+3.5/default.aspx">.NET 3.5</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn/default.aspx">Caliburn</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/RIA/default.aspx">RIA</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/UI+Architecture/default.aspx">UI Architecture</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Caliburn+Micro/default.aspx">Caliburn Micro</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/WP7/default.aspx">WP7</category><feedburner:origLink>http://devlicio.us/blogs/rob_eisenberg/archive/2012/04/18/the-manifold-blunders-of-xaml-part-1-version-and-platform-hell.aspx</feedburner:origLink></item><item><title>Working with Image Paths in WinRT–Something odd here</title><link>http://feedproxy.google.com/~r/Devlicious/~3/N3smoeLybbM/working-with-image-paths-in-winrt-something-odd-here.aspx</link><pubDate>Mon, 16 Apr 2012 10:25:25 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69672</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Over the weekend I was pounding away at my first ‘WinRT’ application which I plan to submit to the marketplace.&amp;#160; During this process I ran into some really odd issues with getting images to display in the UI at runtime.&lt;/p&gt;  &lt;p&gt;Let me explain my issue:&lt;/p&gt;  &lt;p&gt;I had images which were nested inside my Assets folder as below:    &lt;br /&gt;/Assets     &lt;br /&gt;&amp;#160; -&amp;gt; /Category     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -&amp;gt; /Animals     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -&amp;gt; horse.png&lt;/p&gt;  &lt;p&gt;These images were being bound to a view which was not in the root of the solution but rather in a views folder as below:    &lt;br /&gt;/Views     &lt;br /&gt;&amp;#160; -&amp;gt; /Gameboard.xaml&lt;/p&gt;  &lt;p&gt;Originally I was trying to use binding to the Image control to a ImageSource property.&amp;#160; In my ImageSource property I was doing something like below&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;public ImageSource Image
{
	get
	{
		var uri = new Uri(&amp;quot;ms-appx:///Assets/Category/Animals/horse.png&amp;quot;);
		return new Bitmapimage(uri);
	}
}&lt;/pre&gt;

&lt;p&gt;When I would put a break point in the property everything appeared right, however when I would bind to the UI no image would show up.&amp;#160;&amp;#160;&amp;#160; I then tried to play with the URI path by adding ../ by putting the full ‘pack’ uri in there but nothing seemed to work.&amp;#160; To prove that the image was NOT loading I also hooked up the ImageFailed event to the image control and of course that was helpful by providing a ‘network error’ value (that was helpful).&lt;/p&gt;

&lt;p&gt;**** Note **** 
  &lt;br /&gt;I knew the logic above was give-or-take valid because when I changed it too use an image in the root of the Assets folder everything worked just fine 

  &lt;br /&gt;**** Note ****&lt;/p&gt;

&lt;p&gt;After over an hour and a half of trying everything I could think of I decided to screw binding to an ImageSource and bind directly to the string value for the path.&amp;#160; &lt;/p&gt;

&lt;pre class="c#" name="code"&gt;public string Image
{
	get
	{
		return &amp;quot;../Assets/Category/Animals/horse.png&amp;quot;;
	}
}&lt;/pre&gt;

&lt;p&gt;When I changed my UI to bind to the new property everything magically worked as expected.&lt;/p&gt;

&lt;p&gt;I am not sure if I was doing something wrong (likely the case) or if there is some hidden bug in WinRT, but I was able to get everything working.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69672" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/N3smoeLybbM" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WinRT/default.aspx">WinRT</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/04/16/working-with-image-paths-in-winrt-something-odd-here.aspx</feedburner:origLink></item><item><title>Last Post</title><link>http://feedproxy.google.com/~r/Devlicious/~3/ZVXnf0z2rLc/personal-blog.aspx</link><pubDate>Tue, 10 Apr 2012 18:03:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69654</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I was invited to join Devlicious a few years ago by Jak and Brendan and very thankful for the opportunity. During this time, I have cross-posted some of my posts on both my &lt;a href="http://hadihariri.com"&gt;personal site&lt;/a&gt; as well as here, and have found that as a result, conversations become segregated; somewhat expected. &lt;/p&gt;
&lt;p&gt;As grateful as I am of the the privilege of being part of this great community, I value greatly conversations that arise from posts, and prefer to keep them in one place. It is easier for me, as well as you, dear reader.&amp;nbsp;For this reason, I&amp;#39;ll no longer be posting on here. If you&amp;#39;d like to continue the conversations, &lt;a href="http://hadihariri.com"&gt;find me at my blog&lt;/a&gt;. I&amp;#39;d love for you to join&amp;nbsp;the recent one about &lt;a href="http://hadihariri.com/2012/04/09/dealing-wht-the-too-many-dependencies-problem/"&gt;Dealing with Too many dependencies&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once again, thank you to Jak, Brendan, and the entire Devlicious community, including my fellow bloggers. And most importantly, thank &lt;i&gt;you&lt;/i&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69654" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/ZVXnf0z2rLc" height="1" width="1"/&gt;</description><feedburner:origLink>http://devlicio.us/blogs/hadi_hariri/archive/2012/04/10/personal-blog.aspx</feedburner:origLink></item><item><title>GridView SelectedItem Binding Gotcha in WinRT</title><link>http://feedproxy.google.com/~r/Devlicious/~3/Y1C7jb-UieM/gridview-selecteditem-binding-gotcha-in-winrt.aspx</link><pubDate>Tue, 10 Apr 2012 08:32:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69653</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Last night when I was doing some WinRT hacking I was trying to setup databinding to the selected item in the GridView control and I ran into a gotcha that I thought I would share.&lt;/p&gt;  &lt;p&gt;First, I was using the ‘Split Application’ template for my C# project.&amp;#160; This is important because this template will create a bunch to boiler plate code for you and I was taking this code and extending it.&lt;/p&gt;  &lt;p&gt;When I was setting up my SelectedItem binding had had the following Xaml&lt;/p&gt;  &lt;p&gt;&amp;lt;GridView SelectedItem={Binding SelectedDashboardOption, Mode=TwoWay} …… /&amp;gt;&lt;/p&gt;  &lt;p&gt;When I ran the app everything ran fine but when I selected an item nothing happened.&amp;#160; I quickly noticed what I thought was the issue, I had not enabled selection in the grid, aka SelectionMode=Single, so I added that.&amp;#160; This made my Xaml look like:&lt;/p&gt;  &lt;p&gt;&amp;lt;GridView SelectedItem={Binding SelectedDashboardOption, Mode=TwoWay} SelectionMode=”Single” …… /&amp;gt;&lt;/p&gt;  &lt;p&gt;I gave this a spin but nothing…..&lt;/p&gt;  &lt;p&gt;Then I had a thought, maybe the bindings which allowed the Item to be clicked was causing this, turns out I was right.&amp;#160; The boiler plate code does not use MVVM (a real shame and IMO this needs to be addressed by MS) but rather click events.&amp;#160; This meant that the following attributes were set by default for the GridView via the template.&lt;/p&gt;  &lt;p&gt;&amp;lt;GridView …… IsItemClickEnabled=”True” ItemClick=”ItemView_ItemClick” ….. /&amp;gt;&lt;/p&gt;  &lt;p&gt;All told my Xaml was both setup to handling SelectedItem binding AND the click event.&amp;#160; Turns out this is not allowed and will not allow your binding to work.&lt;/p&gt;  &lt;p&gt;To solve my issue I simply removed the IsItemClickEnabled and ItemClick attributes and the now I could get the binding for SelectedItem to work.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69653" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/Y1C7jb-UieM" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WinRT/default.aspx">WinRT</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/04/10/gridview-selecteditem-binding-gotcha-in-winrt.aspx</feedburner:origLink></item><item><title>Working with Tiles for Windows Metro Applications</title><link>http://feedproxy.google.com/~r/Devlicious/~3/RESXWsmUKrM/working-with-tiles-for-windows-metro-applications.aspx</link><pubDate>Sat, 31 Mar 2012 14:35:06 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69635</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;When building a Windows Metro (aka Windows 8) application it is important that your application have a nice looking tile.&amp;#160; It is also encouraged to enable your tile to be ‘live’, meaning it can update itself with content based on some event, if that is relevant to your application.&amp;#160; When you create your tile you can decide to have either a small tile which is 150px x 150px (this takes up one column in the UI) or to have a large tile which is 310px x 150px (this takes up 2 horizontal columns in the UI).&amp;#160; It is up to you to decide if you to support only the small, only the large or both.&amp;#160; Fortunately for you associating the images used could not be simpler.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Open the Package.appxmanifest &lt;/li&gt;    &lt;li&gt;Open the Application UI tab &lt;/li&gt;    &lt;li&gt;Provide an image in the correct logo box      &lt;br /&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/LogoTextBox_5F00_0373ED3F.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="LogoTextBox" border="0" alt="LogoTextBox" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/LogoTextBox_5F00_thumb_5F00_17F93CBD.png" width="644" height="115" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;If you only provide a small logo you will only have that option on the Start screen.&amp;#160; If you only provide a wide logo that will be the one which is used.&amp;#160; If you provide both, the wide will be used by default, but the user can switch to the small if they want.&lt;/p&gt;  &lt;p&gt;Here are the logo’ used in the image above (remember I am NOT a graphic designer &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/wlEmoticon_2D00_smile_5F00_42656DDA.png" /&gt; )&lt;/p&gt;  &lt;p&gt;Small:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/PearsonTiles_5F00_150x150_5F00_621447A2.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="PearsonTiles_150x150" border="0" alt="PearsonTiles_150x150" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/PearsonTiles_5F00_150x150_5F00_thumb_5F00_01C3216B.png" width="154" height="154" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Wide:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/PearsonTiles_5F00_3100x150_5F00_164870E9.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="PearsonTiles_3100x150" border="0" alt="PearsonTiles_3100x150" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/PearsonTiles_5F00_3100x150_5F00_thumb_5F00_7CE06DAE.png" width="244" height="120" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69635" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/RESXWsmUKrM" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/XAML/default.aspx">XAML</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WinRT/default.aspx">WinRT</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/03/31/working-with-tiles-for-windows-metro-applications.aspx</feedburner:origLink></item><item><title>CSharp.Target errors when using a Developer Preview version of a Metro Library</title><link>http://feedproxy.google.com/~r/Devlicious/~3/hnSB82BThyo/csharp-target-errors-when-using-a-developer-preview-version-of-a-metro-library.aspx</link><pubDate>Sun, 25 Mar 2012 13:19:02 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69614</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;When I finally got around to upgrading my Build tablet to run the Consumer Preview of both Windows 8 and VS 11 I immediately ran into an issue when trying to attach a ‘legacy’ VS11 project from the Developer Preview version to a new project using the Consumer preview.&lt;/p&gt;  &lt;p&gt;The error I received can be seen below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/ErrorMessage_5F00_3D22EEDD.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="ErrorMessage" border="0" alt="ErrorMessage" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/ErrorMessage_5F00_thumb_5F00_35977F70.png" width="501" height="241" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Turns out the problem is easy to solve.&amp;#160; Open up the offending csproj file and look for the line which looks like:&lt;/p&gt;  &lt;p&gt;&amp;lt;Import Project=&amp;quot;$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v1.0\Microsoft.Windows.UI.Xaml.CSharp.targets&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p&gt;Replace the line with&lt;/p&gt;  &lt;p&gt;&amp;lt;Import Project=&amp;quot;$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets&amp;quot; /&amp;gt;&lt;/p&gt;  &lt;p&gt;Once you replace the line you should be able to add the existing project as expected.&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69614" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/hnSB82BThyo" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net+IDE/default.aspx">.Net IDE</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Visual+Studio+11/default.aspx">Visual Studio 11</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/03/25/csharp-target-errors-when-using-a-developer-preview-version-of-a-metro-library.aspx</feedburner:origLink></item><item><title>VS11, Silverlight and Ria Services Command line build issue (MSB4006)</title><link>http://feedproxy.google.com/~r/Devlicious/~3/PkkxZJwhDE4/vs11-silverlight-and-ria-services-command-line-build-issue-msb4006.aspx</link><pubDate>Tue, 20 Mar 2012 14:43:22 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69607</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I just upgraded my dev laptop to Vs11 and all was great with the world….. Until I ran my command line build script on my Silverlight project.&amp;#160; When my script failed with the following error I was perplexed because of course everything ran fine from INSIDE VS &lt;/p&gt;  &lt;p&gt;&amp;#160; C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets(289,9): error   &lt;br /&gt; MSB4006: There is a circular dependency in the target dependency graph involving target &amp;quot;CopySilverlightApplications&amp;quot;. [C:\    &lt;br /&gt;Development\Source\\Main\Website\Thunderbird\ThunderbirdServer\ThunderbirdServer.csproj]&lt;/p&gt;  &lt;p&gt;At first I tried to diff the Microsoft.WebApplication.targets file to see what changed there but nothing looked out of place…hum.&lt;/p&gt;  &lt;p&gt;Finally when chatting about this issue with a co-worker it dawned on me what my issue was.&amp;#160; Our silverlight project uses RIA Services and because of this there is technically a circular dependency between the web project and the client project.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;How?&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The client knows about the server because the RIA services end points are created inside the web project and post build the client side RIA endpoints are pushed into the Client project.&lt;/p&gt;  &lt;p&gt;The server knows about the client because as a silverlight project we had the server setup to copy the .xap file into the ClientBin folder&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;How did I resolve this?&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I removed the Silverlight copy dependency inside my server project as seen below&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_522D6005.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_38C55CCB.png" width="659" height="82" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I added a post build event inside my Silverlight client project do xcopy the .xap into the correct ClientBin folder in the web project.&lt;/p&gt;  &lt;p&gt;Once I made this change I was able to do the following&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Compile inside of VS with NO issues&lt;/li&gt;    &lt;li&gt;Compile via MSBuild on the command line&lt;/li&gt;    &lt;li&gt;F5 my application and run the silverlight client&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Hope this helps someone else&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69607" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/PkkxZJwhDE4" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net+IDE/default.aspx">.Net IDE</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/Visual+Studio+11/default.aspx">Visual Studio 11</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/03/20/vs11-silverlight-and-ria-services-command-line-build-issue-msb4006.aspx</feedburner:origLink></item><item><title>Magic to my eyes</title><link>http://feedproxy.google.com/~r/Devlicious/~3/2ccnjimsMQQ/magic-to-my-eyes.aspx</link><pubDate>Tue, 20 Mar 2012 00:58:43 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69606</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I know this may be lame but this may simply be the best install feature ever invented…. Enough said J&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_38CB89C5.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_6F593509.png" width="553" height="259" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69606" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/2ccnjimsMQQ" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/.Net+IDE/default.aspx">.Net IDE</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/03/19/magic-to-my-eyes.aspx</feedburner:origLink></item><item><title>Remote Work: Placeshift and Stay Highly Collaborative Part 1</title><link>http://feedproxy.google.com/~r/Devlicious/~3/NRxEy_wrFc8/remote-work-placeshift-and-stay-highly-collaborative-part-1.aspx</link><pubDate>Sat, 10 Mar 2012 14:38:57 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69586</guid><dc:creator>Rob Reynolds</dc:creator><slash:comments>0</slash:comments><description>&lt;blockquote&gt;   &lt;p&gt;The biggest complaint most remote workers have in regards to working on a team? Feeling disconnected. The biggest complaint an office has about remote workers? They forget the remote workers are there and don’t always trust what they are doing. Want to learn how to get past both issues? &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Hi, my name is Rob and I have a confession to make. I’m a remote worker four days a week. I’m a placeshift remote worker, and yet I am still highly collaborative with my team. “Placeshifting?” you say. “Highly collaborative?” you say. Over the next series of articles I am going to show you how this can be done. &lt;/p&gt;  &lt;p&gt;If you are a business and you have not seriously looked into a technology known as &lt;a href="http://research.microsoft.com/en-us/projects/ESPProject/"&gt;Embodied&lt;/a&gt; &lt;a href="http://research.microsoft.com/apps/pubs/?id=118110"&gt;Social&lt;/a&gt; &lt;a href="http://www.hanselman.com/blog/BuildingAnEmbodiedSocialProxyOrCrazyWebcamRemoteCartThing.aspx"&gt;Proxies&lt;/a&gt;, you are paying opportunity costs. You are losing money. More on that below. This series is for you so pay attention. I will highlight both business benefits and worker benefits.&lt;/p&gt;  &lt;p&gt;If you are a worker and you have considered working from home (or just remotely) but you are not quite sure how you would make it work, this series is for you. Or you are already doing remote work and want to learn how to collaborate better.&lt;/p&gt;  &lt;h3&gt;Two Types of Remote Work&lt;/h3&gt;  &lt;p&gt;&lt;strong&gt;Timeshift&lt;/strong&gt; – This is when you perform work at different intervals than the mainstream office may perform the work. Many folks have done this kind of work in one respect or another, even when working a regular full time job. If you ever went home and continued working in the evening, you have done what some might consider timeshift remote work. This series is not geared to this type of remote work.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Placeshift&lt;/strong&gt; – Placeshifting is when you perform work at the same time as everyone else, but at a different location. This is what most people think of when they hear the term remote workers. If you ever have work from home days, you know what it is like to placeshift. This series is geared to this type of remote work.&lt;/p&gt;  &lt;p&gt;The terms &lt;a href="http://en.wikipedia.org/wiki/Placeshifting"&gt;placeshifting&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Time_shifting"&gt;timeshifting&lt;/a&gt; are borrowed from media industry (television, music, etc) with respect to devices like DVRs. Not quite clear? When you record a TV show and &lt;strong&gt;&lt;em&gt;watch it later&lt;/em&gt;&lt;/strong&gt; you are timeshifting the show. Timeshifting dates back to the 1970s with VCRs and Betamax, while placeshifting media is a newer concept made possible by devices like the &lt;a href="http://en.wikipedia.org/wiki/Slingbox"&gt;Slingbox&lt;/a&gt;. When you use a Slingbox to watch a show from a device like your phone at the &lt;strong&gt;&lt;em&gt;same time&lt;/em&gt;&lt;/strong&gt; the show is playing, you are &lt;a href="http://www.slingmedia.com/go/placeshifting"&gt;placeshifting&lt;/a&gt;.&amp;#160; The difference should be clear when you think of placeshifting as &lt;strong&gt;same time, different location&lt;/strong&gt; and timeshifting as &lt;strong&gt;different time, location irrelevant&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;This same terminology can be applied to remote work. Although I was hoping to coin the remote work types terminology, Anybots and GigaOm beat me to print with their recent article (&lt;a href="http://gigaom.com/collaboration/robots-network-2011/"&gt;How and why robots are placeshifting remote workers&lt;/a&gt;). At least this means the terminology is sound.&lt;/p&gt;  &lt;h3&gt;Bottom Line&lt;/h3&gt;  &lt;p&gt;Placeshifting remote work is not for everyone and not for every type of business work either. Some jobs have physical requirements or security requirements that negate the ability for remote work. Not every person is able to be productive in a setting outside the office (and the converse is also true). The world is not fair, okay? Get over it. If you are someone who can work by yourself and do so well without being easily distracted (read: there are ways to remove distractions in a work from home situation – I’ll touch on those), then it’s possible you have what it takes to be a remote worker.&lt;/p&gt;  &lt;h3&gt;Business: We Tried Remote Workers Before, It Didn’t Work&lt;/h3&gt;  &lt;p&gt;This is the argument I hear the most. The biggest problem with this argument is that it is subjective. Remote work itself is subjective/situational. No two remote workers are going to be alike, no two situations are going to be the same. It’s possible you tried remote work with an individual who was not able to work remotely effectively. It’s highly possible you had an employee who moved away and you wanted to keep them so you allowed them to work remotely. But you may not have set yourself (and the individual) up for success. How much planning and research did you do prior to these remote work situations? How much enabling were you towards your remote worker? Did you attempt to manage your remote worker in the same way as the centrally located folks? Have you even heard of Embodied Social Proxies prior to reading this? &lt;/p&gt;  &lt;p&gt;The awareness I am trying to raise with you is that there are situations for businesses to make it work. And you can benefit hugely from remote workers if you do the proper planning, research and understand guidelines for making it work in your situation.&lt;/p&gt;  &lt;h3&gt;How Do I Benefit as a Business?&lt;/h3&gt;  &lt;h4&gt;Talent Pool&lt;/h4&gt;  &lt;p&gt;Here’s a hard pill to swallow – you are limited by your talent pool. If you require people to be onsite for work, you are limited by the area in which you do business. I hate to be the one to inform you, but you are not the most awesome place to work. I’m sorry. No matter how awesome you are there is somewhere else that is more awesome and does x better. It’s a losing battle. Get over it already.&lt;/p&gt;  &lt;p&gt;In this day and age less and less people will move just to work for you. If you expect the most talented folks in your industry to relocate for you, I have to tell you that 1990 called. I’m sorry to inform you it’s not going to happen in every case. And if it does, it’s borrowed time. Because someone else is going to attract them away. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;It’s likely the most talented people in your industry will never work for you&lt;/em&gt;&lt;/strong&gt; if you don’t have a remote option available. There are many reasons, but it boils down to where you expect your talent to live. &lt;/p&gt;  &lt;h4&gt;Happy Workers Are Superfans (and Productive Workers)&lt;/h4&gt;  &lt;p&gt;This is so huge I can’t even begin to give it the proper amount of attention. You want your workers to be happy. &lt;a href="http://tom.preston-werner.com/"&gt;Tom Preston-Werner&lt;/a&gt;, cofounder of GitHub, speaks to this in a presentation called &lt;a href="http://speakerdeck.com/u/mojombo/p/optimizing-for-happiness"&gt;Optimizing For Happiness&lt;/a&gt;. Please go there &lt;a href="http://speakerdeck.com/u/mojombo/p/optimizing-for-happiness"&gt;now&lt;/a&gt;. The bottom line is that you keep your workers happy, and they are much less likely to leave your organization. Turnover costs are huge to a company. If you are not making your employees happy, they are talking to others about not working for you. They have their ears open to new opportunities. They are likely looking for other jobs as you read this.&lt;/p&gt;  &lt;p&gt;If you think you are making your employees happy, I would ask what metric you use for evaluation. I’ll be the first to tell you that you are not doing enough to &lt;strong&gt;&lt;em&gt;keep&lt;/em&gt;&lt;/strong&gt; your employees happy. If you give out raises once a year and they are around 3-5% across the board, you might be doing it wrong. Not every employee is created equal, not every employee performs at the same level. Why would you pay them the same? Why would you give them the same raises? &lt;/p&gt;  &lt;p&gt;I’m going to make a bold statement here: &lt;strong&gt;&lt;em&gt;Your best people outperform your middle of the line folks by ten times&lt;/em&gt;&lt;/strong&gt;. If you are not paying them ten times as much or even five times as much, you might want to re-evaluate how truly happy you are making your employees. If you are not challenging your employees, you are boring them and they will find something more exciting. If you are not doing x you are likely not making your employees happy. You need better metrics into what makes for happy workers.&lt;/p&gt;  &lt;h4&gt;Facility Costs&lt;/h4&gt;  &lt;p&gt;Your facility costs are significantly cheaper when it comes to remote workers. A remote worker or semi-remote worker can take up a lot less space than a full time worker. If they come into the office once or twice a week, they will take up some space during that time, but the rest of the week that space could be used by other remote workers when then come into the office. Think of this as space sharing.&lt;/p&gt;  &lt;p&gt;Remote workers don’t bring/keep a lot of items in the office. Seriously. Get up and walk around your office. Take a look. Notice how much stuff each worker has surrounding their areas. Notice how much space they take up. Go ask how much it costs for the space of each worker you have in the office per month. If you don’t have this number on hand, you won’t understand what it costs for that worker. &lt;/p&gt;  &lt;p&gt;This actually isn’t that hard to calculate if you don’t have it. Just find out the &lt;a href="http://www.quora.com/Cost-per-employee-in-a-physical-office-space-what-factors-go-in-to-the-calculation"&gt;costs of your office space&lt;/a&gt; on a monthly basis. Electricity, rent, etc. Now take that number and divide by the number of workers you have on site. This will give you a rough estimate. There are ways to get more accurate estimates, but this is a good start.&lt;/p&gt;  &lt;p&gt;For the space of that one onsite worker, you might be able to put 5-10 remote workers in there (if you build and use embodied social proxies which are highly recommended and will be discussed during this series). Imagine that. 5-10 remote workers in that same space. That means for every 10 remote workers you hire, you can only hire one onsite person. Kind of sounds weird to hear it like that, right?&lt;/p&gt;  &lt;h4&gt;Bigger Staff – More Work In The Pipeline&lt;/h4&gt;  &lt;p&gt;This is probably the most overlooked opportunity cost when it comes to remote workers. You are limited by the number of folks you have into what you can accomplish. When you open up to remote work, you also open up to the fact that you can take on more work. More work in some terms means more revenue for your business.&amp;#160; This is huge.&lt;/p&gt;  &lt;h3&gt;Final Thoughts For Businesses&lt;/h3&gt;  &lt;p&gt;Remote work is not without its challenges. I can tell you that the benefits far outweigh the challenges. If you’ve tried remote work in the past and it didn’t work out, don’t let that be a limiter to trying again. If Thomas Edison quit the first time he failed, he may not have been credited with the invention of the light bulb as we know it! Failure is a step on the road to success. Food for thought.&lt;/p&gt;  &lt;h3&gt;Remote Work Series&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;Next up I’ll talk about what individuals need to be successful remote workers. &lt;/li&gt;    &lt;li&gt;Building an Embodied Social Proxy, aka, the Remote Portal for a practical cost &lt;/li&gt;    &lt;li&gt;Possibly other follow ups to come&lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69586" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/NRxEy_wrFc8" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/rob_reynolds/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/rob_reynolds/archive/tags/News/default.aspx">News</category><feedburner:origLink>http://devlicio.us/blogs/rob_reynolds/archive/2012/03/10/remote-work-placeshift-and-stay-highly-collaborative-part-1.aspx</feedburner:origLink></item><item><title>Alt.Tekpub REST</title><link>http://feedproxy.google.com/~r/Devlicious/~3/ZGS7YJuMLl4/alt-tekpub-rest.aspx</link><pubDate>Mon, 05 Mar 2012 06:43:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69571</guid><dc:creator>Rob Eisenberg</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;Mr. Conery has been working through building a RESTful API &lt;a target="_blank" href="http://wekeroad.com/2012/03/03/moving-the-philosophy-into-machinery/"&gt;over on his blog&lt;/a&gt;. He&amp;rsquo;s tired of theory and has called on the community to submit some concrete examples in order to shed some light on the situation. I&amp;rsquo;m no expert in this area (I usually stick to UI stuff), but I have some experience, so I thought I&amp;rsquo;d make a contribution. Here&amp;rsquo;s some thoughts.&lt;/p&gt;
&lt;p&gt;Issuing a GET to http://api.alttekpub.com returns:&lt;/p&gt;
&lt;pre name="code" class="xml:nogutter:nocontrols"&gt;&amp;lt;alttekpub&amp;gt;
  &amp;lt;links&amp;gt;
    &amp;lt;link rel=&amp;quot;self&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
    &amp;lt;link rel=&amp;quot;rels/productions&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
    &amp;lt;link rel=&amp;quot;rels/new-episodes&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
    &amp;lt;link rel=&amp;quot;rels/productions-by-category&amp;quot; href=&amp;quot;...?category={category_name}&amp;quot; /&amp;gt;
  &amp;lt;/links&amp;gt;
  &amp;lt;categories&amp;gt;
    &amp;lt;category name=&amp;quot;Microsoft&amp;quot; /&amp;gt;
    &amp;lt;category name=&amp;quot;Ruby&amp;quot; /&amp;gt;
    &amp;lt;category name=&amp;quot;JavaScript&amp;quot; /&amp;gt;
    &amp;lt;category name=&amp;quot;Mobile&amp;quot; /&amp;gt;
  &amp;lt;/categories&amp;gt;
&amp;lt;/alttekpub&amp;gt;&lt;/pre&gt;
&lt;p&gt;One of my goals here is that clients only need to know a single uri: http://api.alttekpub.com After that, they should be able to follow links inside the document in order to navigate all the data and exercise all the features of the API. Above, you can see that the alttekpub api exposes links to several other documents: productions, new episodes and productions by category. These are identified by a rel attribute which is used to specify the link&amp;rsquo;s relationship to the enclosing document. Every document has a link that points to itself at a minimum. The last link in this example is parameterized. The api provides the various options for parameters in its document below. Here&amp;rsquo;s an alternative way you could represent the same concept, by borrowing some ideas from html:&lt;/p&gt;
&lt;pre name="code" class="xml:nogutter:nocontrols"&gt;&amp;lt;alttekpub&amp;gt;
  &amp;lt;links&amp;gt;
    &amp;lt;link rel=&amp;quot;self&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
    &amp;lt;link rel=&amp;quot;rels/productions&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
    &amp;lt;link rel=&amp;quot;rels/new-episodes&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
  &amp;lt;/links&amp;gt;
  &amp;lt;form method=&amp;quot;GET&amp;quot; action=&amp;quot;...&amp;quot;&amp;gt;
    &amp;lt;select name=&amp;quot;category&amp;quot;&amp;gt;
      &amp;lt;option value=&amp;quot;Microsoft&amp;quot;&amp;gt;Microsoft&amp;lt;/option&amp;gt;
      &amp;lt;option value=&amp;quot;Ruby&amp;quot;&amp;gt;Ruby&amp;lt;/option&amp;gt;
      &amp;lt;option value=&amp;quot;Javascript&amp;quot;&amp;gt;Javascript&amp;lt;/option&amp;gt;
      &amp;lt;option value=&amp;quot;Mobile&amp;quot;&amp;gt;Mobile&amp;lt;/option&amp;gt;
    &amp;lt;/select&amp;gt;
  &amp;lt;/form&amp;gt;
&amp;lt;/alttekpub&amp;gt;&lt;/pre&gt;
&lt;p&gt;I actually like this a little better, but I&amp;rsquo;ve seen both ideas used here and there. What is neat is that the api is self-documenting and there&amp;rsquo;s no need for the client to know how to construct uris. Everything is provided by the server. Let&amp;rsquo;s ay we follow the link for rels/productions. Here&amp;rsquo;s what we might get back:&lt;/p&gt;
&lt;pre name="code" class="xml:nogutter:nocontrols"&gt;&amp;lt;productions&amp;gt;
  &amp;lt;links&amp;gt;
    &amp;lt;link rel=&amp;quot;self&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
    &amp;lt;link rel=&amp;quot;next&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
  &amp;lt;/links&amp;gt;
  &amp;lt;production&amp;gt;
    &amp;lt;name&amp;gt;RavenDB&amp;lt;/name&amp;gt;
    &amp;lt;author&amp;gt;Oren Eini&amp;lt;/author&amp;gt;
    &amp;lt;links&amp;gt;
      &amp;lt;link rel=&amp;quot;self&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
      &amp;lt;link rel=&amp;quot;rels/episodes&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
    &amp;lt;/links&amp;gt;
  &amp;lt;/production&amp;gt;
  &amp;lt;production&amp;gt;
    &amp;lt;name&amp;gt;Art of Speaking&amp;lt;/name&amp;gt;
    &amp;lt;author&amp;gt;Scott Hanselman&amp;lt;/author&amp;gt;
    &amp;lt;links&amp;gt;
      &amp;lt;link rel=&amp;quot;self&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
      &amp;lt;link rel=&amp;quot;rels/episodes&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
    &amp;lt;/links&amp;gt;
  &amp;lt;/production&amp;gt;
  &amp;lt;!--other productions elided--&amp;gt;
&amp;lt;/productions&amp;gt;&lt;/pre&gt;
&lt;p&gt;It&amp;rsquo;s just a simple list of productions. But, there&amp;rsquo;s a couple of things to note. First, notice the rel=&amp;rdquo;next&amp;rdquo; If there are a lot of productions, the server may choose to paginate them. If that is the case, and there&amp;rsquo;s a second page, we will have a link with rel=&amp;rdquo;next&amp;rdquo; as above. We can handle paging backwards in a similar fashion. In fact, there&amp;rsquo;s a host of standard rels which you can and should leverage when it make sense. You can find them here: &lt;a href="http://www.iana.org/assignments/link-relations/link-relations.xml"&gt;http://www.iana.org/assignments/link-relations/link-relations.xml&lt;/a&gt;&amp;nbsp; Another thing to note, is that we&amp;rsquo;ve represented the collection of episodes in a production with another link. Following the RavenDB production&amp;rsquo;s rels/episodes link yields:&lt;/p&gt;
&lt;pre name="code" class="xml:nogutter:nocontrols"&gt;&amp;lt;episodes&amp;gt;
  &amp;lt;links&amp;gt;
    &amp;lt;link rel=&amp;quot;self&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
  &amp;lt;/links&amp;gt;
  &amp;lt;episode&amp;gt;
    &amp;lt;links&amp;gt;
      &amp;lt;link rel=&amp;quot;self&amp;quot; href=&amp;quot;&amp;quot; /&amp;gt;
    &amp;lt;/links&amp;gt;
    &amp;lt;name&amp;gt;Why You Should Care About RavenDB&amp;lt;/name&amp;gt;
    &amp;lt;description&amp;gt;We&amp;#39;ve all heard of NoSQL...&amp;lt;/description&amp;gt;
    &amp;lt;videos&amp;gt;
      &amp;lt;video type=&amp;quot;video/mp4&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
      &amp;lt;video type=&amp;quot;video/ogg&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
    &amp;lt;/videos&amp;gt;
  &amp;lt;/episode&amp;gt;
  &amp;lt;episode&amp;gt;
    &amp;lt;links&amp;gt;
      &amp;lt;link rel=&amp;quot;self&amp;quot; href=&amp;quot;&amp;quot; /&amp;gt;
    &amp;lt;/links&amp;gt;
    &amp;lt;name&amp;gt;Understanding Document Names&amp;lt;/name&amp;gt;
    &amp;lt;description&amp;gt;In this short episode we explain how documents are named with RavenDB - and why.&amp;lt;/description&amp;gt;
    &amp;lt;videos&amp;gt;
      &amp;lt;video type=&amp;quot;video/mp4&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
      &amp;lt;video type=&amp;quot;video/ogg&amp;quot; href=&amp;quot;...&amp;quot; /&amp;gt;
    &amp;lt;/videos&amp;gt;
  &amp;lt;/episode&amp;gt;
&amp;lt;/episodes&amp;gt;&lt;/pre&gt;
&lt;p&gt;There&amp;rsquo;s not really anything new here. We just have basic xml with links. In the above examples, I&amp;rsquo;ve only shown a &amp;ldquo;readonly&amp;rdquo; api for a custom vendor-specific format. But, these concepts can all be expanded on to model all sorts of things through links, forms, etc. Here&amp;rsquo;s a couple of ideas you can implement to improve things further:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use JSON instead of XML :)&lt;/li&gt;
&lt;li&gt;Add a &amp;ldquo;title&amp;rdquo; attribute to your links. This can be used by clients to display the UI. For example, a client might scan the links in a resource and generate a series of buttons or a toolbar for each link. It could use the title attribute to populate the button&amp;rsquo;s text. Clicking the button would just activate the link. It&amp;rsquo;s very similar to the way a browser&amp;rsquo;s &amp;lt;a /&amp;gt; tag works, and if the client is coded in this way, it allows a lot of flexibility for the service author. They can evolve and extend their service with less changes needed by api consumers.&lt;/li&gt;
&lt;li&gt;Embed resources. After recording usage data, you might discover that a request for productions is quickly followed by a request for episodes. Perhaps you can improve the api usage experience by embedding the episodes in the production documents, so only a single request is needed? There are multiple ways you can design your format to handle this situation. But you might want to consider using something that&amp;rsquo;s already been designed for this scenario, such as &lt;a target="_blank" href="http://stateless.co/hal_specification.html"&gt;HAL&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The takeaway here is that a key concept in REST is hypermedia controls, which I&amp;rsquo;ve represented mostly with links (and a form). These allow the API to document itself, alleviating the need for the client to be coded with specific knowledge of link construction. It also allows the service to evolve more easily by adding additional controls over time or by completely changing uri&amp;rsquo;s or even whether or not certain related documents are embedded.&lt;/p&gt;
&lt;p&gt;Oh..and just a reminder that I&amp;rsquo;m not a REST expert. But hopefully this example sheds some light, however dim :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69571" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/ZGS7YJuMLl4" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/rob_eisenberg/archive/tags/REST/default.aspx">REST</category><feedburner:origLink>http://devlicio.us/blogs/rob_eisenberg/archive/2012/03/05/alt-tekpub-rest.aspx</feedburner:origLink></item><item><title>WebApi and Json Deserialization into an object model</title><link>http://feedproxy.google.com/~r/Devlicious/~3/f_Tzwdlj-T8/webapi-and-json-deserialization-into-an-object-model.aspx</link><pubDate>Thu, 01 Mar 2012 22:22:31 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69564</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;If you use WebApi with the Asp.Net MVC framework you may not realize that there is some ‘magic’ that takes place under the hood to convert the over the wire data from Json into an object.&amp;#160; You may not realize this because by default it ‘just works’, which is exactly what I want and what a framework should do.&lt;/p&gt;  &lt;p&gt;However, if you are not using MVC and you are going to use WebApi endpoints from any other application you will have to handle this deserialization or transformation your self and we will find out that this is actually very easy.&lt;/p&gt;  &lt;p&gt;If you are not familiar with the &lt;a href="http://www.asp.net/web-api"&gt;WebApi&lt;/a&gt; you can bounce over to a few of my prior posts about this topic:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2012/02/27/zero-to-self-hosting-aspnet-webapi-in-a-few-short-steps.aspx"&gt;Zero to Self Hosting AspNet WebApi&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2012/02/28/consuming-webapi-endpoints-in-your-application.aspx"&gt;Consuming WebApi endpoints in your application&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;When you set out to convert your Json data into an object you will want to do the following.&lt;/p&gt;  &lt;p&gt;1) Include a reference to the &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.jsonvalueextensions%28v=vs.110%29.aspx"&gt;System.Runtime.Serialization&lt;/a&gt; assembly in order to use the &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.jsonvalueextensions%28v=vs.110%29.aspx"&gt;JsonValueExtension&lt;/a&gt; class.&lt;/p&gt;  &lt;p&gt;2) Add a using statement for System.Runtime.Serialization.Json&lt;/p&gt;  &lt;p&gt;3) Run the following in order to use the extension classes to turn your Json result into an object&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;response.Content
    .ReadAsAsync()
    .ContinueWith( readResult =&amp;gt;
                        {
                            var array = readResult.Result;

                            // How to transform the entire result from Json to an object
                            var episodes = array.ReadAsType&amp;lt;IList&amp;lt;Episode&amp;gt;&amp;gt;();
                                                                  
                            foreach ( var element in array )
                            {
                                // how to transform a single Json element to an object
                                var asEpisode = element.ReadAsType&amp;lt;Episode&amp;gt;();                                                                    
                            }

                        } );&lt;/pre&gt;

&lt;p&gt;The magic in the code above is the usage of the &lt;a href="http://msdn.microsoft.com/en-us/library/hh194391%28v=vs.110%29.aspx"&gt;ReadAsType&lt;/a&gt; extension method.&amp;#160; This method will hide any of the complexities of turning the Json value into an object.&lt;/p&gt;

&lt;p&gt;As you can see manually converting your Json into an object is simple and very straight forward.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69564" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/f_Tzwdlj-T8" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WCF/default.aspx">WCF</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WebApi/default.aspx">WebApi</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/03/01/webapi-and-json-deserialization-into-an-object-model.aspx</feedburner:origLink></item><item><title>Consuming WebApi endpoints in your application</title><link>http://feedproxy.google.com/~r/Devlicious/~3/CAmad-LHJQE/consuming-webapi-endpoints-in-your-application.aspx</link><pubDate>Tue, 28 Feb 2012 14:35:46 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69549</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;In my prior &lt;font color="#ff0000"&gt;&lt;a href="http://devlicio.us/blogs/derik_whittaker/archive/2012/02/27/zero-to-self-hosting-aspnet-webapi-in-a-few-short-steps.aspx?CommentPosted=true#commentmessage"&gt;post&lt;/a&gt; &lt;/font&gt;&lt;font color="#000000"&gt;I walked you though how to setup WebApi in a self hosted environment.&amp;#160; In this post we will take a look at how to consume a WebApi endpoint. We will do this by using the code from the prior example as well as by creating a new console application.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000"&gt;Before we get started you are going to want to create our console application and add references to the following assemblies.&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font color="#000000"&gt;System.Json&lt;/font&gt; &lt;/li&gt;    &lt;li&gt;&lt;font color="#000000"&gt;System.Net.Http&lt;/font&gt; &lt;/li&gt;    &lt;li&gt;&lt;font color="#000000"&gt;System.Net.Http.Formatting&lt;/font&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font color="#000000"&gt;&lt;strong&gt;Step 1: Creating our HttpClient&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000"&gt;When connecting to any remote endpoint there are many ways to do this, in our post we are going to use the HttpClient which is part of the System.Net.Http namespace. &lt;/font&gt;&lt;/p&gt;  &lt;pre class="c#" name="code"&gt;var httpClient = new HttpClient();&lt;/pre&gt;

&lt;p&gt;&lt;font color="#000000"&gt;&lt;strong&gt;Step 2: Connecting to our endpoint and consuming our data&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;Once we have our&amp;#160; httpClient created we need to do something useful with it.&amp;#160; The code below is what is needed in order to do exactly this.&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;httpClient.GetAsync( &amp;quot;http://localhost:8080/endpoints/episode/&amp;quot; )
    .ContinueWith( result =&amp;gt;
                        {
                            var response = result.Result;

                            response.EnsureSuccessStatusCode();

                            response.Content
                                .ReadAsAsync&amp;lt;JsonArray&amp;gt;()
                                .ContinueWith( readResult =&amp;gt;
                                                    {
                                                        var array = readResult.Result;

                                                        foreach ( var element in array )
                                                        {
                                                            Console.WriteLine(element);
                                                        }

                                                    } );

                        } );&lt;/pre&gt;

&lt;p&gt;The code above is a bit much so lets take a few to break it down and take a closer look at its parts&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The first thing we are doing is using the HttpClient to connect to the our endpoint.&amp;#160; As you can see we are doing this Async via the Task Parallel library. &lt;/li&gt;

  &lt;li&gt;Next you should see that once we get a response from the remote endpoint we are going to handle the results via the .Result property.&amp;#160; We will also want to ensure that the connection as valid so we should call response.EnsureSuccesStatusCode.&amp;#160; If any status but success (200) is returned an exception will be thrown. &lt;/li&gt;

  &lt;li&gt;Once we know we have a good connection we need to read in the content.&amp;#160; we will read the content via the ReasAsAsync method and provide it the type of JsonArray, this tells the code how to format/deserialize the result content stream.&amp;#160; of course you could read this as a raw stream or string but that is no fun. &lt;/li&gt;

  &lt;li&gt;Once we have our formatted content we can do something useful with it.&amp;#160; Of course in this example I am not converting my content into an object, I am leaving it as raw Json, but if need an object you can use the JsonSerializer to get an object. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As you can see consuming a WebApi is pretty straight forward and does involve a ton of coding or effort.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69549" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/CAmad-LHJQE" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WCF/default.aspx">WCF</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WebApi/default.aspx">WebApi</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/02/28/consuming-webapi-endpoints-in-your-application.aspx</feedburner:origLink></item><item><title>Zero to Self Hosting AspNet WebAPI in a few short steps</title><link>http://feedproxy.google.com/~r/Devlicious/~3/Hmdz6513jfY/zero-to-self-hosting-aspnet-webapi-in-a-few-short-steps.aspx</link><pubDate>Mon, 27 Feb 2012 10:42:40 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69541</guid><dc:creator>Derik Whittaker</dc:creator><slash:comments>11</slash:comments><description>&lt;p&gt;So #AspNetWebAPI has finally reach &lt;a href="http://www.asp.net/mvc/mvc4"&gt;beta&lt;/a&gt; and I finally have gotten off my a$$ and starting playing around with it.&amp;#160; Sure I have read the info on line, I have sat through numerous sessions where it was being taught and all along I have been telling myself ‘this stuff kicks ass’ but I just not have not found the time to actually use it or learn it.&amp;#160; That all changed today, and in typically fashion &lt;a href="https://twitter.com/#!/gblock"&gt;Glenn Block&lt;/a&gt; and team have delivered a kick ass, easy as pie solution to a tough issue.&amp;#160; They have managed to take WCF and all of its glory and complication and made it dead simple to use.&lt;/p&gt;  &lt;p&gt;This is going to be the first of 2 posts where I will walk you though step by step on how to setup and use the AspNetWebApi in a self hosted situation .&amp;#160; This post will be how to self host the routes/services and the second post will be how to consume the services from a external (non-MVC) application.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1: Create a windows console application&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The simplest way to show how to do this is to create a console app, but of course you could have created a winform, wpf or Windows Service but console apps work just great.&lt;/p&gt;  &lt;p&gt;One thing to not though is you will want to open up the Properties for your console app and make sure it is using the Full .net 4 framework, not the client profile.&amp;#160; See blow:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_6688286A.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_2D051873.png" width="319" height="61" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 2: Getting the bits from Nuget to allow self hosting&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The simplest way to get and register the bits needed is to fire up Nuget and download them.&amp;#160; If you have not already installed the Nuget bits head over to Nuget.org and download them.&lt;/p&gt;  &lt;p&gt;Once you Nuget up and running type in ‘Install-Package&amp;#39; AspNetWebApi.Selfhost’ as shown below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_33B821F6.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_613941B9.png" width="593" height="91" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When this is done running you should have the following assemblies added to your solution:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_4BDB8C51.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_4045CF12.png" width="260" height="264" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 3: Setting up a basic route and Setup Self Hosting&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In order for your application to be able to host WebApi you will need to setup a basic route and the Self hosting Server. You will want to open up your Program.cs file and add the code below.&amp;#160; &lt;/p&gt;  &lt;pre class="c#" name="code"&gt;static void Main(string[] args)
{

    var selfHostConfiguraiton = new HttpSelfHostConfiguration( &amp;quot;http://localhost:8080&amp;quot; );
            
    selfHostConfiguraiton.Routes.MapHttpRoute(
        name: &amp;quot;DefaultApiRoute&amp;quot;,
        routeTemplate: &amp;quot;endpoints/{controller}&amp;quot;,
        defaults: null
        );

    using (var server = new HttpSelfHostServer(selfHostConfiguraiton))
    {

        server.OpenAsync().Wait();

        Console.WriteLine(&amp;quot;Hosting at http://localhost:8080/endpoints/{controller}&amp;quot;);

        Console.ReadLine();
    }

}&lt;/pre&gt;

&lt;p&gt;Breaking down the code above.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The first line is where you setup the configuration for the WebApiSelfHost Server.&amp;#160; When setting this up you will need to make sure to put in a valid URL w/ port, if needed.&amp;#160; You may need to use Netsh.exe to register the port if the port you are using is not already setup. &lt;/li&gt;

  &lt;li&gt;We are creating our default route.&amp;#160; If you have done any Asp.net MVC work this should be confortable for you.&amp;#160; The one difference here is we are using MapHttpRoute rather than MapRoute.&amp;#160; The MapHttproute can be found in System.web.Http namespace &lt;/li&gt;

  &lt;li&gt;Lastly we are creating and starting our Self host Server.&amp;#160; This is the magic goo. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Creating your first controller&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Like Asp.net MVC WebApi users a controller to handle inbound requests.&amp;#160; However, we now use ApiController as our base class.&amp;#160; The code below is my basic controller for handing the route I defined above.&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;public class EpisodeController : ApiController
{
    public IList GetAllEpisodes()
    {
        return new List
                    {
                        new Episode {Id = 1, Name = &amp;quot;Episode 1&amp;quot;, ReleasedOn = DateTime.Now.AddDays( -10 )},
                        new Episode {Id = 2, Name = &amp;quot;Episode 2&amp;quot;, ReleasedOn = DateTime.Now.AddDays( -5 )},
                        new Episode {Id = 3, Name = &amp;quot;Episode 3&amp;quot;, ReleasedOn = DateTime.Now.AddDays( -3 )},
                        new Episode {Id = 4, Name = &amp;quot;Episode 4&amp;quot;, ReleasedOn = DateTime.Now.AddDays( 0 )},
                    };
    }
}&lt;/pre&gt;

&lt;p&gt;Breaking down the code above.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;We must inherit from ApiController &lt;/li&gt;

  &lt;li&gt;If you have done ANY WCF work you will notice that there are ServiceContrace or OperationContract attributes anyplace to be found on the controller…. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Creating the model to be used by your controller&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So we have our controller, now it is time to create the Episode model which is being used by our controller.&lt;/p&gt;

&lt;pre class="c#" name="code"&gt;public class Episode
{
    public int Id { get; set; }

    public string Name { get; set; }

    public DateTime ReleasedOn { get; set; }
}&lt;/pre&gt;

&lt;p&gt;Above is our model and if you have done any type of work with WCF you should notice straight away there is NO attributes.&amp;#160; This is awesome &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/wlEmoticon_2D00_smile_5F00_71D13CA7.png" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Hit F5 and take WebApi For a spin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So we have created the SelfHosting service, we have created our route, we have created our controller and finally we have created out model.&amp;#160; It appears to me we are ready to give this puppy a test ride.&lt;/p&gt;

&lt;p&gt;Hit F5 in your project and open up a browser.&amp;#160; Once your browser is up and running navigate to &lt;a href="http://localhost:8080/endpoints/episode"&gt;http://localhost:8080/endpoints/episode&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If all goes well you should see something like&lt;/p&gt;

&lt;p&gt;&lt;a href="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_4A96F372.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://devlicio.us/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/derik_5F00_whittaker/image_5F00_thumb_5F00_30C2BD43.png" width="532" height="467" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You may notice this is use XML formatting by default.&amp;#160; If you don’t want xml follow &lt;a href="http://codebetter.com/glennblock/2012/02/26/disabling-the-xml-formatter-in-asp-net-web-apithe-easy-way-2/"&gt;Glenn’s&lt;/a&gt; post on how to disable XML formatting.&lt;/p&gt;

&lt;p&gt;Till next time,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69541" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/Hmdz6513jfY" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WCF/default.aspx">WCF</category><category domain="http://devlicio.us/blogs/derik_whittaker/archive/tags/WebApi/default.aspx">WebApi</category><feedburner:origLink>http://devlicio.us/blogs/derik_whittaker/archive/2012/02/27/zero-to-self-hosting-aspnet-webapi-in-a-few-short-steps.aspx</feedburner:origLink></item><item><title>Chocolatey - Guidance on Packaging Apps with Both an Install and Executable/Zip Option</title><link>http://feedproxy.google.com/~r/Devlicious/~3/eDG2BX-axRY/chocolatey-guidance-on-packaging-apps-with-both-an-install-and-executable-zip-option.aspx</link><pubDate>Sat, 25 Feb 2012 17:35:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69537</guid><dc:creator>Rob Reynolds</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;&lt;span&gt;One of the thoughts I&amp;#39;ve been considering recently with &lt;a href="http://chocolatey.org"&gt;chocolatey&lt;/a&gt; is consistency with packages and naming conventions as chocolatey continues to grow. It&amp;#39;s fine to name packages by the app/tool name, that&amp;#39;s both intuitive and expected. What I am more interested in is when an application has multiple installation options (ie. an MSI and a ZIP). It can become confusing for people to install these when they don&amp;#39;t know what they are getting if they call a package that has both. If you start with one that has a .zip and later they release an MSI (nodejs anyone?), what do you call the package that installs the MSI? Do you keep around the executable? Do you rename the original package in response to the other option? Is there a third option?&lt;/span&gt;
&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;h4&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;One Option&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;div&gt;If there is only one option available, you are fine to make the package name the same as the application/tool. This makes it intuitive and reduces confusion.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;
&lt;h4&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Multiple Options&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;To start putting together guidance on this and alleviate confusion, I see that we would move forward in these cases with three packages. One with no suffix, one with &amp;quot;.install&amp;quot; suffix, and one with &amp;quot;.commandline&amp;quot; suffix.&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;div&gt;If you would take a quick look at 7zip (&lt;a href="http://chocolatey.org/packages?q=7zip"&gt;http://chocolatey.org/packages?q=7zip&lt;/a&gt;), you will notice there are three packages here.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;7zip is what will ultimately be a virtual package&lt;/li&gt;
&lt;li&gt;7zip.install is the package name for a package that uses a native installer (i.e. MSI, exe)&lt;/li&gt;
&lt;li&gt;7zip.commandline is the package name for a package that has an executable / downloads &amp;amp; unpacks an archive / etc&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;7Zip right now is taking a dependency on 7zip.install (which makes it a meta package). When virtual packages (see Virtual Packages below) are ready, that dependency will be removed and the chocolateyinstall.ps1 file will look something like the following (this is not definitive of what it will look like though):&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;div&gt;&amp;nbsp;Install-VirtualPackage &amp;#39;7zip.commandline&amp;#39; &amp;#39;7zip.install&amp;#39;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;You will notice I put the &amp;quot;.commandline&amp;quot; ahead of &amp;quot;.install&amp;quot;. In the end, I think the behavior of a virtual package should default to a command line version. Why? There are folks that do not have administrative access to their machines. Chocolatey is really nice for them because they can install and use chocolatey without ever needing to assert administrative privileges. Marcel Hoyer (&lt;a href="https://twitter.com/#!/pixelplastic"&gt;https://twitter.com/pixelplastic&lt;/a&gt;) first proposed the idea of being able to use chocolatey without administrative privileges. Him and I took pains to make chocolatey work for these scenarios. This did complicate chocolatey a little bit for the package maker, but in the end I think it is a really good thing. As a person inspecting a package to decide whether to install or not, they can see every point that the package maker mentioned they needed administrative privileges.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;That said, the default will be the one on the leftmost side. You are beholden to the community in justifying why you didn&amp;#39;t put the command line version first if you decide not to in the virtual package.&amp;nbsp;&lt;span&gt;But chocolatey won&amp;#39;t constrain you on that because you may have a really good reason.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;h4&gt;&lt;span style="text-decoration:underline;"&gt;App Now has Multiple Options&lt;/span&gt;&lt;/h4&gt;
&lt;div&gt;When an application/tool moves to where it has multiple options, like an installer it didn&amp;#39;t used to have, that&amp;#39;s when it is time to break the package out to a virtual (meta for now until virtual is available) and create the other two packages with the correct suffixes as outlined in the guidance above.&lt;/div&gt;
&lt;h4&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Virtual Packages&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;div&gt;For those confused about the idea of a virtual package, it allows folks to say I need to take a dependency on a PDFReader. PDFReader becomes a virtual package that does nothing other than point to all of the different pdf readers available. When someone installs the package that has a dependency on PDFReader, chocolatey looks at the virtual options and sees you have adobereader installed (one of the options in the list). So it moves on because you have met the virtual package requirements. If you have foxitreader installed, it moves on. Otherwise it picks the first item in the virtual tree and installs it as the default. More information?&amp;nbsp;&lt;a href="https://github.com/chocolatey/chocolatey/issues/7"&gt;https://github.com/chocolatey/chocolatey/issues/7&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;h4&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Virtual Packages vs Meta Packages&lt;/span&gt;&lt;/strong&gt;&lt;/h4&gt;
&lt;div&gt;A meta package is one that points to other packages. If you think of a package that does nothing more than take on dependencies to other packages, that is a meta package. A virtual package is like a meta package, except it has the concept of optional dependencies.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;h4&gt;&lt;span style="text-decoration:underline;"&gt;Ending Thoughts&lt;/span&gt;&lt;/h4&gt;
&lt;div&gt;This seems to be on the surface the best way to provide an intuitive user experience. There may be some things we learn along the way and adjust this as we go.&amp;nbsp;If you are a package owner and you have packages that have both options, you may want to start getting them into this format. I myself have some work to do in this aspect.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Thoughts?&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Original Discussion:&amp;nbsp;&lt;a href="http://groups.google.com/group/chocolatey/browse_thread/thread/a1d208b022dfc30f"&gt;http://groups.google.com/group/chocolatey/browse_thread/thread/a1d208b022dfc30f&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69537" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/eDG2BX-axRY" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/rob_reynolds/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://devlicio.us/blogs/rob_reynolds/archive/tags/Tools/default.aspx">Tools</category><category domain="http://devlicio.us/blogs/rob_reynolds/archive/tags/.NET/default.aspx">.NET</category><category domain="http://devlicio.us/blogs/rob_reynolds/archive/tags/NuGet/default.aspx">NuGet</category><category domain="http://devlicio.us/blogs/rob_reynolds/archive/tags/chocolatey/default.aspx">chocolatey</category><feedburner:origLink>http://devlicio.us/blogs/rob_reynolds/archive/2012/02/25/chocolatey-guidance-on-packaging-apps-with-both-an-install-and-executable-zip-option.aspx</feedburner:origLink></item><item><title>Avoiding Prescriptive Requirements</title><link>http://feedproxy.google.com/~r/Devlicious/~3/tb9QcsMBm8k/avoiding-prescriptive-requirements.aspx</link><pubDate>Thu, 09 Feb 2012 03:50:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69485</guid><dc:creator>Jak Charlton</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Core Requirements&lt;/h3&gt;
&lt;p class="MsoNormal"&gt;&lt;strong&gt;Requirements &lt;/strong&gt;should be given as
the &lt;strong&gt;Core Requirement&lt;/strong&gt;, and avoid the common pitfall of providing &lt;strong&gt;Prescriptive
Requirements&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;As an example, a core requirement in an insurance system may be:&lt;/p&gt;
&lt;p style="padding-left:30px;" class="MsoNormal"&gt;&lt;strong&gt;&lt;span&gt;As a user of the Broker system, I want to create a Settlement Batch of Eligible Documents across Insurance Policies&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;This is eminently testable, is
clear and unambiguous, and has real business value, and it meets the general &lt;strong&gt;INVEST&lt;/strong&gt;
principle of good user stories (which is also a good maxim for any form of
requirements):&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is &lt;strong&gt;Independent&lt;/strong&gt;
of other stories&lt;/li&gt;
&lt;li&gt;It is easily &lt;strong&gt;Negotiated&lt;/strong&gt;
as to priority and value&lt;/li&gt;
&lt;li&gt;It has real business
&lt;strong&gt;Value&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;It is small enough
to easily &lt;strong&gt;Estimate&lt;/strong&gt; with some degree of certainty&lt;/li&gt;
&lt;li&gt;It is of an
appropriate &lt;strong&gt;Size&lt;/strong&gt; for easy estimation, planning and prioritisation&lt;/li&gt;
&lt;li&gt;It is able to be &lt;strong&gt;Tested&lt;/strong&gt;
both manually and in an automated fashion with clear and unambiguous pass or
fail criteria, you can either do it or not&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;The stated requirement is not
prescriptive, it does not specify how the user triggers this action, what data
they need to provide, how they select the documents, nor does it specify what a &amp;quot;user of the Broker System&amp;quot; is within this context, nor what a Settlement Batch is, nor what an Eligible Document is. This
means the requirement can be documented very early on, with little analysis
work needed, allowing very quick comparison with other requirements, and very
quick verification from the business as to the validity of the story.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;Later this placeholder can be
expanded in discussions between the technical teams and the business to include
the actual definitions and scenarios that define its acceptance criteria:&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The user must
have the &amp;ldquo;Batch Creation&amp;rdquo; permission&lt;/li&gt;
&lt;li&gt;Eligible Documents are those which are awaiting Settlement&lt;/li&gt;
&lt;li&gt;A Settlement Batch is a group of Documents that will be dealt with together by the Claims Settlement system, so as to save managing on an individual policy level&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;This would lead to a requirement
with maybe a dozen test scenarios giving all the variations of user and
statuses that would allow or not allow the story to pass the test. All of these
stories and scenarios are now easily tested with automated and repeatable
testing.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;At this point it would probably
be obvious where within the UI this functionality should surface, and the
design of the UI interaction can be worked out. This UI work is actually a very
specific development skill within its own right - there is significant complexity in
designing UI interactions that mirror both the technical system and the user&amp;rsquo;s
mental model.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;Through all of these steps, the
original core requirement has not been changed, though its implementation and
business logic may have evolved, changed and adapted to line up with other
functionality.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;Good requirements are merely a
placeholder for a later conversation. Their level of completeness or accuracy
only dictates your certainty in implementing them accurately and efficiently,
but does not preclude moving forwards, and does not hold development up waiting
on &amp;ldquo;complete requirements&amp;rdquo;.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;As granularity increases, so
does complexity required to understand, verify and implement, but oddly so does
instability. By starting with core stories, you maintain a fairly stable set of
requirements, and only deal with complexity when you need to, and suffer the
instability only on individual scenarios.&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;Which brings us neatly to
development&lt;/span&gt;&lt;/h3&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;It is fairly well established
now that development must be iterative within short cycles to increase its
chance of being successful. Early feedback and revision saves massive amounts
of time and effort correcting incorrect assumptions and poor translation.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;The sooner a story enters
development, the sooner a basic version of it can be demonstrated to business
users, to verify against their assumptions, the faster it can be revised and
the more accurately it will reflect the actual requirements. In addition it
will expose underlying technical constraints and limitations earlier on.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69485" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/tb9QcsMBm8k" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/casey/archive/tags/Rants/default.aspx">Rants</category><category domain="http://devlicio.us/blogs/casey/archive/tags/development/default.aspx">development</category><category domain="http://devlicio.us/blogs/casey/archive/tags/requirements/default.aspx">requirements</category><feedburner:origLink>http://devlicio.us/blogs/casey/archive/2012/02/09/avoiding-prescriptive-requirements.aspx</feedburner:origLink></item><item><title>Finding Out When Something Happened in Your Git Repo</title><link>http://feedproxy.google.com/~r/Devlicious/~3/suAT2ldjahI/finding-out-when-something-happened-in-your-git-repo.aspx</link><pubDate>Wed, 08 Feb 2012 15:14:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69477</guid><dc:creator>Christopher Bennage</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;em&gt;Acknowledgment: This is meant to be the Windows equivalent of &lt;a href="http://blog.jayway.com/author/andersjanmyr"&gt;Anders Janmyr&lt;/a&gt;&amp;#8217;s &lt;a href="http://blog.jayway.com/2012/01/25/finding-with-git/"&gt;excellent post&lt;/a&gt; on the subject of finding stuff with Git. Essentially, I&amp;#8217;m translating some of Anders&amp;#8217; examples to Powershell and providing explanations for things that many Windows devs might not be familiar with.&lt;/em&gt;&lt;/p&gt;



&lt;p&gt;This is the third in a series of posts providing a set of recipes for locating sundry and diverse &lt;em&gt;thingies&lt;/em&gt; in a Git repository.&lt;/p&gt;



&lt;h2&gt;Determining when a file was added, deleted, modified, or renamed&lt;/h2&gt;



&lt;p&gt;You can include the &lt;code&gt;--diff-filter&lt;/code&gt; argument with &lt;code&gt;git log&lt;/code&gt; to find commits that include specific operations. For example:&lt;/p&gt;



&lt;pre&gt;&lt;code&gt;git log --diff-filter=D # delete

git log --diff-filter=A # add

git log --diff-filter=M # modified

git log --diff-filter=R # rename

&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;There are additional flags as well. Check the &lt;a href="http://schacon.github.com/git/git-log.html"&gt;documentation&lt;/a&gt;. By default, &lt;code&gt;git log&lt;/code&gt; just returns the commit id, author, date, and message. When using these filters I like to include &lt;code&gt;--summary&lt;/code&gt; so that the list of operations in the commit are included as well.&lt;/p&gt;



&lt;p&gt;&lt;em&gt;N.B. If you run a &lt;code&gt;git log&lt;/code&gt; command and your prompt turns into a &lt;code&gt;:&lt;/code&gt; simply press &lt;code&gt;q&lt;/code&gt; to exit.&lt;/em&gt;&lt;/p&gt;



&lt;p&gt;I don&amp;#8217;t think that you would ever want to return &lt;em&gt;all&lt;/em&gt; of the operations of a specific type in the log however. Instead, you will probably want to find out when a specific file was operated on.&lt;/p&gt;



&lt;p&gt;Let&amp;#8217;s say that something was deleted and you need to find out when and by whom. You can pass a path to &lt;code&gt;git log&lt;/code&gt;, though you&amp;#8217;ll need to preced it with &lt;code&gt;--&lt;/code&gt; and a space to disambiguate it from other arguments. Armed with this and following Ander&amp;#8217;s post you would expect to be able to do this:&lt;/p&gt;



&lt;pre&gt;&lt;code&gt;git log --diff-filter=D --summary -- /path/to/deleted/file

&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;And if you aren&amp;#8217;t using Powershell this works as expected. I tested it with Git Bash (included with msysgit) and good ol&amp;#8217; cmd as well. Both work as expected.&lt;/p&gt;



&lt;p&gt;However, when you attempt this in Powershell, git complains that the path is an &lt;em&gt;ambiguous arugment&lt;/em&gt;. I was able to, um, &amp;#8220;work around&amp;#8221; it by creating an empty placeholder file at the location.  Fortunately, &lt;a href="https://twitter.com/#!/Jittery"&gt;Jay Hill&lt;/a&gt; heard my anguish on Twitter and dug up &lt;a href="http://blogs.popart.com/2011/11/command-line-git-and-windows-gotchas/"&gt;this post&lt;/a&gt; from &lt;a href="http://blogs.popart.com/author/ethanbrown/"&gt;Ethan Brown&lt;/a&gt;. In a nutshell, Powershell strips out the &lt;code&gt;--&lt;/code&gt;. You can force it to be recognized by wrapping the argument in double qoutes:&lt;/p&gt;



&lt;pre&gt;&lt;code&gt;git log --diff-filter=D --summary &amp;quot;--&amp;quot; /path/to/deleted/file

&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;That works!&lt;/p&gt;



&lt;p&gt;I&amp;#8217;m guessing that Powershell considers &lt;code&gt;--&lt;/code&gt; to be an empty arugment and therefore something to be ignored. I also assume that when the file actually exists at the path that git is smart enough to recognize the argument as a path. (Indeed, the official documentations says that &amp;#8220;paths &lt;em&gt;may&lt;/em&gt; need to be prefixed&amp;#8221;).&lt;/p&gt;



&lt;p&gt;While we&amp;#8217;re here, I also want to point out that you can use wild cards in the path. Perhaps you don&amp;#8217;t know the exact path to the file, but you know that it was named &lt;code&gt;monkey.js&lt;/code&gt;:&lt;/p&gt;



&lt;pre&gt;&lt;code&gt;git log --diff-filter=D --summary -- **/monkey.js

&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Happy hunting!&lt;/p&gt;


&lt;em&gt;Comment on this post at &lt;a href="http://dev.bennage.com/blog/2012/02/08/finding-stuff-in-your-git-repo-3/"&gt;dev.bennage.com&lt;/a&gt;&lt;/em&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69477" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/suAT2ldjahI" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/source+control/default.aspx">source control</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/PowerShell/default.aspx">PowerShell</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/git/default.aspx">git</category><category domain="http://devlicio.us/blogs/christopher_bennage/archive/tags/windows/default.aspx">windows</category><feedburner:origLink>http://devlicio.us/blogs/christopher_bennage/archive/2012/02/08/finding-out-when-something-happened-in-your-git-repo.aspx</feedburner:origLink></item><item><title>Submit a patch</title><link>http://feedproxy.google.com/~r/Devlicious/~3/mLbG6HjcH4M/submit-a-patch.aspx</link><pubDate>Mon, 06 Feb 2012 16:56:08 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:69469</guid><dc:creator>Hadi Hariri</dc:creator><slash:comments>8</slash:comments><description>&lt;p&gt;We love to complain, and Twitter has just made is so much easier. By merely including a handle or keyword of some company or product, we can attract the attention of those we’re moaning about and have them run to try and solve our problem. The speed at which they run is proportionally direct to the number of followers we have or the ‘people we know’ (I have 10 followers but my best friend is a celebrity with 300K followers and RT’s anything I ask him to). Apparently it’s called Social Media Damage Control. &lt;/p&gt;  &lt;p&gt;When it comes to software products, we’re quite good at it too. After all, that’s why we pay for software, to have someone to hear our roar on the other end of a phone, a forum or a twitter handle. &lt;/p&gt;  &lt;p&gt;But that only applies to commercial software.&lt;/p&gt;  &lt;p&gt;When it comes to OSS however, it seems different rules apply. Specially when it&amp;#39;s free. Complaining about OSS is often viewed as ungrateful behavior. Numerous times I’ve seen reactions from OSS developers, contributors or merely a simple passer by, responding to a complaint with: &lt;strong&gt;&lt;em&gt;submit a patch &lt;/em&gt;&lt;/strong&gt;or &lt;strong&gt;&lt;em&gt;well if you can do better, write your own framework. &lt;/em&gt;&lt;/strong&gt;In other words, put up or shut up. &lt;/p&gt;  &lt;h1&gt;We’re not all Einstein&amp;#39;s&lt;/h1&gt;  &lt;p&gt;It’s not always a patch they are after. At times, when you find a bug, an OSS team member can ask you for a failing unit test. Now granted that we all strive to unit test and promote unit testing, feeling that every developer should know, understand and practice unit testing, the reality of the matter is that it’s not all green pastures out there. For one reason or another, not everyone has that knowledge, the ability or the opportunity to. So often, sending a failing unit test can seem daunting. &lt;/p&gt;  &lt;p&gt;Of course, coming back to patches, there’s the added issue of figuring out how to work with the given source control the project is using, get the right unit testing frameworks to run, creating new unit tests, making the necessary changes, submit them and wait for your pull request to be accepted.&amp;#160; And that’s if the project is using a DVCS and you can figure out what Pull, Push, Clone, Fork and Checkout mean. All this doesn’t even take into account that you need to figure out how the actual code-base works. And we all know understanding other people’s code isn’t easy.&lt;/p&gt;  &lt;p&gt;For someone that is merely using an OSS project, all this can be overwhelming, not to mention intimidating at times. &lt;/p&gt;  &lt;h1&gt;Lowering the barrier to adoption&lt;/h1&gt;  &lt;p&gt;The OSS community often complain how big “Enterprise” and “Microsoft” shops don’t buy into OSS. It seems they go for commercial software in order for their legal departments to have someone to sue in case things go wrong. A little far-fetched of course, but nonetheless something you hear often. These shops also go for commercial software because it provides them with someone to call, someone that won’t tell them to submit a patch or provide a unit test. Someone they can call when they need support and not be judged (or at least not humiliated publicly on a forum or mailing list). Of course, the somewhat sad irony of this is that often, the support provided on OSS projects outdoes commercial products by a long shot, and that’s not to mention OSS projects that offer the possibility of commercial support. &lt;/p&gt;  &lt;p&gt;However, we need to look at ourselves and see how much of this low adoption of OSS that we’re so passionately fighting for is our fault. If we expect all the users of our projects to know how to work with our source control or compile the source and deal with dependencies, submit patches or work with our testing framework, all we’re doing is raising the entry barrier to OSS.&lt;/p&gt;  &lt;p&gt;Before shouting that I’m stereotyping OSS projects, I’m not. I’m well aware that there are amazing projects out there with beautiful and thoughtful teams and communities around them that make many commercial support alternative envious. However, I’ve seen the &lt;em&gt;submit a patch &lt;/em&gt;attitude often enough, over the many years I’ve been involved in OSS to warrant mentioning it. &lt;/p&gt;  &lt;h1&gt;What about me? What about my time? &lt;/h1&gt;  &lt;p&gt;Now there is the opposite side to all this. You. The Project Lead. The Core Contributor. The guy that has spent several years of his life giving to the community, contributing to OSS projects, helping others. Why should you, despite having given so much, take more of your time to help others. The minimum, that someone that is using your project (for free might you add), owes you, is a failing unit test. No? Not just some lousy steps to reproduce… &lt;/p&gt;  &lt;p&gt;Here’s the thing. If you’re working on OSS, you’re doing it because you are benefiting from it. You benefit because you enjoy it. You benefit because you learn. You benefit because you potentially can rise to fame (albeit a micro-celebrity), and you benefit because it can ultimately provide you with potential consulting and training opportunities.&lt;/p&gt;  &lt;p&gt;Nobody owes you anything for working on OSS! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=69469" width="1" height="1"&gt;&lt;img src="http://feeds.feedburner.com/~r/Devlicious/~4/mLbG6HjcH4M" height="1" width="1"/&gt;</description><category domain="http://devlicio.us/blogs/hadi_hariri/archive/tags/OSS/default.aspx">OSS</category><feedburner:origLink>http://devlicio.us/blogs/hadi_hariri/archive/2012/02/06/submit-a-patch.aspx</feedburner:origLink></item></channel></rss>

