Monthly Archives: November 2009

PDC09 Debrief

I’ve just returned from my first major conference, Microsoft’s Professional Developers’ Conference in Los Angeles, California.  I have to say, things were a bit different than I expected, but in a good way.  More on why later; first, the play-by-play!

Day 0

The air travel wan’t as bad as I expected it to be.  A quick hop to Houston, and then 3 hours to LAX.  When I finally got to the hotel (the Westin Bonaventure in downtown LA), I met up with Mike Huguet, a fellow user group leader from Baton Rouge.  We ended up down at the Figueroa Hotel with Chris Koenig, a Developer Evangelist from the South Central district, and enjoyed the open bar they had set up for PDC attendees.  I got to meet Dave Bost, the guy behind the Thirsty Developer podcast, and several other Microsoft employees.  We got a little glimpse into Microsoft culture by talking with these guys, and confirmed that the structure of myriad customer liaisons that Microsoft employs is a bit confusing, even to the insiders!  I had planned to go the Party with Palermo, and still rather wished that I had, but we were having such a good time at the Fig, we decided to stay.  We also ended up eating at this great little greasy spoon that only took cash, and has been open continuously, 24 hours a day, since 1924!

Day 1

The first day at PDC was pretty much all about Azure.  This was a bit disappointing to me, since the current application that I work on couldn’t really make much use of the cloud.  We have a relatively small user base (a thousand or so users), so scaling out really wouldn’t buy us much.  I went to the Future of C# and VB session with Luca Bolongese (who has an amazing Italian accent), but wasn’t really surprised by much there.  After that, I spent waaaay too much time standing in line to do an Azure hands-on lab.  I missed lunch and a session, and didn’t even get to finish the lab before the expo hall closed at 3:00.  That did, however, secure me a coveted badge stamp that would get me a free Flip video camera the following day (which my wife is loving for taking quick videos of our daughter Molly).  I went to a session on SQL Azure because I figured the database might be one place that we could actually use the scaling, but afterward I concluded that the sharding required to use it for large sets of data would create too large of an impact on our application.  The last session of the day, on PEX and code contracts, was interesting, and perhaps applicable since we’re looking to start using unit tests soon, but both technologies are still in the research stage, and may never actually make it into the framework proper.  All in all, a bit of a disappointing first day at the conference, but better things were in store for the next day.

That evening, I attended an “Influencers” party with Mike and a couple of guys from my old stomping grounds of Northwest Arkansas, Jay Smith and Jon Oswald.  I got to catch up with Colin Neller, a former co-worker at Data-Tronics and fellow Harding alum, as well as meet other community members that I’d only heard on podcasts before: Jon Galloway, Chris “Woody” Woodruff, and even Scott Hanselman.  It was cool to be able to put faces with names, and to see that those people are just human beings like you and me.  Jon in particular comes off as just about the friendliest guy in the world, really cheerful and willing to chat with anybody.  Some pretty nice food at that place, too, sushi and shish kabobs. Nom nom!

Day 2

This is when things really started to get interesting.  The Steven Sinofsky did a pretty good job with his part of the keynote, and of course, the announcement that we would all be getting free laptops certainly made him some friends. 😉  The Gu was great, as usual, despite the quadruple iPhone fail.  With the features he described about Silverlight 4, it’s really starting to look like a compelling platform.  The Silverlight team have really been killing it. They’re on a lightning-fast release pace, and not just fluff releases either.  They’re taking customer feedback, even going so far as to add elevation so that applications can do things outside the normal Silverlight sandbox, which at one point they said they’d never do.

The sessions were great that day, too.  Scott Hanselman’s MVC talk was great edu-tainment, and it was great to see some of the new templating features he showed off.  I went to an open source panel, and got to meet Miguel de Icaza, which was pretty cool.  I also had an interesting conversation with some of the people on the Entity Framework team.  We’re starting to think  about integrating an ORM into our product, and we were leaning toward NHibernate.  I asked the team members point blank why I should use EF instead.  They were pretty frank with me, and basically said “NHibernate is a mature product, and we’re still relatively new to the ORM space, but we’re making a lot of big strides in version 4.”  Between POCO support, transparent lazy loading, and the code-only (read “Fluent”) configuration model, most of the things on my wish list have been met.  It might be worth some further scrutiny at this point.  This is when I realized that all the stuff about getting to interact with the product teams was real, and not just conference marketing.

That evening, rather than going to the big “Underground @ PDC” party (for which there was an enormous line), Mike, Chris, Jay, John, and I hung out at the ESPN Zone, kind of a sports bar/restaurant a la Buffalo Wild Wings.  We had some great discussions about managing communities, Microsoft culture, the MVP program, and the role of Developer Evangelists.  I’m starting to get the feeling that this is the kind of thing one needs to go to conferences for.  Community leaders can talk via Twitter or email all the time, but it’s only during conference time that we get to take advantage of the high bandwidth of in-person communication.

