Udostępnij za pośrednictwem


Introducing Microsoft® Visual Studio® LightSwitch™

Today during the VSLive! keynote here in Redmond I announced a new product called Microsoft® Visual Studio® LightSwitch™, which is the simplest way to build business applications for the desktop and cloud.  LightSwitch is a new member of the Visual Studio family focused on making it easy to develop line of business applications.

At their core, most end user business applications combine two things:  data + screens.  LightSwitch is optimized around making these two things very simple.  Let’s walk through a simple example which demonstrates how easy it is to get going.

Hello World

LightSwitch is a stand alone Visual Studio product (it will also be available in future versions of Visual Studio Professional and above).  VS Professional gives you a lot of options for building your application, including being able to build top tier enterprise wide apps.  This is very powerful but also presents you with a lot of options to sort out up front as you contemplate your architecture.  With LightSwitch we make it really simple with two choices:  VB or C#!

SNAGHTML27e3cfc

To demonstrate the basic features of LightSwitch, we’ll create a project to track Employees.  Since this kind of application always starts off with some form of data, LightSwitch makes it very easy to get going by giving you two choices right away:

SNAGHTML28d2bed

There is no need to go through a complicated set of database operations to get going, I’ll just select “Create new table”.  As you edit the table you’ll notice another feature, business domain data types:

image

Choosing these data types gives you data integrity checking automatically and other features.  For example if you select a PhoneNumber, LightSwitch will validate the format of the data you enter and also gives you a detailed edit form for each piece.  In this case I’ll fill out a default table with some Employee columns:

image

Creating my main data table was easy.  The next obvious step is to create a couple of screens which will allow me to edit my data.  Doing this is also very easy, simply select the +Screen button on my table:

SNAGHTML29644d9

As it turns out there are a very common set of patterns used for creating screens.  LightSwitch implements the most common screen patterns by default.  In this case I will select the “Search Data Screen” which gives me a data grid view along with Search capability.  Then simply select the Screen Data setting which points to our Employees table:

SNAGHTML2983a3f

In order to add new Employees to the table, we will also create a “New Data Screen”:

SNAGHTML29935dc

That’s it!  Now we just hit F5 to get a fully working application:

SNAGHTML29b9b23

Both new screens are present under the Tasks pane.  If you select CreateNewEmployee you can start adding new entries right away.  Notice that if you hit the down arrow on a PhoneNumber field, the domain type allows you to do detailed editing of the field automatically:

SNAGHTML2a0023f

Another common feature you can wind up spending a lot of time on is data validation.  LightSwitch makes this very easy.  For example if I enter an invalid email address, LightSwitch gives me the validation errors automatically:

SNAGHTML2aa81f9

When I pull up the SearchEmployee you’ll see a fully completed form that supports Search as well as data paging by default:

SNAGHTML2a2df54

Searching works across all the fields in the table making it easy to find what you are looking for.

Immediate Customization

Once the application is up and running we’ll want to make some tweaks to the user interface.  For typical projects this usually involves making changes to a mark up language (such as XAML or HTML), recompiling, then re-running the application.  LightSwitch makes this process simple by providing the “Customize Screen” button when you are running under the debugger.  As you press the customize button, our running screen is pushed into the upper right and we are given both a tree view of the screen elements as well as a Properties window:

SNAGHTML2e71acf

We can now make display changes, such as changing the name of the displayed columns (for example adding spaces between words or changing the column names altogether from the underlying values in the schema):

SNAGHTML2e9e426

The most interesting thing here is the application is still running.  We have not had to stop the application to make these changes, so when we hit the Save toolbar button, the designers fold away and we are now back to the running application with all of the changes already made:

image

This kind of customization really speeds up application development.

Next I can add an EmployeePicture field of type Image.  When I add the new field to the search summary screen, I get a decent layout by default:

SNAGHTML2f512d3

The layout is readable but not the best we could do.  If I switch into Customize mode, we can change the default layout to one of the default line item templates that allows for an image with detailed text:

image

After making some adjustments and saving my changes, I now get a better looking details view:

SNAGHTML2fae4d2

Office Integration

Integration with Office is another very common task in a business application.  LightSwitch makes this task easy as well.  If we look closer at our SearchEmployee screen, it has a built in “Export to Excel” option:

SNAGHTML2b0eece

In addition to exporting from Excel, you will be able to attach to your Access data, automate Word to generate new data bound documents, activate Outlook, and basically any other task you can do with the Office object model.  For example a common task is to create printed invoices using the Word document format.

Other Data, Including SharePoint

