These postings are provided "AS IS" with no warranties, and confer no rights.
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.
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#!
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:
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:
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:
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:
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:
In order to add new Employees to the table, we will also create a “New Data Screen”:
That’s it! Now we just hit F5 to get a fully working application:
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:
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:
When I pull up the SearchEmployee you’ll see a fully completed form that supports Search as well as data paging by default:
Searching works across all the fields in the table making it easy to find what you are looking for.
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:
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):
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:
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:
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:
After making some adjustments and saving my changes, I now get a better looking details view:
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:
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.
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 :-)
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.
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:
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):
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.
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.
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!
Good job guys! Data+screen is exactly what we're looking for! We'll check it out
is this an Access GUI for .NET?
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
FFS. I keep trying to persuade myself that MS are serious about professional developers, but it's getting hard. From TFS to Microsoft.Data and WebMatrix the crap grows, & now MS add to the problems with this. No wonder MS and its dev community have a poor reputation beyond its own shores. You do a good thing like ASP.NET MVC, Linq, or F# and then let it all down with this. If MS is going to produce this sort of stuff it needs to firmly distance it from the professional developer tools & make clear that it is not fit for professional use. Create a separate hobbyists division, but don't blur the lines like this.
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?
@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.
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.
Dare I stand out and say LightSwitch seems like a useful RAD tool reminiscent a tad of Microsoft Access with wizardry style ability to create data and forms, but with a managed code (.NET Framework) backend... While most of us cringe at the thought of Access and VBA it had/has its place and can be useful. Not by any means that this is Access; it is probably 100x more. But I agree with previous comments. Not every single-form, data entry app request needs to have full blow n-layer, OO architecture, etc., etc. applied. And this coming from soneone that loves to work on the latter. I think LightSwitch will prevail as a good tool for certain types of LOB applications that do not need the advanced architecture and design of other apps, but yet still have the full power of the .NET Framework. Seems like it fills a niche where there is a void. And I applaud MSFT for continuing to come out with new products to keep the .NET front strong.
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
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.
@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.
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!
@Mike, @atconway: thanks! let me know after you try the Beta on 8/23
@decatec: LightSwitch is a Visual Studio product. We still expect people to use Access for building out applications, especially information workers. But we wanted an easier way to produce business applications that directly utilize .NET features.
@NeilRobbins: as @Mike said in a later comment, LightSwitch is not meant to replace Visual Studio Professional or the kinds of apps you can build there. It is good for rapidly producing an application. The app the tool produces does target a 3-tier architecture, it is built directly on .NET features (many you'd be writing yourself anyway), and you can use advanced language features like LINQ in the code you write. As I mentioned in the post it won't be for every developer or every application, but for some apps it's great.
@Albin: Great question. LightSwitch maintains all of the relationship data from your entities and your screens and it fixes them for you. In the post above, I added a new column for employee images. All I had to do to display that was add the new field into the screen field list and hit F5. From that perspective it is actually much easier to use than solutions that require code generation from schema.
@D. Lambert: great point, I will do a follow up post that talks through this in more detail. At a high level LightSwitch really is optimized for the "forms over data" scenario. So if you want to do a lot of custom animation or advanced user interaction, you'd have to do a customized template which is a lot of work (we do expect a set to come in from partners). Most things will fall into that bucket. Beyond that your big escape hatch is going out to code and writing what you want on .NET.
@atconway: your summry is good and matches our intent. LightSwitch is not meant to replace Access (it is still primarily for programmers) and it is also not meant to replace application architectures that are sophisticated in nature (multiple work flows, multiple services you are building, etc). It's sweet spot is targeting business applications which want to mash up a lot of data but still give you the power of .NET.
@kjopc: I've definitely seen some very innovative Excel/Access/etc applications. Anyone who can write those kind of apps I think will find LightSwitch approachable. But also to be clear we do view LightSwitch as a companion to Office, not a replacement. They go great together!
@Silverlight Dev: makes sense. Our goal was to take the very common patterns for these kinds of applications and make it easy to get going. Our hope is that productivity translates for you, the professional developer. We definitely don't expect (desire) to be comprehensive in that approach. We'll do more to outline what is possible vs where you will continue to write your own architecture and implementation.
1000% agree with NeilRobbins
Guys, for how long you'll continue to produce this crap?! For your information, Northwind is NOT real-world database, and a phone list is NOT a real-world business application. You produce Toys-R-us level toys, and try to present it as real things. Fisher-Price computer is not a real computer.
This is in fact quite insulting - how stupid do you think we are?
Note: I'm a professional developer with 20 years of experience, 10 last years in .NET, biz apps and ERP.
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.