Using the new Data Sources Window in Visual Studio 2005, developers can now drag columns of their typed DataSets or properties of their own business objects directly to their form. Visual Studio 2005 will create, name, and label controls for each bound property. For those that prefer to lay out the forms with the toolbox, developers can use "Connect the Dots DataBinding" to drag and drop from the Data Sources Window onto their existing controls.
Developers want easier ways to create their forms. There are many approaches including UI frameworks that aim to simplify forms creation. Typically each approach makes assumptions about how the UI may be formatted, or they require interfaces or base classes. While these frameworks would allow developers to quickly create forms based on some schema of objects, it can be difficult to customize the layout. Building a great application isn't just about how fast you can complete the application. A great application includes developer productivity and intuitive use by its end users. In order to create great UI, developers need precise layout for each control on the form.
If you change the schema of your business object, typed DataSet or Web service, the Data Sources Window will refresh to show this new schema.
If we look at the goals for enabling RAD form development we find some basic requirements:
- Easily create controls based on some schema
- Precise layout for each control
- Mapping data types to specific controls
- Ability to vary the default control for a particular column/property
- Ability to add custom controls to the list of available controls
- Creating a label for each databound control
- Establish databinding for each control
- Naming each control something more meaningful than TextBox1, Label1, etc.
Enter Visual Studio 2005 and the Data Sources Window
Visual Studio 2005 introduces a new, simple, yet very powerful model for building forms. The Data Sources Window is a new tool window that displays selected objects within your project that you can use to create data bound forms. The Data Sources Window can display several different types of data sources including typed DataSets, user defined objects (business objects), and Web services. Developers may drag items to their form and Visual Studio will create databound controls, labels for the controls, and name the controls based on their bound properties.
"Connect the Dots"
Figure 1: Form1 bound to Customers.
While it's very helpful to create UI from a new tool window, developers like to work in different styles. Some developers prefer working from the Toolbox. In addition to the Drag-Once DataBinding from the Data Sources Window, the Data Sources Window also has a feature the VB team calls "Connect the Dots." To use it, developers lay out their form from the ToolBox and then drag from the Data Sources Window onto existing controls. Rather than create a new control, the Data Sources Window will establish the databinding to the default binding property of the existing control using some new databinding attributes. Since we assume the developer has already designed the user interface, Visual Studio will not create labels or change the name of the controls.
By: Steve Lasker
Steve is a Program Manager on the Visual Basic team at Microsoft. His team is responsible for many of the Data Design-Time features for building client applications including the Data Source Window and the DataSet Designer. Prior to joining Microsoft, Steve was a technical architect and Director of R&D at a large consulting company building Web, client and device applications for corporate customers. Steve has an engineering background in the remote broadcasting and entertainment industries.
Contact Steve via e-mail or send feedback on the VB Team Blog http://blogs.msdn.com/vbteam/
Visual Studio 2005 will offer productivity features that will reduce the tedium of building forms. The Data Sources Window will help you build forms faster.