Sunday 23 June 2013

LightSwitch

If you want to build a quick and simple application to display and edit data, then Microsoft has released a solution for you. LightSwitch. It has been around for a while but now it supports 2 interesting features.

HTML client and SharePoint support. Both of the features are immensely valuable because now we are talking about quick prototype applications for any platform and not just desktop client. 

LightSwitch applications support 4 types of data sources - Database, SharePoint List, OData service, WCF RIA service. OData service is something that has now been treated as a standard way of exposing data related operations on the Internet - mostly because it is easy to consume and is HTTP based (which means it can be consumed by most applications running on most devices such as Windows 8 Store Application, Windows Phone 8 application etc.).


If you plan to create tables instead of using existing data sources, you can use the option "Create Table" which presents with a screen to design the table/entity. These entities are created as part of a local database "ApplicationDatabase".



It comes with built-in implementation for data validation, access control (Forms authentication and Windows Authentication with basic settings to configure permissions) and you are allowed to customize the screens and their navigation. So, while on a high level it is a quick data editing application maker, it can as well be extended to create regular LOB applications. More so, the HTML applications can be hosted in SharePoint and distributed via SharePoint application store.

Compiling a LightSwitch application produces a package (deployable application) which contains a lot of generated code including WCF services, JavaScript files, CSS files, XAP files, config files and client access policy. I created a simple application which had 2 clients (HTML and Desktop) and package looked like following:



Since the generate package is a normal .NET application, we should be able to modify the configuration entries and point to different database servers, deploy the applicationdatabase on a separate server, host WCF service on a separate server and point the application to that. A quick search for ApplicationData.svc in the generated package pointed me to the location in the code (javascript file named data.js) where the URL was being formed. Ideally i should be able to change this and make it work (I haven't tried it but it should work if there is no other kind of hard binding in generated code):



Hoping to use it to create useful applications in double quick time.

No comments:

Post a Comment