In this video we will first look at LightSwitch that Microsoft has recently released two beta called Kittyhawk more precisely this magazine back in March 2011. LightSwitch is a development tool dedicated to professional programmers so it does not substantially addressed to all persons who are not professional developers, but who have the need to develop a full-fledged. For example, to automate their business processes such as export them to take the data used in an Excel worksheet or otherwise to facilitate the conduct of their work. For example, a typical user of LightSwitch could be a doctor who is having to put together the data of their patients who may be split across multiple tables and, given the repetitive data entry operation, prefer to build a small application for all purposes rather than using traditional Excel spreadsheet or Access forms. For more highlight the fact that you can build applications with LightSwitch anchedi some complexity without the need to write a single line of code is the fact that LightSwitch does not require the installation of Visual Studio. Visual studio will be required only if you want to extend some functionality LightSwitch, such as adding new data types and so on. The interesting thing is that Microsoft through LightSwitch gives developers the ability to abandon totally non-professional forms in Access and then use a tool that will be just as easy to use but definitely much more powerful, flexible and above all limited. Just the ultimate goal of the user cioò the attraction of an application-oriented data. In fact, this concept is a very important concept, but surely will have been caught that LightSwitch was born to create applications that are supported by a data source so basically we need to create applications that connect to a data source. If the goal is another example develop an e-mail client then no doubt you will definitely not LightSwitch the choice to make. So we must move towards a professional development tool.
Another thing to note is that when we go to complete our project created with LightSwitch, the result will be that we'll get a Silverlight 4, and therefore will run without distinction on the desktop or on the Web and the Cloud.
Let us briefly see how a professional who has desire and need to create an application without having to learn programming should go to LightSwitch rather than continuing to use forms in Access or an Excel spreadsheet.
The first basic concept to remember is that LightSwitch allows us to focus on an entirely separate structure on the phase of definition of data to work on the phase selection of masks in which data will be presented and finally the optional step of adding logic so the addition of some code that extends the application's functions. Let us briefly that the first phase of the construction phase of the data structure of our application. Let's create a new project. We can choose first what programming language to use. If an application is a Visual Basic or C #. We try to use Visual Basic. This is the initial screens of the project. LightSwitch allows us to attach to existing data by the source to attach an external database that can be either SQL Server SQL Server Express or MySQL, or directly create our tables.
In this second case, ie if we want to create the database directly within LightSwitch, the procedure is quite simple because we will have an editor very intuitive and straightforward to use.
In fact allows us to establish very quickly and 'entities that then we're going to use as data. For example, we can directly rename our table by calling the Person entity. And we can also mark the plural name so people, and the name of the table People take this name.
The simplification of this editor is also due to the fact that LightSwitch introduces the types of data-oriented its business. In fact we have the classic types of data such as integers and strings, etc., plus LightSwitch already has native data types such as phone number.
So we can have a field where the type of telephone or e-mail PhoneNumber type EMail. And again we will have a photo of type Picture. We can then make all the choices we make in a SQL Server table editor, then determine if the field is required, define the various indexes and so on.
We can also create another table for example, the group table. So the entity will be called the Group and the table name will be groups. Here we will see more and name of the table. We can show the name and whether or not this group is of type Boolean. We can then create a report, which again is helped by this editor. An editor also allows us to see the properties of our own written report and tells us that the group may have more people that the group can not be deleted if it exists at least one instance of people and that each person must be assigned a group .
We can then browse through this link the relationship between the Person table and the table a second phase of the choice of how to present data we have on file, the choice of masks calls LightSwitch Screens. We have a variety of templates to choose from for each mask so we can choose a different format from what we see here.
For example we can create a list-type of detail screen then assign the name to the screen, for example, list, and choose the source data between the tables that we have available and select the detail table.
At this point we can go now if we want to edit the layout of the elements, and perhaps add controls such as buttons and so on.
When all this place we will start the setup application and see what the final result. At this point, the skeleton of our application is already complete, then we can begin to add such a new group and add people that are part of the group. We can also add the group Information Technoloy and add a user to this group we can also insert an image to go and retrieve the images folder. The same thing we can do for the first user. So we have these two people here with the application running, then we can rearrange the data on the fly by pressing the start button screen.
In this way we access to the editors write that we are currently displaying we can change some settings such as her eight changing the arrangement of the elements with the ability to preview the center of the screen as this one we were talking about the third phase and the optional addition of the complete application logic that runs on it LightSwitch Framework that puts procure we can choose to customize the behavior of our software for each item going to write the necessary code using C # or Visual Basic as already mentioned at the beginning of the video code will need to come only if we change the behavior of the dense elements of our application, and then we add features that LightSwitch has not provided enough to do this for each item that dear sister and curbs and then to have the classic of Visual studio to write the code that governs the events of the controls in our application.