Not all of your data is stored in a single database.  Often time you need to combine data from more than one database as well as other data sources.  LightSwitch makes it easy for you to do joins across disparate data sources (internally using WCF RIA Services to serve up the data).  So as an example you can attach to a SharePoint list and create new screens that combine data from a database and SharePoint.  Being able to do this kind of data mash up is very powerful.  Being able to do the join without having to write any code is just awesome :-)

Kick Starting the Cloud

I’m sure you’ve seen that we are “All in” on the Cloud and LightSwitch is no exception.  In fact LightSwitch has been designed to target the cloud using the same set of data and screen designers I’ve shown above.  You can easily create your schema and store data using SQL Azure.  Your running business logic can be hosted in the Azure cloud meaning you never have to do administration work.  The really powerful thing about this is there is nothing special for you to do in order to run in the cloud.  You will simply do the deploy step when you are happy with your app and then point your users at the URL.  The same is true of SQL Azure:  it is just like any other database you can target.

Running in the Browser

By default LightSwitch produces a desktop application.  This kind of app can work very easily with local data and can integrate with Office as mentioned above.  Some times you will also want to give access to the application in the browser.  This is very easy using the Properties settings for the application:

image

Now when I launch the application with F5, it is brought up in my default browser (I run with IE as my default browser, but in this case I’ve shown it in FireFox to demonstrate the flexibility you have):

SNAGHTML31614c7

In this case features like “Export to Excel” are no longer enabled given we are running in a browser sand box.  But nonetheless you can see how easy it is to get going.

Extensibility

We are currently starting work with several of our Visual Studio partners to add new extensions for LightSwitch. In particular you should expect a rich set of controls for various types of data and services (such as package shipping).  At the keynote we also demonstrated a new application skin from Infragistics which has a very modern looking UI and is touch screen enabled.  Here again I don’t have to do anything special while writing the application to take advantage of the new extensibility points, I simply have to select the new skin from a drop down box.

Find Out More

In this post I’ve gone through many of the key features of LightSwitch.  One thing I didn’t show here was writing code (it is a Visual Studio product after all).  Because you are using VS, you have the full power of the framework including features line LINQ behind you.  Our goal with LightSwitch is to remove a lot of the “plumbing” work and instead allow you to concentrate on the core business logic of your application so that the code you write is exactly what you want to write and no more.

LightSwitch will not be for every developer or for every business application you write, especially if you have sophisticated needs.  At the same time LightSwitch applications themselves are robust and are built on top of .NET technologies including Entities and WCF, the same technologies you already choose from when you write your apps today.  Because the apps are built on top of .NET with VS you will be able to open your LightSwitch applications in the full version of Visual Studio and do advanced extensions.  This is very helpful when your application starts to become more popular and usage becomes wide spread and you need to do more than the core LightSwitch product supports.

You can find out more about Visual Studio LightSwitch on its new home page here.  If you are attending VSLive! here in Redmond this week please stop by the Hands on Labs section of the event and you can try out LightSwitch yourself.  Later this month we will also release a formal beta for everyone to download.

As the beta comes out later this month I will post a complete step by step tutorial on creating your first LightSwitch application so you can try it for yourself.  Enjoy!

