Tim Leung This weeks article comes from Tim Leung an analyst/programmer based in Reading with 10+ years experience of architecting, designing and developing applications. In his spare time he runs the UK VBUG user group.

LightSwitch is the new rapid application development tool from Microsoft. The product team claim that it’s the easiest way to create applications for the desktop and cloud. The following article takes a look at what it has to offer and examines whether or not the claim is true.

Previously codenamed ‘KittyHawk’, beta 1 was released in August 2010. The product has attracted an active community of developers who are very enthusiastic about the recent release of beta 2. Beta 2 is faster, more attractive and includes a go-live license meaning that LightSwitch applications can be legitimately deployed into production.

For those unfamiliar with LightSwitch, a striking characteristic is that projects highly revolve around data. As such, it is regarded by some as a modern day .Net version of Microsoft Access.

Unlike Access, LightSwitch applications are built using well-known patterns and best practices such as n-tier application layering and MVVM, as well as technologies such as Entity Framework and RIA Services. In terms of data storage, SQL Server is natively used. On the client, Silverlight 4 applications are generated. These are configured to run ‘out of browser’ when applications are targeted for the desktop.

However, developers unfamiliar with this technology need not worry. Much of this complexity is abstracted away and knowledge of the underlying architecture is not required in order to build a working application.

In terms of development, LightSwitch uses the familiar Visual Studio 2010 IDE and projects can be based upon C# or VB.Net. When a project is first created, the start screen guides you through the table creation process. Known as the ‘entity designer’, tables are created using a graphical designer similar to those found in other products.

When creating columns, several new data types are available in addition to the traditional types such as string, integer and date. These 'business types' include email and phone number. The advantage of using these types is that LightSwitch includes built in controls for entering and validating data pertaining to these types.

In terms of user interface, end users interact with LightSwitch applications through ‘Screens’. At design time, screens are created based upon a chosen template. A fully functional screen can be created in seconds, simply by choosing a table and template type. This functionality is similar to the 'AutoForm' feature that many Microsoft Access users may be familiar with. The built in screen templates include templates for generating add, edit and grid type screens. A very useful feature is that while debugging, a ‘customise screen feature’ allows you design the user interface at the same time at which the application is running.

The screen designer is very different to the WYSIWYG type screen designers that most Winforms, ASP.Net or Access developers are familiar with. It consists of a hierarchical tree into which controls can be added. The presentation of screens can be further set using groupings. These grouping types include row, column, table and tab layouts. For example, textboxes and labels on a screen can be stacked one on top of each other by placing them into a ‘rows’ group. These groupings can be nested, therefore giving fine control over the screen layout. Developing screens in this fashion feels strange at first. However, it doesn't take too long to familiarise yourself and feel at ease.

LightSwitch further supports the ideas of theming in order to apply a consistent look and feel to an application. By default, a blue theme is supplied which mimics the look of Microsoft Office with a ribbon bar and side navigation panel. By modifying a single setting at design time, a completely different look and feel can be applied in seconds.

In terms of security, access to screens and table level permissions can be controlled at either a user or group level. Security groups can be set up visually through the properties of the project and .Net code can then be written to control the access. Beneath the scenes, it is technically implemented as a variation of the ASP.Net membership provider.

Deploying a LightSwitch application is equally simple. A checkbox allows you to switch between web and desktop mode. When set to desktop mode, much richer applications can be created. For example, COM automation can be used to integrate your application with desktop programs such as Microsoft Word or Outlook when in desktop mode. A wizard allows you to deploy applications using ClickOnce technology. This makes it easy to deploy updated versions when changes are made to your application.

In summary, is LightSwitch the easiest way easiest way to create applications for the desktop and cloud? For the hobbyist or for those with limited .Net development experience, the answer has to be yes. By using LightSwitch, it's entirely possible to create an application without writing a single line of .Net code.

For the more experienced developer, LightSwitch provides a very rapid development experience. Data driven applications can be quickly written without having worry about ‘plumbing code’. Furthermore, there are various extensibility points that allow you to customise your application. For example, custom SilverLight controls can be created to add functionality which doesn't exist out of the box.

The product team have done an excellent job on the product and LightSwitch is a great leap forward in terms of rapid application development using Visual Studio. However, don’t just take my word for it. Find out today how easy it is to create applications by downloading LightSwitch yourself!