Day 3

The third day was all about ALM tools for me.  I went to presentations on MSDeploy, the new Test and Lab Manager, Team System process customization, and a kind of roll-up presentation about starting from a project that just compiles to one that’s under CI with tests (unit and coded UI).  I also spoke with Microsoft employees from several different teams about our particular difficulties with database deployments.  I’ve got several ideas now, and I’m looking forward to seeing if we can reduce some of the pain that we’re experiencing in that area right now.  By this point in the week, I was pretty wiped out, so I headed to the hotel and crashed.

Takeaways

  1. Prefer interactions with product team members and community leaders to attending sessions. You can watch the sessions online later if you miss one you really wanted to see.
  2. Leave your laptop in the hotel room (locked up if you feel it’s necessary).  You really won’t use it that much, and carrying it around can start to get painful after a couple of days, particularly if you’re walking to the convention center from your hotel like I was.
  3. Don’t go out of your way to get swag. You’ll probably end up with a bunch of it without even trying anyway, and if you put a dollar value on your time, you’ll quickly realize that the gizmo you’re in line for.

Overall, it was a great experience.  Given how expensive it was, I don’t think it’s something I’m going to do again soon, but hopefully I can attend some smaller conferences next year. Since TechEd is in New Orleans this year, I think the Louisiana community may try to cook something up for just before or after.  Stay tuned for more info!

Single-Project Areas in ASP.NET MVC 2

The ASP.NET MVC framework brought a lot of benefits to the Microsoft web developer, such as easier automated testing and better separation of concerns, but it did come with its share of pain points.  One of those pain points was the difficulty of organizing the files in your web project.  By default, all folders that contained views, which were named after the controllers in your application, had to be directly under the “Views” folder that was provided by the framework.  For large applications, the number of folders underneath “Views” could get quite unwieldy.

To help alleviate this, in the first preview of version 2 of the MVC framework, the concept of “Areas” was introduced to allow an additional hierarchical level to controller and view organization.  It was implemented in Preview 1 using separate web projects for each area, each with its own “Controllers” and “Views” folder.

This was a definite improvement, but there was some pretty quick feedback from the community about the implementation.  Having a separate project for each area means that large solutions would end up with quite a few projects, which can dramatically impact compilation time.  I can speak from experience; the main solution I work on had over 80 projects in it when I first joined my current team.  Build time  was usually about 10 minutes, and that was just compilation, no tests or other things going on in the build.  When we reduced it to three projects, build time went down to about 10 seconds.  Needless to say, as our team starts thinking about doing some MVC work, we don’t want to go back to that place.

Thankfully, in preview 2, the MVC team provided the ability to create all your areas within a single web project.  This provides all the organizational benefits without the impact to compilation time.  To add areas to your MVC web project, follow these steps:

  1. Add a folder named “Areas” to your web project.
  2. Add a folder underneath the Areas folder with the name of the area you want to create, “Accounting” for example.
  3. Add a folder called “Controllers” under the Accounting folder.  Now, when you right-click on this folder, you’ll get the “Add Controller” context menu option.
  4. Add a folder called “Views” under the Accounting folder.  This will work just like the Views folder that gets created as part of the MVC project template.  You’ll have one folder inside the Views folder for each controller in your area.
  5. Add a new class  file to the Accounting folder named “Routes.cs”.  This class will need to inherit from AreaRegistration and override the AreaName property.  It should end up looking something like this:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    
    namespace MyProject.Areas.Accounting
    {
        public class Routes : AreaRegistration
        {
            public override string AreaName
            {
                get { return "accounting"; }
            }
    
            public override void RegisterArea(AreaRegistrationContext context)
            {
                context.MapRoute(
                    "accounting_default",
                    "accounting/{controller}/{action}/{id}",
                    new { controller = "Invoices", action = "ShowUnpaid", id = "" }
                );
            }
        }
    }
  6. You’ll also need to add a line to your Global.asax.cs file.  Simply call “AreaRegistration.RegisterAllAreas();” just before the first call to routes.MapRoute().

That’s it!  Well, almost.  Since you can have more than one area with the same controller name, when you create an ActionLink or something similar, you have to specify which area you intend to link to.  For instance, if you wanted to link to the ShowUnpaid action of the Invoices controller in the Accounting area from some other area, you’d do it like so:

    <%= Html.ActionLink("Unpaid Invoices", "ShowUnpaid", "Invoices", new {area = "accounting"}, null) %>

Note that if you’re linking to a controller from a view within the same area, you don’t have to specify it in the ActionLink call.

I think this is a great feature, and should allow us to maintain the current level of logical partitioning within our application.  Thanks to the MVC team for putting this in!