Top 7 Features of Visual Studio LightSwitch

Introduction

Microsoft introduced LightSwitch applications very recently. It is integrated with Microsoft Visual Studio which can be a standalone on Visual Studio 2010 or could accommodate itself as a part of the normal Microsoft Visual Studio 2010 IDE. The LightSwitch applications are introduced for creating a line of business applications which are more data-centric.

Most data-centric business applications perform the same basic CRUD (Create, Read, Update and Delete) operations. In such applications what the developer would do again and again is writing the same kind of code and developing a similar kind of UI.

Microsoft Visual Studio LightSwitch revolves around selecting the type of screen and defining the data for the screen. Below are the list of ready made screen types that Lightswitch provides.

  1. New Data Screen
  2. Search Data Screen
  3. Details Screen
  4. Editable Grid Screen
  5. List and Details Screen

The Lightswitch application eases the job of the developer by asking him to define a data source with a well defined schema and simply add the appropriate screen for it. Maybe a little customization and business logic should be written if required.

Microsoft Visual Studio LightSwitch can be downloaded from here. Note that only the Beta version of Visual Studio Lightswitch is released.

Fast Paced Development of Data-centric Applications

When using LightSwitch the development time is reduced as the developer doesn't have to spend much time on the UI and data access since the data screens are readily available and it can do the data access on its own. If any customization is required only then does the developer needs to intervene. This ensures a couple of things:

  1. The data-centric business applications are developed fast and in a stable manner.
  2. The final product gets into the user's hand in no time.

For example here are the steps for creating a sample working screen.

  1. Create the table to store data and define the schema for it.
  2. Select Add New Screen and select the required screen as shown in Fig 1.0
  3. Select Add New Screen and select the required screen
    Fig 1.0

  4. Run the application, you are done with add new or search module based on the screen you have selected.

By considering the above information you can understand how fast a data-centric application can be developed using LightSwitch.

Easy to Choose Whether the Application is to be Browser Based or Desktop Application

This is really an astonishing fact. Declaration of your application to run on a desktop environment or on a web browser is just a click away. Believe me this declaration shouldn't need to be done before starting off with the project but can be done during the course of development or even if the development is complete. All you need to do is go to the properties of the project and choose the application type that's it you are done. Check Fig 2.0

 choose the application type
Fig 2.0

Fig 2.1 shows the sample application selected to run as a desktop client

sample application selected to run as a desktop client
Fig 2.1

Fig 2.2 shows the sample application opted to be run in a web browser

sample application opted to be run in a web browser
Fig 2.2

Top 7 Features of Visual Studio LightSwitch

Support for Multiple Data Sources

Apart from the basic data source such as a normal database you could use the following data sources in the LightSwitch applications that you develop.

  1. Sharepoint
  2. WCF RIA services
  3. External Databases
  4. SQL Azure

Fig 3.0 shows the screen shot for adding Other Datasources.

[switch5.jpg]
Fig 3.0

Data Integrity and Validation is Straightforward

While you create the data table you would notice that there are business domain data types like EmailAddress, Money and PhoneNumber. These business domain data types increase the data integrity in the application as these fields would expect only data in specific formats like <emailid>@<domain>.com.

Another wonderful thing about the Lightswitch application is the data validation. The validation is performed on the screen based on the type of the underlying data and appropriate message is displayed as shown in Fig 4.0.

[switch6.jpg]
Fig 4.0

It doesn't stop there, in case the developer likes to provide a custom validation for a particular type then he can click the CustomValidation link available on the property window of that column. Fig 4.1 shows the screen shot of it.

[switch7.jpg]
Fig 4.1

Application Customization - On the Fly

Like the classic .NET applications in order to customize the UI the developer doesn't have to stop the application from running. There is an option available on the output screen saying "Customize Screen" as shown in Fig 5.0, simply click on it and do the required customization on the screen.

[switch8.jpg]
Fig 5.0

Note: This option will only be available when the application is run in debug mode. So when the application is given to the user in release mode this option will not show up.

Built On Top of .NET Framework

The best part of all is the entire Lightswitch application is built on top of .NET framework. As the name indicates the UI of the application is generated using Silverlight and the data retrieval is achieved using WCF RIA services. This gives developers the provision to perform custom implementations in C# Programming or Visual Basic using the .NET framework as required by the business.

Application Security - Authentication

Visual Studio Lightswitch application supports the below mentioned authentication modes.

  1. Forms
  2. Windows
  3. None

Go to the project properties and select Access Control. You will find the options to select the type of authentication required as shown in Fig 6.0.

[switch9.jpg]
Fig 6.0

The developer would be able to add the users if the "Granted for debug" option is selected as shown in Fig 6.0. Fig 6.1 shows the sample built-in add user screen.

[switch10.jpg]
Fig 6.1

Conclusion

I hope this article provided a good overview of Microsoft Visual Studio LightSwitch, its capability and the top 7 features. Most developers should be able to develop a decent data-centric application using LightSwitch pretty quickly. If you have any conflicts or comments then please make use of the comments section.

Happy reading!

Related Articles





About the Author

V.N.S Arun

I work for an MNC in Bangalore, India. I am fond of writing articles, posting answers in forums and submitting tips in dotnet. To contact me please feel free to make use of the "Send Email" option next to the display name.

Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • On-demand Event Event Date: October 29, 2014 It's well understood how critical version control is for code. However, its importance to DevOps isn't always recognized. The 2014 DevOps Survey of Practice shows that one of the key predictors of DevOps success is putting all production environment artifacts into version control. In this webcast, Gene Kim discusses these survey findings and shares woeful tales of artifact management gone wrong! Gene also shares examples of how high-performing DevOps …

  • On-demand Event Event Date: December 18, 2014 The Internet of Things (IoT) incorporates physical devices into business processes using predictive analytics. While it relies heavily on existing Internet technologies, it differs by including physical devices, specialized protocols, physical analytics, and a unique partner network. To capture the real business value of IoT, the industry must move beyond customized projects to general patterns and platforms. Check out this webcast and join industry experts as …

Most Popular Programming Stories

More for Developers

RSS Feeds