August 09, 2011

Visual Studio LightSwitch 2011 – Part 1

Visual Studio LightSwitch is basically a set of templates/Wizards and runtime components that help you build and deploy applications for creating, editing and querying business data. The tool either installs on top of VS2010 or presumably installs its own Visual Studio shell, if you don’t already have it installed (I do, although I’m guessing the target audience for this tool generally would not).

From a runtime perspective, LightSwitch relies heavily on Silverlight, which it uses to provide a rich UI based on your data model (without you actually having to design it). All in all it’s very interesting (and possibly revolutionary) technology, which may actually deliver on the promise to allow people to develop business applications without writing a single line of code.

Over the next few posts I’ll take it for a spin with a simple data-centric application to give you a feel for its capabilities, and to see whether LightSwitch delivers the goods.

Before going any further, I should probably point out that I don’t see a direct way for making use of LightSwitch when developing applications for AutoCAD. So if you’re not interested in applications working elsewhere – on data stored in centralised databases or in systems such as SharePoint – then you may want to stop reading now.

I first installed a beta of LightSwitch and used it to build a simple SharePoint application back in April (my team uses SharePoint to store our quarterly performance goals, and the current UI for creating new goals could certainly benefit from a little streamlining).

One reason I didn’t go further with the tool, at the time, was the lack of support in LightSwitch for “many-to-many” relationships in SharePoint (such as optional, checkbox-style items which we use to categorise our goals in different ways). Much to my disappointment, this limitation is still there in the final release (probably for very good reasons), but I’ll go ahead and use the same basic example to show LightSwitch in action, even if it seems unlikely to meet my own business needs for the tool.

After installing LightSwitch…

Launching it brings up VS2010 with a couple of LightSwitch project templates:

Choosing one or the other to creating your project will lead to a streamlined “Getting Started” page:

You can, of course, choose to create your own database table(s) to store your data, but I chose to attach to an existing SharePoint data source:

Which required a URL and identification information:

After some time querying the server, the Wizard came back with a list of SharePoint-resident items to be imported:

And it’s at this point that we hit the “many-to-many” issue with the two relationships (between a Goal and its Workgroups & Categories, respectively):

At this stage we have our basic Visual Studio LightSwitch project created. In the next post we’ll flesh it out with some (hopefully useful) behaviour.