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#!
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.
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:
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:
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:
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:
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.
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!
发表评论
-
微软打包15M web 开发套件
2010-07-08 13:48 1443如题,目前可下载Beta版,按照微软官方的说法,推出该工具包的 ... -
IIS准备推出Express版本
2010-06-30 13:54 732Microsoft is readying a first p ... -
family.show的界面截屏
2010-05-04 09:30 714以下是一个开源项目,界面操作挺有特点。截图如下: -
vs2010 web express 下载
2010-05-01 04:39 1188WPI(WebPlatformInstaller)安装: h ... -
很“湿”的随机决心选择器
2010-04-18 00:48 698点我 后面抽时间准备来些自动化测试的东东。准备中..。 ... -
asp.net 记略
2010-04-12 23:33 658我认为,web的简洁性决定了其差异性。文章:链接。 M ... -
微软服务战略 Ray ozzie
2010-04-09 16:55 1021There are not many names bigg ...
相关推荐
2. **自动化处理**:在创建新项目时,Lightswitch会自动生成数据库模型、用户界面等基础结构,极大地减少了手动编码的工作量。 3. **多平台支持**:开发的应用程序可以运行在多种平台上,包括Windows桌面、Web浏览器...
Microsoft.LightSwitch.Toolkit,lightswitch官方插件
语言:English 尺寸调查测试仪。 测试工具。 版本4.2:它适用于现场链接。 版本4.1- i。 改变了多问题的颜色匹配。 II。 更新了提交按钮功能。 版本3.4也将具有Z-Server链接的兼容性。 版本3.8- i.Added Goto脚本...
本书主要面向对Microsoft Visual Studio LightSwitch感兴趣的开发者、企业IT专业人员以及希望通过该工具快速构建业务应用的非专业编程人士。无论是初学者还是有一定经验的开发者都能从中获益。 #### 三、主要内容...
尺寸测量测试仪。 测试工具。 支持语言:English
LightSwitch是一款由微软开发的工具,它允许开发者创建桌面和Web应用程序,特别是针对业务应用的快速开发。这个经典例程集合是专为C#程序员设计的,提供了丰富的学习材料和实用示例,帮助用户深入理解如何利用...
《Microsoft Visual Studio LightSwitch Unleashed》是一本深入探讨微软Visual Studio LightSwitch开发工具的专业电子书,由Sams出版社出版。这本书旨在帮助开发者充分利用LightSwitch的功能,构建数据驱动的应用...
Visual Studio LightSwitch是微软推出的一款快速应用开发工具,它旨在帮助开发人员以更高效的方式构建业务应用程序。LightSwitch提供了丰富的功能集合,使得开发者能够轻松创建具有专业外观的Windows桌面及Web应用...
LightSwitch 是微软推出的一款用于简化业务处理(Line of Business,LoB)应用程序开发的工具,尤其适合非专业程序员或业务领域专家使用。它的核心特点在于基于模板的自动化开发,允许开发者通过预设的模板快速构建...
Visual Studio LightSwitch 2015 answers these questions and more as author Tim Leung―winner of a Microsoft 2011 Community Contributor Award for his LightSwitch expertise―covers this breakthrough ...
[Apress] Visual Studio Lightswitch 2012 开发教程 (英文版) [Apress] Visual Studio Lightswitch 2012 (E-Book) ☆ 出版信息:☆ [作者信息] Tim Leung [出版机构] Apress [出版日期] 2013年07月31日 [图书...
Lightswitch是一款由Microsoft推出的轻量级开发工具,主要用于构建数据驱动的业务应用,尤其适合非专业程序员或者业务专家使用。PaulozziCo的这个客户端shell则为Lightswitch提供了定制化的用户体验和增强的功能。 ...