Have you ever tried to create an application for entering information? For example, for a secretary, something like registering incoming correspondence cards? And so that was a dictionary of correspondents? A couple of three screens of reports, on the raw letters and correspondents? And it would be nice to link this application with your database marketing department. With seeming simplicity, this task entails a huge number of implementation options, technological solutions and techniques. And would you like to solve such problems, focusing only on data definition and minor modifications?
Last night, Microsoft released a new product, Microsoft Visual Studio LightSwitch 2011. The official definition of this product is “flexible development tool used to quickly create and deploy desktop business applications and cloud business applications.” If you're wondering what the LightSwitch really is, why it is positioned in that way and how it works, welcome to cat.
What is LightSwitch and why it allows you to quickly create applications.
Let's go back to the example that was given at the very beginning. Based on the definition of the data, we will build the application:
first step:
download and run
LightSwitch
')
second step:
we create a project and define data using business types for which we can immediately determine some validation rules.

The third step:
we define relations between tables

fourth step:
(optional) connect external, existing data sources

fifth step:
based on data definitions, we generate user screens

last step:
run the finished application

The time it takes to get a working prototype based on a data structure is literally measured in minutes. Separately, I would like to note that the product and its documentation are completely
localized .
LightSwitch Architecture
Many people wonder what is “under the hood” of the LightSwitch, on the basis of which technologies and architectural solutions it is built. The LightSwitch runtime is built on a classic three-tier architecture. The presentation layer solves the problem of interaction with the end user, and the main functions that he performs - visualization, editing and data entry. The logical layer processes requests from the client for editing, retrieving data and other operations. The main purpose of this layer is to protect data from direct change. This gives you the opportunity to be confident in the integrity and security of data. Finally, the data layer is designed to store structured information.

Designing such three-tier applications can be quite challenging. Each layer can be created with a huge number of technological solutions and techniques. Each layer may also require different approaches for deployment and management during operation. Finally, each layer must be able to “talk” with each other with regard to security.

In LightSwitch, many of the listed problems have already been solved, offering ready-made mechanisms to the programmer. Well-established technologies serve as the technological basis for this. First of all, it is Microsoft Silverlight 4.0 designed to build the presentation layer. Logical layer is based on WCF RIA DomainServices running ASP.NET 4.0. At the same time, the design of this layer implies the ability to run both in local mode (on the end user's computer) and on the IIS server or even in Windows Azure (WebRole). SQL Server, or SQL Azure is used as a data storage system; in addition, it is also possible to work with the data of Sharepoint 2010 lists.
We connect all together
Carefully “fitted” to each other components of the LightSwitch allow you to focus on the implementation of the business component of the solution, without thinking about the many nuances. At the same time, it is possible not even to resort to Visual Studio, setting up the application and data forms during debugging!

On the basis of data interrelations, as well as parameterization of queries, you can create complete solutions, resorting to programming only in rare cases. But even in such cases, LightSwitch allows you to do a lot, since the programmer is provided with a large number of synchronous (intercepting) and asynchronous (notification) event handlers:

In addition to the obvious things related to the appearance of the application, horizontal components, such as access control, are also implemented. After pre-setting in the properties of the LightSwitch project, it is enough to add a check to the forms screens for users, then in the administration mode, in the user management screen, give them the required rights:

Deployment issues are also solved in the same way using a concise and simple helper that will help you deploy the application locally, on an IIS server, or even in Azure:

Expansion of functionality
LightSwitch allows you to expand its standard functions. The client part runs on Silverlight 4.0, and in fact the client has all the features of Silverlight, including interaction with the Windows operating system. Development of user interface controls is possible. It is expected that soon a lot of extensions will be developed for LightSwitch. A short list of companies that are already engaged in the preparation of add-ons for the LightSwitch can be found on
the Microsoft website . For example, using the extension developed by Infragistics, the LightSwitch application can be equipped with an advanced text editor, maps, diagrams, and even in a couple of clicks, you can change the appearance of the application using themes and LightSwitch shell extensions:

Conclusion
LightSwitch is a very interesting tool designed for a narrow but still popular range of tasks - quickly creating business applications. This tool takes over all the routine business development activities, giving users the opportunity to focus on unique business logic that meets their requirements. Despite its apparent simplicity, LightSwitch allows you to solve many problems using standard configuration tools, and, if necessary, expand functions using programming and additional components.
Learn more about application development with Visual Studio LightSwitch 2011 at
Tech ∙ Ed Russia 2011 , which will be held from November 9 to 10, 2011 in Moscow.
Registration for the first Tech
∙ Ed Russia 2011 conference is already open. Until August 1, the maximum discount for tickets is valid, the number of discount tickets is limited.
We are glad to inform Habra-users about a special special discount for you. When
registering for the conference, enter the promo code
678955662996 and you will get the opportunity to purchase tickets for the conference at a reduced price!