Comments

  • Anonymous
    August 03, 2010
    Good job guys!  Data+screen is exactly what we're looking for!  We'll check it out

  • Anonymous
    August 03, 2010
    is this an Access GUI for .NET?

  • Anonymous
    August 03, 2010
    This looks like a great new feature to add to the robust toolset offered in the .NET realm and look forward to using it for certain needs in the future.  Nice job MSFT

  • Anonymous
    August 03, 2010
    The comment has been removed

  • Anonymous
    August 03, 2010
    What about maintainability when you update your tables with new columns or update existing column definitions. Will the resulting application adapt to the changes with existing modifications intact or do one need to throw out changed parts and redo them from scratch?

  • Anonymous
    August 03, 2010
    @NeilRobbins, I think you didn't got a point. This is tool. Just tool. You do not have to use it if you do not need one. But imagine if you need need tool for intranet to manage customers. Few tables. Nothing more. You will create fully blown architecture? Will use DDD? Five layer architecture? Few tiers? I do not think so. You will make it as simple as you can. And this tool can actually help make it even more simple. Just use it for what it suited for.

  • Anonymous
    August 03, 2010
    I'll sound off on the "hobbyist vs. Pro" topic:  I can appreciate ease-of-use as much as the next guy, and having a capability like this that's truly customizable seems like a very good thing.  I'd ask two things, though, from a product-positioning standpoint:  First, give us some idea where new stuff like this fits into the VS roadmap, and second, make sure you let us know where the blind alleys are (ie, you can customize this, but you're going to run into a lot of resistance if you try to customize that).   Between these two bits of information, I think we can make a lot better decisions about which technologies to employ on new projects.  I can't wait to take a look at this -- it shows lots of promise.

  • Anonymous
    August 03, 2010
    The comment has been removed

  • Anonymous
    August 03, 2010
    This is going to be very valuable to people like the office Excel guru who are wizards with software tools but whose job description does not formally include development. weblogs.asp.net/.../visual-studio-lightswitch-welcome-advanced-amateurs.aspx

  • Anonymous
    August 03, 2010
    As a full-time professional developer, I have some concerns about this. I worry that a non-technical person (or manager) will create an application in a few seconds or minutes, and then think that software development is easy. Next, they give it to me and say they 'just' want a few 'simple' changes that LightSwitch can't handle. And, since it only took them a few minutes to create the initial application, they will bitterly complain if it takes me several hours or days to add features that are beyond LightSwitch's capability, and they won't understand why it takes so long. It might be better if Microsoft makes it clear what is easy to do with LightSwitch, what is hard, and what is not possible. This way, the expectations of management won't be too unrealistic.

  • Anonymous
    August 03, 2010
    @Silverlight Dev I have been fighting that for 13 years on an existing access application. When a non technical person puts together a screen in 4 hours they wonder why it takes a week to do otherwise. Hopefully this does not create server side cursors like access. At least that will be a step in the right direction. Sadly enough I will most likely use it to convert 50-100 forms over from access just to get it off access and get some source control in place.

  • Anonymous
    August 03, 2010
    Will it support "SQL Server Compact Edition 4" as the db?  (...as per Scott Gu's announcement   weblogs.asp.net/.../new-embedded-database-support-with-asp-net.aspx ) Add that, and I think we got a winner here!

  • Anonymous
    August 03, 2010
    The comment has been removed

  • Anonymous
    August 03, 2010
    The comment has been removed

  • Anonymous
    August 03, 2010
    This is very interesting.  I have been doing .NET for a few years now.  Previously I was a Lotus Notes developer.  I have been very happy to leave Notes, not only because it is dead, but also to stay away from a platform that is associated with hobbyists.  I, too, can very much relate to others who have posted about their frustrations with hobbyists who slap something together and think that they can almost do your job.  I really hope that MS does not market this directly to the Analyst who wishes could be technical so that they can bypass developers in as many cases as they can and get as much recognition as possible.  Don't get me wrong, I know that the tool is not going to replace serious development for now, but, IF(!) it takes off, MS will love to see that cash coming in and will continue to pour money into it and develop it for the Analysts who crave that big pat on the back.  This way, everyone wins in the short term except the Developers.  That is, the real Developers.  Then what happens?  The .NET developers start becoming Java developers and the whole plan backfires.  And all of the Mickey Mouse development will plague the MS enterprise ecosystem. I really hope that does not happen.  I currently love MS and I really hope they don't make such a misstep.  Please respond.

  • Anonymous
    August 03, 2010
    The comment has been removed

  • Anonymous
    August 03, 2010
    If I may I made a blog post on my opinion about this. No need to repeat myself here, so to anyone interested: pontonetpt.com/.../en-visual-studio-2010-lightswitch.aspx

  • Anonymous
    August 03, 2010
    It should be an add on to Visual studio products.( Just for 2 project types why do you need a new visual studio LightSwitch) . Developers are sick of your products now.  Too many products for doing the similar task. Silverlight/WPF support might be a better option along with 3-tier, 2-tier and web based.

  • Anonymous
    August 03, 2010
    Just like WebMatrix , but for the desktop. Can't wait to try it out !!!!

  • Anonymous
    August 03, 2010
    Will you support RTL languages?

  • Anonymous
    August 03, 2010
    I am happy & can't wait till Aug 23 to get a hands on experience of LightSwitch. It'll help ISV & individual developers to build apps for SMBs. Looks like all what you need for a small apps is taken care of. Why to waste developers time in mundane DB connection and all...

  • Anonymous
    August 03, 2010
    The comment has been removed

  • Anonymous
    August 03, 2010
    Looks like a glorified spreadsheet... or access database

  • Anonymous
    August 03, 2010
    Excelllent job guys....!!!

  • Anonymous
    August 03, 2010
    This is very interesting.  I have been doing .NET for a few years now.  Previously I was a Lotus Notes developer.  I have been very happy to leave Notes, not only because it is dead, but also to stay away from a platform that is associated with hobbyists.  I, too, can very much relate to others who have posted about their frustrations with hobbyists who slap something together and think that they can almost do your job.  I really hope that MS does not market this directly to the Analyst who wishes could be technical so that they can bypass developers in as many cases as they can and get as much recognition as possible.  Don't get me wrong, I know that the tool is not going to replace serious development for now, but, IF(!) it takes off, MS will love to see that cash coming in and will continue to pour money into it and develop it for the Analysts who crave that big pat on the back.  This way, everyone wins in the short term except the Developers.  That is, the real Developers.  Then what happens?  The .NET developers start moving to other platforms and the whole plan backfires.  And all of the Mickey Mouse development will plague the MS enterprise ecosystem. I really hope that does not happen.  I currently love MS and I really hope they don't make such a misstep.  Thoughts?

  • Anonymous
    August 03, 2010
    I would like to cast a vote for the "I am so happy Microsoft realizes that there are a lot of people who are unable to use the 'Regular' stuff because it is too complicated". Microsoft must do whatever it takes to make tools that those people can use. Good job. I hope this and WebMatrix takes off. I am a pro develper, MVP, blah blah blah. To maintain my "Edge" I now how to work harder, so what that's life. My apps must be 10 times what you can create with this tool to justify my pay. Thanks fine, I will do that.

  • Anonymous
    August 03, 2010
    Sorry to hear that some see this product as 'cr*p'. If I had my choice between 'non-developers' creating Access app & databases to support them and seeing them move to an environment where they are leveraging SQL Server databases and building their own tools to maintain them I would choose the latter. This tool looks like a good candidate to achieve this goal. And when they come to me asking for just a few little 'tweeks' that are beyond their (and LightSwitch's) capabilities I will do just what I do when they askin for Excel and Access tweeks, tell them IT does not provide support for them and if they have a need for an Enterprise-level application and infrastructure they need to fill out a Project Request to have one built. So if this tool is distributed to the 'unwashed' they have to understand that they have to support it, as far as it will carry them. As a 'simple' tool' it has limitations. Therefore I am not afraid for the future and my job. Many will flock to =LightSwitch in the beginning but they will come back when they thirst for more.

  • Anonymous
    August 04, 2010
    Really who would use this?

  • Anonymous
    August 04, 2010
    This is microsoft's economic stimulus plan.

  1. business user spends money buying LightSwitch
  2. new jobs open up for software developer sto rewrite Access i mean LightSwitch apps. I read somewhere else that the apps are silverlight based, so this might be Microsoft's silverlight distribution plan. Once all the companies i develop for have silverlight, i can start cranking out more silverlight.
  • Anonymous
    August 04, 2010
    The comment has been removed

  • Anonymous
    August 04, 2010
    The comment has been removed

  • Anonymous
    August 04, 2010
    WOW!! This is amazing! finally! we're all eagerly waiting to start experiment it! Is there any official LightSwitch blog or RSS I can subscribe and get notified for news?

  • Anonymous
    August 04, 2010
    Is the Microsoft Access for the web age?

  • Anonymous
    August 04, 2010
    Not a bad idea.  I'm not sure I'd use it for an enterprise app, because I'd want a lot more control over the architecture.  I could see it filling a niche for doing perhaps administration screens.  I would be curious to see articles in the future on how the extensibility works in .NET.  For example, is it generating a DataGrid that I could customize like I do any .NET DataGrid?  The question you ask for any of these RAD tools is what is the granularity of customization I can do in it?

  • Anonymous
    August 04, 2010
    Why just siverlight and not web as well? A tool like this that could create the data entry from for BOTH siverlight and web would be great.  A lot of apps need to be able to be used from a iPhone what will never have siverlight.

  • Anonymous
    August 05, 2010
    The comment has been removed

  • Anonymous
    August 05, 2010
    The comment has been removed

  • Anonymous
    August 05, 2010
    It's an unfortunate idea the MS is still trying to promote this kind of "visual app. builders" which mare very easy to create CRUD applications. Indeed, similar software (Access, 4'th Dimension, Filemaker) has been very successful and to some extent still is, and such products have grown into very complex products. The problem is that people have developed very complex business applications using them, which are now very difficult to maintain and extend, full of hidden bugs, and usually, after 10 - 15 years of changes the product is too expensive to be rewritten. Without a solid architecture to start with, it will be very difficult to evolve such IDE-generated code into a real application when the requirements start to become more complex. Many people have migrated from Access, 4'Th Dim. or other such tools to .NET exactly because of these reasons.

  • Anonymous
    August 05, 2010
    Will it be easy to use Active Directory as a data source?   (To get emails, name, "reports to" etc)

  • Anonymous
    August 05, 2010
    I've tried to watch the videos at www.microsoft.com/.../lightswitch, but after loading it's just goes all white and nothing happens...

  • Anonymous
    August 06, 2010
    The comment has been removed

  • Anonymous
    August 06, 2010
    It looks good.. How is easy is it to add other languages to Visual Studio LightSwitch? -- Stephen.Gennard@MicroFocus.com

  • Anonymous
    August 06, 2010
    The comment has been removed

  • Anonymous
    August 07, 2010
    The comment has been removed

  • Anonymous
    August 08, 2010
    This was very nice idea and it's very useful.

  • Anonymous
    August 09, 2010
    Looks good.. I'll check this lightswitch..

  • Anonymous
    August 10, 2010
    Great idea. I imagine in this version it won't be too powerful, but if you continue regularly adding new features it could be come a fantastic option for quick and simple application development (obviously for relatively simple apps). It would be great to see this included 100% in the "Express" packages.

  • Anonymous
    August 10, 2010
    Has anyone attempted or thought about hooking LightSwitch up to IBM Mainframe DB/2 data on the back end? HIS Team have a new Entity provider for DB/2, so theorectically this should be possible. Mainframe programmers new to .NET would benefit greatly as they often do lots of reptitive development tasks around theri DB/2 data.

  • Anonymous
    August 10, 2010
    The comment has been removed

  • Anonymous
    August 10, 2010
    i think this means i may be able to finally abandon gridview ans sqldatasource for making simple UIs.  maybe even have my own insert now.  good excuse to learn lightswitch.   thanks team lightswitch!

  • Anonymous
    August 12, 2010
    Stop condemning MS Access. A great programmer can write sophisticated application with it: Using MS Access forms as front end and connecting to a SQL Server backend. I have written application before in Java, .NET (C# of course), and I can see where LightSwitch fits in. Recently, I got a contract to convert MS Excel data to application. I have been thinking about using MS Access 2010, to develop application to publish to a SharePoint. Now I see another option. I will definitely give this product a try. Thanks to the "almighty" Microsoft

  • Anonymous
    August 19, 2010
    The comment has been removed

  • Anonymous
    August 20, 2010
    Visual Studio LightSwitch is going to succeed big time. With the world buzzing about cloud computing, and an easy tool that you can use to deploy application into the cloud, Microsoft has hit a home run. If those people responsible for this dev tool have a temple in my neighborhood, I will definitely go there to worship! Thank you! Thank You!! T - H - A - N - K    Y - O - U ! ! !

  • Anonymous
    August 20, 2010
    Light Switch is another great work of Microsoft. Can we create custom screen templates? It looks like totally database oriented work but if we go for desktop solution then those will require some other work like fetching system information (PC name, username) so can we do mixed coding? If possible also add "Source View" images.

  • Anonymous
    August 21, 2010
    Could a lightswitch project be opened by vs2010 pro for further customization?

  • Anonymous
    August 21, 2010
    Could a lightswitch project be opened by vs2010 pro for further customization?

  • Anonymous
    August 21, 2010
    Could a light switch solution be opened using visual studio pro for further customization? Can a light switch solution have many projects? What is the approach for working with light switch in bigger teams? Is light switch a follow up of the unfinished "acropolis" project? What about ms access? Are they out of business now? There is an awful overlap. BTW, really great job! The first case tool that really looks useful. I really enjoyed the keynote.

  • Anonymous
    August 24, 2010
    The comment has been removed

  • Anonymous
    August 25, 2010
    The comment has been removed

  • Anonymous
    August 30, 2010
    LS is amusing thing. I always want to see modern business-oriented IDE with modern language, for example C#, but when I saw LS I was dissapointed - LS is too far from real business automation. it reminds a toy car, which can go, you can manage it, but it is TOY. and I would also like to see an integrated support for making print forms (for documents, reports, etc).

  • Anonymous
    August 31, 2010
    Hello, I love Microsoft Visual Studio LoghtSwitch as it is "easy" to use it... But I am missing the part for the end-users using the Application I developped as they need to install .Net 4.0 , LightSwicth also... I am confused... what are the real pre-requisite for the end-users. If these pre-requisites are mandatory any way to install them on a server and having the application running from the server? bad idea? Thanks, Dom

  • Anonymous
    August 31, 2010
    nice product but will be very useful for non technical persons to develop app in few seconds.