Showing posts with label LightSwitch. Show all posts
Showing posts with label LightSwitch. Show all posts

Monday, January 16, 2012

Visual Studio LightSwitch 2011–Bookstore Virtual Labs

I have been wanting to play with Visual Studio LightSwitch 2011 for a while. I thought I will give the 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:

image

Before getting started make sure the LightSwitch extension is checked:

image

Let’s go ahead and add a table:

image

This brings up the table designer:

image

Let’s add some columns to the table:

image

Using the Email Address type automatically enables validation to verify that user input for that field is a valid e-mail address.

image

Done with table definition, let’s create some screens.

Add a new screen and choose Editable Grid Screen:

image

image

Run the application and note that the application is divided into 3 regions: Ribbon, Navigation pane and Main Pane.

image

Try adding a row without a required field such as LastName and note the error notification.

image

Try providing a bad email address:

image

Lets create another table called Books:

image

For Category field, we will create a choice list:

image

Try entering non numeric values in the choice list: since category is numeric you can’t enter non-numeric values in category

image

Done, Save the project.

Now let’s create a relationship between Author and Book Entities.

Click the relationship button:

image

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.

image

Click OK:

image

Let’s add a screen to populate the Book table. Choose List and Details Screen from the list and name the screen as BooksListDetail

image

Run F5 to run the application:

image

Add a new Book:

image

image

Summary:

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!

References:

Starter Kits: http://www.microsoft.com/visualstudio/en-us/lightswitch/starter-kits

Beth Massi Videos:

http://blogs.msdn.com/b/bethmassi/archive/2010/08/24/visual-studio-lightswitch-how-do-i-videos.aspx

LightSwitch Developer Center

http://msdn.microsoft.com/en-us/lightswitch

Monday, October 3, 2011

Rapid Application Development with Visual Studio LightSwitch

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:

image

image

image

image

Use Built-in validation for Phone Number, Email Address, Money etc

image

Adding Screens is easy: there are 5 built-in screen types.

image

Screen Designer:

image

You can remove table attributes you don’t want to see:

image

Click on the company name link to see the details. Links are known as summary properties in lightswitch.

image

image

You can also export the list to excel:

image

Display Customer and Order Details in the same page:

image

Create Calculations by writing VB code such as Totals or Validation for input fields.

image

and drag them onto the designer:

image

Create Choice Lists:

image

Use Re-usable Queries to show values.

image

Use Bing Map Controls:

image

LightSwitch Architecture:

image

Security:

Authentication:

LightSwitch supports Windows and Forms Authentication

Authorization:

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

image

image

Just one line of code to check if a user can delete the order.

image

Deployment Options:

2 tier:

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.

image

references:

http://msdn.microsoft.com/en-us/lightswitch

http://blogs.msdn.com/b/lightswitch/

http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DEV211