I have been wanting to play with Visual Studio LightSwitch 2011 for a while. I thought I will give the virtual labs a try. So, here is my take away from the virtual lab.
LightSwitch is the fastest way to build database applications for the desktop and the cloud. it is a new development tool designed to simplify and shorten the development of typical forms-over-data business applications. LightSwitch simplifies the development process, letting you concentrate on the business logic and doing much of the remaining work for you. By using LightSwitch, an application can be designed, built, tested, and in your user’s hands quickly.
Let’s start with a new LightSwitch Project:
Before getting started make sure the LightSwitch extension is checked:
Let’s go ahead and add a table:
This brings up the table designer:
Let’s add some columns to the table:
Using the Email Address type automatically enables validation to verify that user input for that field is a valid e-mail address.
Done with table definition, let’s create some screens.
Add a new screen and choose Editable Grid Screen:
Run the application and note that the application is divided into 3 regions: Ribbon, Navigation pane and Main Pane.
Try adding a row without a required field such as LastName and note the error notification.
Try providing a bad email address:
Lets create another table called Books:
For Category field, we will create a choice list:
Try entering non numeric values in the choice list: since category is numeric you can’t enter non-numeric values in category
Done, Save the project.
Now let’s create a relationship between Author and Book Entities.
Click the relationship button:
In reality a book can have more than one author, but for this exercise we will consider it is 1:many. A Author can have many Books.
Let’s add a screen to populate the Book table. Choose List and Details Screen from the list and name the screen as BooksListDetail
Run F5 to run the application:
Add a new Book:
We created a basic LightSwitch application and used LightSwitch’s main functionalities. We created two Tables with different properties to represent the elements (Books/Authors) of our application. Created a relationship between Books and Authors. Used special types such as EmailAddress, PhoneNumber and choice lists as property types for those elements. We created screens to display and edit the data. We didn’t write a single line of code to accomplish all of this!
Beth Massi Videos:
LightSwitch Developer Center
This blog post is a summary of the TechEd 2011 session where I highlight the key features of the product.
LightSwitch is the simplest, quickest way to build business applications for desktop or the cloud. This tool was designed with Business Users developing applications quickly with or without the assistance of IT. No programming knowledge is required, unless of course you want to add additional business validation to fields in which case the tool makes it real simple. Overall Visual Studio LightSwitch looks like a great product. Even if you don’t plan on using LightSwitch, I can still see it being used for creating Rapid Proof of Concepts where you can dish out screens quickly during the analysis/design phase of your project.
Start with Data:
Use Built-in validation for Phone Number, Email Address, Money etc
Adding Screens is easy: there are 5 built-in screen types.
You can remove table attributes you don’t want to see:
Click on the company name link to see the details. Links are known as summary properties in lightswitch.
You can also export the list to excel:
Display Customer and Order Details in the same page:
Create Calculations by writing VB code such as Totals or Validation for input fields.
and drag them onto the designer:
Create Choice Lists:
Use Re-usable Queries to show values.
Use Bing Map Controls:
LightSwitch supports Windows and Forms Authentication
Check to see if user is allowed to do something
Define permissions and check them in code at entity and property level
Permissions are granted through administration screens
Create roles and assign users to roles
User’s effective permissions is are combined permissions assigned to their roles
Just one line of code to check if a user can delete the order.
Application can run entirely on user’s desktop
3 tier desktop app:
User interface runs on user’s computer
Middle-tier runs on IIS/Windows Azure
3-tier web app:
User interface runs on browser
Middle-tier runs on IIS/Windows Azure
Use the publish wizard to publish the application.