Back to VSLive! San Francisco Show Daily Home
Manage ADO.NET Relations & Expressions
Weigh the pros and cons of normalized vs. denormalized data, and data sets vs. typed data sets.
by Donis Marshall
VSLive! San Francisco, February 10, 2005
Note: Steven Borg presented "Managing Relations and Expressions in ADO.NET" at VBITS San Francisco, Wednesday, February 9.
Steven Borg's VBITS session on Wednesday, "Managing Relations and Expressions in ADO.NET," focused on comparisons, such as normalized vs. denormalized data in DataSets. He also covered data sets vs. typed data sets.
Borg gave a comparison of normalized and denormalized data. The benefits of normalized data, he explained, include efficient indexing, reduced database size, good referential integrity, and strong data integrity. Denormalized data's benefits include less reliance on joins, a reduced number of tables, and the need for fewer foreign keys. But denormalized data is more complex and requires additional planning, he said. Overall, Borg recommended normalized data because of its ease of use.
He stressed that developers normally build good, well-normalized data in the data tier but then neglect to use normalized data in the business object and user interface tiers. Developers can extend the benefits of normalization to those tiers, however, by using DataSet objects with relations.
Borg also covered data relations, an important construct in ADO.NET. He defined data relations as the joining of hierarchal data through a foreign key. A data relation facilitates access to child data from the parent row. He illustrated this concept in a demo that included DataRelations, DataSets, and the WinForm DataGrid objects. The WinForm DataGrid allows you to drill down to child rows of a data source, making it a handy feature.
During the demo, Borg announced that the Northwind database is no longer included with Microsoft database products, beginning with Microsoft SQL 2005. Instead, AdventureWorks, another sample database, will be included.
Borg went on to discuss how ADO.NET expressions, though powerful now, will be in enhanced in Whidbey. He spoke to the flexibility of ADO.NET expressions, which he described as "essentially dynamic SQL computed columns."
When accessing tables and table columns, data sets are not type-safe and offer limited IntelliSense. Typed data sets expose tables and table columns as properties. As such, typed data sets are type-safe, available in IntelliSense, and self-documenting. Borg created a typed data set using Visual Studio's RAD tools. He then used the generated code to show the effectiveness of a typed data set, noting that code generated for the typed data sets can be refined to meet a customer's specific needs.
At the end of the session, Borg contrasted WinForm and WebForm data grid controls. The WinForm grid, through its capability to drill down, can deal with relations more effectively than the WebForm DataGrid. However, like the DataGrid for the Web, the WinForm grid can display only one DataTable at a time. His recommendation was to use third-party grid controls, such as the ones from ComponentOne, Infragistics, or 9rays.net.
About the Author
Donis Marshall is a computer technology trainer for developers and scientists and an endorsed trainer for Microsoft Global Learning Services. His most recent book for Microsoft Press, Programming Microsoft® Visual C#® 2005 Core Reference, will be published this fall. Reach him at donis@gotechnical.com.
Back to top
|