Visual Studio LightSwitch: Mort Lives!

Last issue, I talked about the new Web Matrix tool and Razor view engine syntax for building websites quickly and easily. This month, I’m going to talk about another tool recently announced by Microsoft called Visual Studio LightSwitch that simplifies development. (For more on LightSwitch see http://microsoft.com/lightswitch.) Like Web Matrix and Razor, it’s meant to appeal to Mort. Remember Mort? He was the persona created by Microsoft market researchers who represented “the professional line-of-business programmer who lacks a degree in computer science but has a great deal of familiarity with Office and VBA, and who typically writes productivity applications shared amongst his coworkers.” (See http://blogs.msdn.com/b/ericlippert/archive/2004/03/02/82840.aspx.) Microsoft used to cater to Mort quite a bit in the Visual Basic classic days. Classic VB shielded the Morts from the intricacies of software development that developers need to understand in the .NET era. Now that Visual Basic classic is no longer in the forefront, most Morts who need to build business applications turn to Microsoft Office and VBA as a solution.

The biggest issue that arises with using Microsoft Office to build business applications is that these applications quite often grow both in popularity and complexity. At some juncture, it’s decided that the application needs to grow up and become a “real” application. The project has likely exceeded Mort’s development skill set, so the application is handed over to a software development team. Typically, the application can’t be upgraded without a total re-write and data import/migration. This can be very costly and time consuming.

Visual Studio LightSwitch is an alternative software development environment in which Mort can build business applications. As its name suggests, the tool is based on the full-fledged Visual Studio. However, applications are built in a more “point and click” way, with minor customizations added in for good measure. As an example, the only decision you have to make to get a LightSwitch application started is “do I want to use Visual Basic or C#”. I would imagine that Visual Basic will be the answer to that question most of the time, given the audience that the tool is aimed at.

The application screens are built using Silverlight for client or web access, but (in Visual Basic classic style) the intricacies of XAML are hidden from Mort. Instead, screens are built using pre-created templates that suit the most common scenarios and actions for business applications. This may sound limiting at first, but the templates can be customized and new ones can be added. They are certainly adequate for the lion’s share of simple business applications.

There’s a tool for quickly creating database tables that is very reminiscent of Access. It has some neat additions, though, such as special datatypes (e.g., phone number, email address) that provide validation and formatting automatically at runtime. Additional validation and other business logic can be supplied by applying Visual Basic or C# code to event stubs that have already been created.

Data can also be pulled in from multiple outside sources such as SQL Server, SQL Azure, SharePoint, and Access (to name a few). You can even connect to Windows Communication Foundation (WCF) service endpoints. When the application is being run, any data that is displayed can be exported to Excel using a button on each screen. This is useful for additional analytics and the creation of charts/graphs and reports.

All of this is well and good, but most of you probably aren’t a Mort, so why should you care? Your big payoff comes when that inevitable decision is made to scale up a LightSwitch application to a full-fledged enterprise application. Before, you would have had to crack open the Visual Basic classic or VBA application that Mort created, analyze it, and then re-write it in Visual Studio using correct patterns and practices. However, LightSwitch projects are actually Visual Studio projects, so they can be opened right up for instant productivity in the scale-up effort. Proper patterns and practices have already been applied, so there’s no spaghetti code to unwind (except for what may be in the customization code stubs, but no solution is perfect).

Microsoft bills Visual Studio LightSwitch as “the simplest way to build business applications for the desktop and cloud.” I’m not sure I’d go that far because it’s pretty darn easy to build an application in Excel or Access. Rather, I’d amend it to say that it is “the simplest way to build business applications for the desktop and cloud that can be scaled into enterprise solutions without losing existing time and resource investments.” Not quite as catchy; then again, I’m a programmer and not a marketer.