Segna il video come già completato  
Se vuoi, sarebbe utile un giudizio su questo video    
In questo video vedremo primo sguardo a LightSwitch di cui Microsoft ha recentemente rilasciato la beta due chiamata KittyHawk più precisamente questa rivista risale a marzo 2011. LightSwitch è uno strumento di sviluppo dedicato ai professionisti non programmatori quindi è rivolto sostanzialmente a tutte le persone che non sono sviluppatori professionisti ma che comunque hanno la necessità di sviluppare un'applicazione completa tutti gli effetti. Ad esempio automatizzare propri processi lavorativi ad esempio prendere dei dati trattati esportarli in un foglio di lavoro Excel o comunque per facilitare lo svolgimento del proprio lavoro. Per fare un esempio, un utente tipico di LightSwitch potrebbe essere un medico che si trovi a dover mettere insieme i dati dei propri pazienti che magari è suddiviso su più tabelle E, vista la ripetitività dell'operazione di inserimento dati, preferisce costruirsi una piccola applicazione a tutti gli effetti più che invece utilizzare classico foglio di lavoro Excel oppure le maschere di Access. Ad evidenziare maggiormente il fatto che con LightSwitch si possono creare applicazioni anchedi una certa complessità senza però nella necessità di scrivere una singola riga di codice c'è il fatto che LightSwitch non richiede l'installazione di Visual Studio. Visual studio sarà necessario solo se si vorrà estendere alcune funzionalità di LightSwitch, come ad esempio aggiungere nuovi tipi di dati e così via. L'aspetto interessante è che Microsoft attraverso LightSwitch dà la possibilità agli sviluppatori non professionisti di abbandonare totalmente le maschere di Access è quindi usare uno strumento che sarà altrettanto semplice da usare ma sicuramente molto più potente, flessibile e soprattutto limitato. Proprio lo scopo finale dell'utente cioò l'attrazione di un'applicazione orientata ai dati. Infatti quest'ultimo concetto è un concetto molto importante ma sicuramente sarà già stato colto cioè LightSwitch è nato per creare applicazioni che si appoggiano ad una sorgente dati quindi ci serve sostanzialmente a creare applicazioni che si connettono ad una sorgente dati. Se lo scopo è un altro ad esempio sviluppare un client di posta elettronica allora senza dubbio LightSwitch non sarà sicuramente la scelta da fare. Quindi ci si dovrà orientare verso uno strumento di sviluppo professionale. Un altro aspetto da sottolineare è che quando andremo a compilare il nostro progetto creato con LightSwitch, il risultato che otterremo sarà un'applicazione Silverlight 4, e che quindi girerà indistintamente sul desktop o sul Web e nel Cloud. Vediamo brevemente come mai un professionista che abbia voglia e necessità di creare un'applicazione senza dover imparare a programmare dovrebbe passare a LightSwitch invece che continuare ad utilizzare le maschere di Access oppure un foglio di Excel. Il primo concetto fondamentale da ricordare è che LightSwitch ci consente di concentrarsi in maniera totalmente separata sulla fase della definizione della struttura dati su cui lavorare sulla fase della scelta delle maschere in cui saranno presentati dati e alla fine sulla fase opzionale dell'aggiunta della logica quindi dell'aggiunta del codice che estende alcune funzioni dell'applicazione. Vediamo brevemente la prima fase cioè da fase della costruzione della struttura dati della nostra applicazione. Andiamo a creare un nuovo progetto. Possiamo scegliere prima di tutto quale linguaggio di programmazione usare. Se è un'applicazione Visual Basic oppure un'applicazione C#. Proviamo a usare Visual Basic. Questa è la schermate iniziale del progetto. LightSwitch ci consente di agganciarci ad una sorgente dati esistente facendo l'attach ad un database esterno che può essere sia Sql Server che Sql Server Express oppure MySql, oppure creare direttamente le nostre tabelle. In questo secondo caso cioè se vogliamo creare il database direttamente all'interno di LightSwitch, la procedura è parecchio semplificata perché avremo a disposizione un editor molto intuitivo e immediato da utilizzare. Infatti ci consente di definire in maniera molto rapida e 'entità che poi andremo ad utilizzare come dati. Ad esempio possiamo direttamente rinominare la nostra tabella chiamando l'entità Persona. E possiamo anche segnare il nome al plurale quindi Persone, e il nome della tabella prenderà proprio questo nome Persone. La semplificazione di questo editor è data anche dal fatto che LightSwitch introduce i tipi di dati orientati proprio il business. Infatti avremo i tipi di dati classici ad esempio stringhe interi e così via, e in più LightSwitch ha i tipi di dati già nativi come ad esempio il numero di telefono. Per cui possiamo avere un campo telefono di cui il tipo è PhoneNumber oppure indirizzi e-mail di tipo EMail. E ancora possiamo avere una foto di tipo sarà Picture. Possiamo poi effettuare tutte le scelte che potremmo fare in un editor di tabella di Sql Server, quindi definire se il campo è richiesto, definire i vari indici e così via. Possiamo anche creare un'altra tabella ad esempio la tabella dei gruppi. Quindi l'entità si chiamerà Gruppo e il nome della tabella sarà Gruppi. Qui vedremo sempre nome della tabella. Possiamo indicare la denominazione e se questo gruppo è o meno di tipo booleano. Possiamo quindi creare una relazione, che anche in questo caso è aiutata attraverso questo editor. Un editor che ci consente anche di vedere proprio scritte le proprietà della nostra relazione e ci dice che il gruppo può avere più persone che il gruppo non può essere cancellato se esiste almeno un'istanza di Persone e che ad ogni persona deve essere assegnato un gruppo. Possiamo quindi individuare la relazione attraverso questo collegamento tra tabella Persona e la tabella uno la seconda fase quella della scelta di come presentare dati che abbiamo in archivio quindi la scelta delle maschere chiamate in LightSwitch Screens. Abbiamo a disposizione una serie di template tra cui scegliere quindi possiamo per ogni maschera scegliere una disposizione differente tra quelle che qua vediamo. Ad esempio possiamo creare uno Screen di tipo elenco di dettaglio quindi assegnare il nome allo screen, ad esempio elenco, e scegliere la sorgente dati tra le tabelle che abbiamo a disposizione e scegliere la tabella di dettaglio. A questo punto potremmo andare subito ad editare se lo vorremo la disposizione degli elementi ed eventualmente aggiungere dei controlli come pulsanti e così via. Quando tutta questa configurazione sarà posto potremo avviare l'applicazione e vedere quale sarà il risultato finale. A questo punto lo scheletro della nostra applicazione sarà già completo, quindi potremo cominciare ad esempio ad aggiungere un nuovo gruppo ed aggiungere le persone che fanno parte del gruppo. Possiamo aggiungere anche il gruppo Information Technoloy ed aggiungere un utente anche a questo gruppo possiamo inserire un'immagine che andiamo a recuperare la cartella immagini. La stessa cosa possiamo fare anche per il primo utente. Quindi abbiamo questi due utenti qua con l'applicazione in esecuzione possiamo poi modificare la disposizione dei dati al volo premendo questo pulsante di start screen. In questo modo accediamo alle editor dello scrivere che siamo attualmente visualizzando il possiamo quindi modificare alcune impostazioni ad esempio lei a otto modificando la disposizione degli elementi con la possibilità di visualizzare un'anteprima al centro dello schermo come questa qui la terza fase di cui parlavamo e quella opzionale della giunta della logica che completa l'applicazione infatti LightSwitch gira sul Framework che mette procuri possiamo scegliere di personalizzare il comportamento del nostro software andando scrivere per ciascun elemento il codice necessario usando C# o Visual Basic come già accennato all'inizio del video la giunta di codice sarà necessario solo se dovremmo modificare il comportamento di de folto degli elementi della nostra applicazione e quindi si dovremmo aggiungere delle funzionalità che LightSwitch non ha previsto per fare questo basta per ogni elemento che cara suora e cordoli e quindi avere a disposizione classico i de Visual studio per la scrittura del codice che regola gli eventi dei controlli della nostra applicazione.
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.