Todd Anglin's Code Campground

A casual look at the world .NET coding
What "cloud computing" means to you (it's important)

cloud computing It is amazing to me how quickly the the noise surrounding cloud computing has grown. Overnight cloud computing has become a mainstream talking point with everyone postulating how enterprising start-ups and lumbering enterprises will use the emerging technology in software projects. InformationWeek is running cover stories on cloud computing, Microsoft is touting their new cloud services, and even Apple is getting-in on the game with MobileMe. It seems cloud computing has replaced software as a service as the most popular water cooler talk.

And if you ask me, cloud computing is much more interesting and much more able to be a "game changer" than SaaS ever was. SaaS always seemed like a fancy way to describe hosted applications. It really wasn't anything new- eBay has been providing SaaS auction services for years- just a change in focus and maturity. Even as a young entrepreneur, I built career fair management software that I sold to customers from my hosted environment- who knew I'd "stumbled" on the SaaS business model.

Cloud computing, on the other hand, is substantive. It is bringing real, game changing technology to the table that is going to enable a new generation of entrepreneurs to capitalize on never before possible access to cost-effective, low-risk scaling. In other words, cloud computing is going to give little ideas the ability to reach big audiences without millions of dollars in financing. That's an exciting development if you're like me and you're always looking for ways to bring your ideas to life without investing your wife's life's (Freudian slip) savings.

The impact of cloud computing on .NET developers should be big, too. I fully expect to see cloud service integration become standard practice in .NET applications and a new crop of tools to emerge that will help developers with the challenges cloud computing presents (network latency, dynamic scaling, etc.). At the component level, I wouldn't be surprised to see new data controls that enable you to easily bind to cloud data or ORM tools that make managing scalable data in the cloud as easy as managing a single instance of SQL Server. Unlike SaaS, cloud computing will have an impact on your daily developer life.

For those of you less interested in the business impact of cloud computing and still struggling to see its purpose, there are clear consumer driven applications of cloud computing sprouting-up at the world's major software producers that should provide some clarity. Take, for instance, the "could drive."  The long awaited drive that lives on the Internet, enabling users to save their files on their computer and access them anywhere, anytime.

Microsoft and Apple are prepping services that bring this dream to life. Microsoft's LiveMesh is a software + services approach that uses a small client install to enable seamless file synchronization between all of your devices (PC, Mac, and Mobile). Similarly, Apple's iDrive, previously part of .Mac and now a member of MobileMe, enables you to save files on your Mac and easily access them on the web or on another PC. Apple provides its software integration at the OS level, but end result is very similar to Microsoft's and both offerings rely on cloud services and storage to deliver the anywhere, anytime data access.

With Microsoft's offering in particular, developer's have a unique solution to one of the biggest problems facing Silverlight: no local file system access. How do you build web-based replacements for client-apps if you can't save files to the local file system? Live Mesh. Using the Live Mesh APIs, you simply save an user's file to the cloud and the cloud in-turn syncs the file to the desktop. It's roundabout, sure, but it's also compelling since this approach should mean the file is always available to your online app, even if the user travels to another computer.

But where's Google? Long before LiveMesh and MobileMe were twinkles in a marketer's eye, Google was rumored to be building "GDrive," a Google-powered cloud storage service that you could use to backup and access your files. Since the early rumors, though, Google has been mum on the GDrive topic, allowing both Apple and Microsoft to beat the perennial cloud proponent on what should be their own turf. It is bizarre that Google appears to be a late mover in the cloud computing space, but I think it's safe to bet Google will eventually make their move.

Until then, the work by companies like Microsoft, Amazon, EMC, and others make it clear cloud computing is here to stay, and in a big way. And while I don't think the term "cloud computing" will last forever, the use of the Internet as an applications platform will.

Silverlight Mobile Road Map Refresher

In keeping with my apparent "theme" this week of providing you with some Silverlight detail refreshers, I want to bring-up the topic of Silverlight for mobile platforms. While it has been widely known since the earliest days of Silverlight that mobile platforms would be supported, little attention (or scrutiny) has really been applied to the portable plug-in. In fact, if I were to ask you to tell me about Silverlight's mobile plans right now, you'd probably list these details:

  • The plug-in will not require you to change your Silverlight code (build once, deploy everywhere- ideally)
  • The mobile plug-in will be available for Microsoft Windows Mobile and Nokia S40/S60 and Internet Tablet platforms.
  • Microsoft is actively trying to develop partnerships to deploy the plug-in on other mobile devices. And no, the iPhone is not on the known short list.

But quick! Tell me which version of Silverlight is coming to the mobile platform first? And when is that version going to be available? If those answers don't come to you as quickly, I don't blame you. The information is not really circulating as prominently as it should be.

In my preparation for a recent trip to India- the place where all Silverlight Mobile development is done, by the way- I collected the latest known public details on Silverlight's mobile road map and will share them with you here. In short, Silverlight's road map looks something like this:


What's this diagram saying? Exactly this:

  • The first version of Silverlight for Mobile is going to be Silverlight 1.0 (JavaScript only - no .NET) and a CTP should be available any day now.
  • We'll get the first "official" Silverlight for Mobile (1.0) towards the end of this year, sometime after Silverlight 2.0 officially ships for the desktop. Around the same time we should get a CTP of Silverlight 2.0 for Mobile.
  • Finally, around this time next year we'll get the .NET-loving version of Silverlight for Mobile.

It appears that the Silverlight for Mobile development is lagging about a year behind it's desktop counterpart, which may come as a surprise to some. The real take-away here, though, is this: if you're planning on doing any Silverlight development for mobile platforms, don't expect to begin rolling-out production applications until early 2009. If you want to roll-out applications that re-use that fancy Silverlight 2.0 .NET you're writing now, expect to wait 'til next summer for production.

This post isn't intended to be "doom and gloom" on the Silverlight for Mobile road map, but rather a reality check for any developers that are getting increasingly excited about Silverlight 2.0 and are starting to make plans for real application development. Silverlight for Mobile is definitely coming- and it will be cool when it arrives- just don't expect to launch new Silverlight 2.0 apps completely cross platform (as in, including mobile devices) until sometime next year.

Isolated Storage changes in Silverlight 2

This isn't exactly what you call "breaking" news, but it is news that I don't see getting enough coverage. I also just noticed that I've been doling out bad info in my recent Silverlight 2 beta 1 presentations, so I wanted to take a minute to correct the record and set things straight.

The News

In short, Silverlight 2 beta 1 introduced some changes to the Isolated Storage API and its defaults. In Silverlight 1.1 alpha, the default Isolated Storage quota size was 1 MB. In Silverlight 2 beta 1, the default has been reduced to 100 KB. The issue is not that significant, and I expect many Silverlight apps will not have a problem staying well inside of this quota. But if you're planning on making any "significant" use of the Isolated Storage, be prepared to hit your quota limit fast in Silverlight 2.

The other tidbit that was news to me is how API for requesting a larger quota works. While the API for requesting a larger quota makes it appear like you can request any quota size you'd like (it accepts a size in bytes that you want to set the quota to, after all), in reality there are only a few discrete quota sizes you can use: 100KB, 1MB, 5MB, 10MB, and Unlimited.

That means requests for sizes larger than one if the discrete values will automatically round-up to the next valid quota size. And if your request is for a quota larger than 10MB, Silverlight will automatically ask the user to give you an "unlimited" quota. What's not clear at this point is what "unlimited" means, but it is likely that space will be limited by some user-configurable value (in the soon to arrive Isolated Storage configuration menu). I expect it will be very similar to the way users configure the allowed size for IE temporary files.

I also think that this setup, however well conceived, means the Isolated Storage API should be altered. Why use an API that accepts a freely defined integer value when only 5 distinct options are available? Perhaps an enumeration would make things more clear. In the absence of a clear API, though, just make a mental note and don't be surprised when your request for 2MB is automatically translated in to a request for 5.

Quick Review

For those of you that have yet to try increasing the Isolated Storage quota, the process is very simple. All you must do is tell Silverlight how large you'd like to make your application's storage quota (in bytes) and it will prompt the user asking for their permission to grant the increase. If they approve it, you're in business. If they don't, you must design your application to handle rejection. See the code snippet below for a quick look at how the API works.

// Obtain an isolated store for an application and ask user
// to allow quota increase
    using (var store = IsolatedStorageFile.GetUserStoreForApplication())
        // Request to increase the quota size
        Int64 newQuotaSize = 1 * 1024 * 1024; //1MB
        Int64 curAvail = store.AvailableFreeSpace;

        // If available space is less than
        // what is requested, try to increase.
        if (curAvail < newQuotaSize)

            // Request more quota space
            if (!store.TryIncreaseQuotaTo(newQuotaSize))
                lblAlert.Text = "Increase rejected.";           
                lblAlert.Text = "Increase approved.";
            lblAlert.Text = "1 MB is still available.";
catch (IsolatedStorageException ex)
    lblAlert.Text = ex.Message;

Beyond that, there are only a few additional facts important to remember about Isolated Storage quotas:

  • While Silverlight Isolated Storage files are isolated at the application level (per XAP), the quota is set per domain. This design is for security, and MS's Wilco Bauer has a good explanation on his blog.
  • Isolated Storage is a non-volatile cache. That means it won't be cleared by browser cache resets. The files are stored separately and can only be cleared by the Isolated Storage API (in other words, programmatically by your app) OR by the user with the forth coming configuration menu.
  • Isolated Storage is shared across browsers. Changes made to files in Isolated Storage in Firefox are accessible in IE and vice versa. That also means they share the same quota, so you don't get separate space allocations for each browser.
  • You can only access the GetUserStoreForApplication() method within a Silverlight initiated event (such as a Silverlight button click). You cannot fire requests to increase the quota arbitrarily- you must respond to some user action.

Hopefully this post helps highlights some important changes in the Isolated Storage quota system in Silverlight 2 beta 1 and sets you up for successful development on the soon to arrive Silverlight 2 beta 2. Assuming it doesn't make any more significant changes...

Second Life Heroes Launch Event Tomorrow


[Content cross-posted from]

I regret not giving this event more coverage, but late is better than never  (right?). Tomorrow, Saturday, April 26th, in the vast realms of Second Life, Microsoft and the Second Life .NET User Group are putting on a virtual Heroes Launch. You may have seen Heroes Happen Here Launch events in the "real world" over the last few months. They are being organized all over the globe to help get people introduced Visual Studio 2008, SQL Server 2008, and Windows Server 2008. And now they're even being organized "out of this world" and in the virtual realms of Second Life.

All of the action will kick-off tomorrow at 9:00 AM SLT (Second Life Time = PST) and run 'til about 5:00 PM. To join the fun, all you need to do is make sure you've downloaded and installed Second Life (it's free), created a goofy avatar (as in silly, not the Disney character...though I guess you could do that, too), and then transport on over to the new Microsoft User Group Island. It really couldn't be easier and it is a great way to get involved in the launch events if you've been unable to attend one in RL (real life, for uninitiated).

For a complete and detailed schedule of tomorrow's events, visit the Second Life DNUG website. It looks just like a real world conference schedule- the only difference is you can attend this one in your PJs. So get everything setup tonight and then come on out to the event tomorrow! If nothing else, I'll be at the event for a while and would love to meet you- look for the very normal avatar sporting the Telerik t-shirt and going by the name Bluelaser Hax.

What's cooking for Silverlight 3.0?

silverlight3Beta Even though Silverlight 2.0 has yet to see the "official" light of day, we know that the beta introduced at MIX08 represents a "feature complete" version for this release cycle. Between beta 1 and the RTM expected towards the end of summer, Microsoft will not add any major new features to the Silverlight platform. Instead, they'll focus on performance improvements, platform stability, and a number of other "polish" issues like ClientBin security.

Imagine my surprise, then, when I completed a short survey sent to attendees of MIX08 asking for input on how we'd like Microsoft to improve Silverlight. Clearly, we're talking about a version of Silverlight beyond 2.0, but nonetheless I found it interesting to see the questions on Microsoft's mind when it comes to talking about the future of their infant platform. There were plenty of questions you'd expect- Are you using Flash? Have you heard of Air? What do features do think are important in Silverlight 2?- but most interesting to me was a list of features Microsoft asked survey takers to rank.

A list of 20 possible "new features" in Silverlight was presented and we were asked to rank each as a "Must [have]", "Nice [to have]", or "Not [needed]" (I've extended the cryptic ranking descriptions for clarity). Here is the complete list of features presented:

  • Richer text control                
  • Support for spell checking                
  • Support for inline tables                
  • Support for PDF                
  • HTML rendering                
  • Printing                
  • Offline storage                
  • Local database storage                
  • Database synchronization                
  • Can install Silverlight application on desktop                
  • Access to local hard drive limited to MyDocuments                
  • Access to all of hard drive                
  • Can drag & drop from desktop to Silverlight                
  • Ability to create new Silverlight windows                
  • Support for device access such as USB                
  • Hardware accelerated graphical effects                
  • Blend modes                
  • Frame based animation                
  • Inverse kinematics / bones                
  • 3D

What makes this list very interesting is that it is from Microsoft, which means these are the features on the minds of the Silverlight development team. Some of the ideas seem inevitable, like offline storage, a richer text control, and printing support, while others really surprised me, like access to all of a hard drive and hardware accelerated graphical effects. This survey wasn't sent on April 1st (it's been sitting in my Inbox for a while), so none of these are April Fools, including access to all of a hard drive!

In fact, almost half of the features deal with adding more interaction with and access to the local computer. I know many people would love more local system access in Silverlight, but that has generally been regarded as an impossibility if Silverlight has any hopes of remaining a secure and trustable plug-in. That makes me wonder if this list represents features Microsoft really thinks it can implement or simply a collection of the most often requested features. My hope is for the prior, though I have no idea (and I'm sure MS doesn't either) how some of these features could be implemented securely.

Also interesting are the features absent on the list. Where's the interest in full .NET support? Where's the requests for easier data binding? Or how about just improved text rendering? (Or am I the only one that thinks Silverlight renders text a little blurry vs. the browser?)

So what do you think of this list? Are the features you want in the next version of Silverlight represented? If not, now's the time to start sounding-off and letting your requests be heard. Before you know it, Silverlight 2 will be official and the feature set for Silverlight 3 will already be well underway.

Fixing Vista's Default Web Development Settings

File this under "used to be easy with XP" tips and tricks for Vista. As a long time web developer on XP (all the way back to "classic" ASP), I feel I am pretty comfortable around IIS. I've successfully configured many a development site over the years and never really had much trouble. That's all changed with my recent upgrade to Vista Business and IIS7.

Now, I didn't really notice the problem at first because I was using Visual Studio's built-in web server to test most of my sites (remember the days when that wasn't an option...). While doing some performance tests for Telerik, though, I was forced to leave Visual Studio and run a site in my shiny new IIS7. I created my new "application" just like I would have a Virtual Directory-based site in IIS6 and browsed the site in Firefox. Server Error.serverError

Server Error 500.19? Say what? I set-off checking my configuration files, making sure everything looked correct, confirming that my sites did work in Visual Studio's web server, and still, IIS served-up this "friendly" 500.19 error. So after some quick Googling (sorry Live Search, maybe after you buy Yahoo!'s search tech...I'll, er, um...give it another try...), I discovered that my wonderfully secure Vista Business installation disables ASP.NET development by default!

ASP "classic" development is enabled; ASP.NET development is not. Really?! In this day and age of .NET, why would you enable IIS development features without enabling .NET support? In my opinion, this is a bad choice on Microsoft's part. Fortunately, the solution is easy.

First, open your control panel and launch the Programs and Features interface (or type Programs in your Vista start search to find it quickly). Click on the "Turn Windows features on or off" side link.


When the the configuration window opens (and finally loads), look for the IIS settings section. You'll notice that it is "checked" with a blue box indicating not all sub-options are enabled.


Expand the IIS node and look for the World Wide Web Services > Application Development Features section. You should see that the .NET Extensibility and ASP.NET sections are unchecked. Check the ASP.NET node and the .NET Extensibility node will automatically get checked, too.


Click okay, wait a while, and you should be back in business.


Hopefully this seemingly obvious tutorial will help someone out there with the unnecessary pain that comes with the XP to Vista developer transition. If you find yourself hitting the 500.19 Server Error, this is probably your solution.

Top 5 Ways Microsoft Will Use Silverlight

Microsoft Silverlight 2.0 Beta With MIX08 less than a week away and, in turn, the expected arrival of the Silverlight 2.0 beta, I thought it would be fun to ponder how Microsoft is planning to use their new browser-based, cross-platform plug-in. After all, history reveals that many Microsoft platforms have their roots in satisfying internal Microsoft project needs (we owe the "X" in Ajax to the Outlook Web Access team), so it's only fair to assume that from the get-go Microsoft saw the opportunity to use Silverlight to build (or enhance) new products. The question is, which products will get the Silverlight treatment and when?

To create my "Top 5" list, I've scoured the Internet for clues, pondered the skunk-works projects in Microsoft's Live Labs, analyzed Microsoft's competitive landscape, and tossed-in a dash of "gut feeling." Clearly, a thorough scientific process. What follows is my best guess at the products Microsoft is planning on building on Silverlight in the next few years.

  1. Microsoft Office Web Edition
    This is the inevitable purpose of Silverlight: to enable Microsoft to deliver the full Microsoft Office experience via the browser. Do you think Microsoft intends to sit idly by while competitors like Google threaten its Office cash cow online? You'd be crazy to think so. I think the reason we haven't seen a serious online Office attempt from Microsoft yet is because they're waiting for a mature Silverlight platform to make the jump. And assuming the next version of Office for Windows is going to be WPF/XAML based anyway, it makes all the more sense to build for Silverlight.

    The key barrier to an online Office experience with Silverlight is obviously local file system access (which Silverlight lacks for security). But given Microsoft is already experimenting with a Windows Live Drive, that is a problem easily solved with cloud storage. I think there is no question that Office running on Silverlight is a question of when not if.

    Likelihood: High
    Arrival: With Office 14 (Note: There will be no Office 13, for obvious naming reasons).

  2. Radically new online mapping tools
    The online competition for mapping tools has really reached a plateau. Google Maps and Microsoft's Live Maps add new features every now and then (like the Google's cool ability to adjust your route), but nothing has been "earth shattering" for a number years. The move to Ajax-based ZUIs (Zoomable User Interfaces) was the last "big" transition for online mapping and that's several years old now.

    If Microsoft introduces a Silverlight version of Live Maps, though, we could start to see a slew of new features delivered to online mapping. For starters, with the .NET framework running in the browser, routes could be quickly calculated and adjusted without the need of significant help from the server, leading to more powerful routing tools. Then, with the strong animation support in Silverlight, routes could be previewed similar to the experience you get with today's GPS units (and similar to a feature has, but with more "richness"). The possibilities with a plug-in based tool are endless.

    Even more interesting, though, is the mounting evidence that Silverlight 2.0 will include a technology from Microsoft Live Labs called Seadragon. Seadragon is a technology Microsoft purchased in late 2006 that enables huge amounts of visual data to be smoothly browsed over a network, regardless of bandwidth. According to the research site, Seadragon provides transitions that are "smooth as butter" with performance tied only to the pixel-to-bandwidth ratio. With this technology in Silverlight, the map ZUI that we've come to love could get a big boost.

    Likelihood: High
    Arrival: Within a year

  3. Cross platform .NET IDE
    Before you scoff at the idea, hear me out. One of the key "problems" with .NET is that the only way to really develop .NET is on Windows with Visual Studio (there are other "less elegant" ways, but really...come on). With Silverlight making the push to build the .NET framework on OS X and Linux, there will be new reason for developers on those platforms to want to use .NET to build applications. If Microsoft can create a simplified Visual Studio IDE running on Silverlight for those developers, they could start to increase .NET adoption in the traditionally non-.NET Linux and OS X dev crowds.

    Clearly, this task is not without its challenges. Even more so than Office, a Visual Studio product that doesn't have direct access to the file system would be a hard sell. Maybe this product could drive an innovative and secure way to grant a Silverlight application access to a user's PC- I'm sure Enterprises are going to want that functionality sooner rather than later, anyway. Beyond that, an IDE would also assume the availability of the full .NET framework (something Silverlight isn't delivering in 2.0). This opens up the speculation that maybe future plug-ins could quietly stream (with user permission, of course) a full, cross-platform .NET framework to their PCs so future Silverlight apps could take advantage of all .NET framework features. Time will tell...

    So while a browser-based IDE is a stretch, even simple tools with IntelliSense support would be a step in the right direction. Hopefully Microsoft will make some .NET dev tools- Silverlight or otherwise- available cross platform as the .NET framework moves that direction.

    Likelihood: Eh...
    Arrival: Beyond Silverlight 2.0

  4. Accelerated Software + Service
    Assuming the full .NET framework eventually makes it to Silverlight, and assuming something is done to make local file system access possible, Silverlight could very quickly enable Microsoft to accelerate its path down the Software + Service road. If the Yahoo! deal isn't evidence enough, Microsoft's actions over the last couple of years should make it clear that they are trying to reinvent themselves as an online company capable of competing with Google on its home turf. So far their progress has been slow and largely unsuccessful (thus the Yahoo! deal). A new .NET-enabled platform like Silverlight could help Microsoft quickly port a number of its consumer applications to web-based versions.

    The "software" in the Software + Services model in this case would be the light-weight and flexible Silverlight plug-in. The "services" would be the applications delivered via the plug-in, likely sold on a subscription model or supported via ads. While Google could in theory do the same with Flash, the key difference is that Microsoft already has a large and successful portfolio of consumer desktop applications. If Microsoft can convince those people to try online versions of the tools they're used to, they may capture a large portion of the market Google can't reach. And if you're Microsoft, everything these days seems to be about beating Google.

    Likelihood: Maybe
    Arrival: 1 - 2 years

  5. Cross platform data mining
    This is less of a possible Microsoft "product" and more of a possible Microsoft "use" for Silverlight. To the best of my knowledge, this is the first time Microsoft is releasing a tool that will work on all three "major" OS platforms- Windows, OS X, and Linux. It's also one of the first browser tools from Microsoft that works in all three "major" browsers- IE, Firefox, and Safari. Combine that with the Silverlight plug-in's ability to automatically update itself- which implies "phone home" capabilities- and you have a plug-in that will give Microsoft an unprecedented look at the usage patterns of different browsers and operating systems.

    For example, as the Silverlight plug-in reaches the masses, Microsoft will have millions of plug-ins checking-in to see if new versions of plug-in are available. Clearly, to check for the right version, that "ping" will need to include browser and OS information. By analyzing that info, Microsoft can track first hand the fluctuations in the popularity of different browsers and operating systems (vs. what analysts report). Is that a privacy concern or a big value for Microsoft? Probably not, but it will be interesting to see what they do now that they're supporting "enemy" browsers and OSs.

So there you have it. The five things Microsoft is most likely to do with Silverlight in the next few years. Clearly, this doesn't cover at length the ways I expect Microsoft enhance Silverlight over the next couple of years or how I expect other companies to use this emerging technology. That's fodder for a different post.

Do you think I'm on track or have I missed the mark? I guess we'll start to know more next week at MIX!

North Houston DNUG meeting tonight

North Houston .NET User GroupThis is a bit of a late notice, but for any of you in the Houston area here's your official reminder that the newly founded North  Houston .NET User Group will be meting tonight (Thursday) at 6:30 PM. This is the second official meeting on the new Houston-area DNUG, and if the turnout is anything like week one, we should have a full crowd and a good time. Tonight's speaker is Claudio Lassala who will be talking about test driven development (aka TDD). The subject of TDD is increasingly becoming more common in .NET conversations as Microsoft introduces technologies that make it easier to do (such as the forthcoming ASP.NET MVC and the inclusion of VS Test tools in all Pro SKUs), so this is a great opportunity to come learn more about an important .NET topic.

For future reference, the NHDNUG meets the 3rd Thursday of every month at Lone Star Community College (formerly Montgomery College) in The Woodlands, Texas. Doors will open around 6:00 PM and the meeting will officially start at 6:30 PM. As per the DNUG norm, there will also be free pizza and drinks and some great giveaways. I think tonight's prizes include a copy of Expression Studio, a license for the RadControls for ASP.NET from Telerik, and a copy of Visual Studio 2008 Pro! So if you're in the area, you definitely don't want to miss this event. Set your reminders and I'll see you tonight at 6:30 PM!

For more details, visit the NHDNUG site:

Posted: Feb 21 2008, 02:58 PM by tanglin05 | with no comments
Filed under: , ,
The definitive UI component metaphor

Construction One thing you learn quickly when you leave a Fortune 200, well recognized Enterprise and join a smaller, much more exciting software company is that it is a lot harder to answer the inevitable "what do you do?" question. That is no more true than during the holidays, when you're visiting with distant relatives, many of whom still think of AOL as the Internet and think software is written by geeks in basements. Plagued by this problem, I have constantly sought the "perfect" metaphor for "what I do" so that anyone can understand software UI components. And at last I have the answer.

Rather than keep the metaphor to myself, I have decided to share this simple insight so that your future holiday conversations can proceed without awkward pauses and quick transitions to "how 'bout those <sports team here>". If you're not in the business of making UI components, then hopefully this metaphor will help you explain (or even understand) the role UI components play in software development.

UI components are doors and windows

The crux of the metaphor is this: UI components are to software developers what doors and windows are to a contractor (I know, more of an analogy than a metaphor, but go with it). Let me explain why this comparison is so perfect.

When a contractor is building a house, there are many pieces of the house that he buys pre-made to save time and money on the project. These are things like doors, windows, faucets, and fixtures. All contribute to the final look-and-feel of the house and all come with variety of "features". Windows may be double paned and filled with argon gas for insulation; doors might have decorative glass inserts or an easy-hang frame. At the end of the day, these are well-defined, commodity items that don't need to be custom made to build a beautiful custom home.

With enough time and money, though, there is no reason the contractor couldn't build all of these things himself. He could hand-craft the house's windows, doors, and fixtures. They would all be unique, one-of-a-kind items that were built to the exact specifications of the house.

But since the contractor is an expert at building houses, not windows or doors, the "features" or quality of the items he builds will probably be less than the doors or windows he could have bought pre-made. Even assuming he's had pervious experience building custom doors and windows on past houses, it's unlikely that he knows the latest and greatest techniques for building energy efficient items or has all of the expensive tools for doing advanced things like argon filled windows. For the sake of argument, though, let's say the home owners don't mind that they don't get all of the bells and whistles as long as the doors and windows work. Let's also say the contractor has the ability to build high-quality doors and windows.

Five years pass and the home owners have been happily enjoying their custom home and have decided to do some remodeling. The original contractor moved to a different state and is no longer available, so the home owners pick another qualified contractor. Part of the remodeling includes adding more doors and windows that match the original house, but since they are custom made, it is going to cost them a lot more on the new project. The original contractor didn't leave instructions detailing how he built the custom windows and new contractor is not as good at custom work. "Why didn't you just use pre-made doors and windows?" the new contractor asks. The home owners, faced with mounting maintenance costs, are starting to wonder the same thing.

At the time, it seemed okay to build custom doors and windows with their custom house. The contractor said it wouldn't be a big deal; he'd done it before. It cost a little more, but the contractor said it was better than depending on some outside window or door company. He failed to mention that they'd lose advanced energy saving features, have higher maintenance costs, and be on their own to fix problems- all issues that could have been avoided with pre-made items.

Complete the metaphor

In the previous illustration, simply substitute UI components for doors and windows, custom software development for custom home development, lead programmer for contractor, and management for home owners to bring everything back to software. It should be clear that a strong comparison can be drawn between home building and UI components. It is a much stronger analogy than comparing UI components to car manufacturing (a comparison I've seen before), where often the manufacturers do make many of their own parts (and then produce thousands of the same car).

In short, just like doors and windows for a house, UI components save software developers time and money by delivering advanced, well tested, and high quality tools that can be used in any software project. And down the road, when the original software team has moved on to new projects, the maintenance team has someone to turn to for help fixing problems or adding new features an application.

Hopefully this metaphor/analogy/illustration makes the concept of UI components easier for your to understand and easier to explain to your non-software friends and family. Now if only an equally simple analogy existed for the title "Technical Evangelist"...

Are you excited about ASP.NET MVC?

curious As I observe the reactions across the Internets about the forthcoming ASP.NET MVC framework, there seem to be two general reactions: those that can't wait to get their hands on the MVC framework and see this release as long over due, and those that don't see the point of rocking the WebForms boat. When I first heard about the new framework, I must admit that I fell in to the later camp. What would a new MVC framework let me do that I can't do (with all my years of experience and 3rd party tools) faster with WebForms?

Not satisfied to ignore the issue, I dug deeper and tried to learn all there is to know about the yet to be released framework. Along the way I learned some very cool facts about ASP.NET MVC that have moved me from one camp to the other. I'm now very excited about trying ASP.NET MVC and looking forward to the first preview bits that should be available in a couple of weeks. But I know there are many of you out there that still don't see the point of ASP.NET MVC, so I decided to provide the answers to some the questions I had before doing my research to help you see why ASP.NET MVC might be worth adopting. My goal is not to convince you that ASP.NET MVC or WebForms is better, but simply to help you, the overloaded programmer that is still trying to fully grasp WPF, WF, WCF, XAML, and Silverlight, quickly understand some key facts about the new ASP.NET tool.

My personal FAQS

How hard is it going to be to learn ASP.NET MVC?

There is no two ways about this aspect of ASP.NET MVC: it will have a learning curve that will require some time to master. ASP.NET MVC is a radical shift from the "traditional" ASP.NET method of page programming, where code and markup are (relatively) tightly coupled. Instead, "controller" classes will handle all of the processing logic and be wired to any number of "views" that render markup. Gone are the concepts of page postback (to itself, at least), code behind/beside, and (this is a big one) the page lifecycle.

But before you think this is the end of world and abandon interest in ASP.NET MVC, remember back to the days when you transitioned from ASP classic to ASP.NET. At that time, the strange world of "WebForms" seemed bizarre, with "code behind" pages, this crazy thing called "ViewState", and a complex "page lifecycle" to learn. "How could I leave my inline coding and top-to-bottom page evaluation to learn this fancy ASP.NET?" we thought. It didn't take long, though, for ASP developers to quickly understand the benefits ASP.NET brings to the table and flock to the new technology. So it may be again with WebForms and ASP.NET MVC.

While a lot is changing on the processing end of ASP.NET, many familiar concepts will continue to exist in MVC. Things like masterpages, themes, UserControls, ServerControls, and services like Membership and Profile will all be present and accounted for. Even ASPX pages survive as a valid way to create MVC Views. Some changes will clearly be required for ServerContorls (especially complex ServerControls like those that Telerik makes) to work in the new page lifecycle-less environment, but for the programmer using the controls these changes should be relatively transparent. The key change in MVC vs. WebForms is where the framework processes its logic and renders its markup. Not how.

Besides bringing MVC to ASP.NET, what's so special about ASP.NET MVC?

One of the biggest advantages of the ASP.NET MVC framework is that it will make ASP.NET applications much easier to test. Unit testing ASP.NET applications today can be a challenge since many objects in an application require the HTTP context to function properly. You can get around that requirement by implementing mock objects, but that is especially difficult when the objects needing the mocking are not based on interfaces. In ASP.NET MVC, all core APIs and contracts are interfaced so you can easily build your mock objects and run fast tests against your ASP.NET code. Hopefully some of this benefit can be back-ported to WebForms in the future.

Also in the realm of testing, the ASP.NET MVC framework does a much better job of enforcing clean separation of processing logic from UI markup. This is an inherent benefit of most MVC frameworks, so it should go without saying for ASP.NET MVC. Nonetheless, it will take what "code behind/beside" tried to do for the separation of logic and markup in WebForms to the next level and help ASP.NET developers enforce clean separation.

Beyond testing improvements, the MVC framework is also introducing some very interesting URL processing models for ASP.NET developers. In the past, if you wanted to use a URL like "/products/beverages/beer" you would need a URL rewriter (at the IIS level, in fact) to make it happen. Under the hood, the URL would really be something like "/products/detail.aspx?cat=1&id=20" and you'd use Request.QueryString to extract the values. With ASP.NET MVC, clean URLs are the norm and they have tight integration with the MVC controllers. For example, if an ASP.NET MVC app has the URL "/Products/Details/5", it automatically execute the "Details" method in the "Products" controller and passes the value "5" to the method as an input parameter. Pretty cool stuff!

Is it an either or decision: WebForms or ASP.NET MVC?

No. You can have an application that uses both WebForms and ASP.NET MVC. ASP.NET MVC is not replacing WebForms; it is simply another tool in the ASP.NET developer's toolbox to help them develop (and test) quickly and efficiently. But remember the age old truth: just because you can doesn't mean you should. I'd suggest you avoid the Frankenstein blended apps (like mixed ASP classic/ASP.NET apps) if you can.

What about my 3rd party UI components? Are they still usable?

Maybe, but in most cases UI controls (like those that Telerik makes) will probably have to be "tweaked" for the MVC environment. Operations that currently postback to the page (like sorting a RadGrid, for instance) will not work in the lifecycle-less MVC approach. But have no fear, Telerik is eagerly awaiting the preview bits for ASP.NET MVC so we can run our tests and determine exactly what you'll need to have the same level of productivity in an MVC environment (as I am sure other component vendors are doing, too).

Okay, this MVC thing sounds interesting. Can I download some bits?

Not yet, but according to a recent statement from Scott Guthrie, the first preview bits for the MVC framework should be available within the next couple of weeks. That means by the week of December 10th, you should be able to download the ASP.NET MVC framework and get your hands dirty with the approach to ASP.NET. Consider it an early Christmas present. It's up to you whether you'll consider it a lump of coal or beautiful diamond.

More Posts « Previous page - Next page »