Download presentation
Presentation is loading. Please wait.
Published bySylvia Doyle Modified over 9 years ago
1
Data Access Design Patterns: Navigating the Data Access Maze Michael Pizzo Software Architect Microsoft Corporation Michael Pizzo Software Architect Microsoft Corporation Session Code: ARC404
2
Agenda Whidbey Data Access System.Data Namespace Data Access Solutions Sample Application Whidbey Data Access Solutions DataSets and Data Providers ObjectSpaces SQLXML Related Technologies WinFS, MBF, and ObjectSpaces ObjectSpaces and Typed DataSets Summary Whidbey Data Access System.Data Namespace Data Access Solutions Sample Application Whidbey Data Access Solutions DataSets and Data Providers ObjectSpaces SQLXML Related Technologies WinFS, MBF, and ObjectSpaces ObjectSpaces and Typed DataSets Summary
3
Tools Client Application Model AvalonWindows Forms Web & Service Application Model ASP.NET / Indigo Win FS Compact Framework Yukon Mobile PC Optimized System.Help System.Drawing System.NaturalLanguageServices Data Systems Application Model Presentation Data Mobile PC & Devices Application Model Communication Command Line NT Service DataSet Mapping ObjectSpaces ObjectSpace Query Schema Item Relationship Media Audio Video Images System.Messaging System. Discovery System.DirectoryServices System.Remoting System.Runtime.Remoting Active Directory Uddi System.Web.Services Web.Service Description Discovery Protocols System.MessageBus Transport Port Channel Service Queue PubSub Router System.Timers System.Globalization System.Serialization System.Threading System.Text System.Design Base & Application Services Fundamentals System.ComponentModel System.CodeDom System.Reflection System.EnterpriseServices System.Transactions Security System.Windows. TrustManagement System.Web. Security System.Message Bus.Security Authorization AccessControl Credentials Cryptography System.Web.Configuration System.MessageBus.Configuration System.Configuration System.Resources System.Management System.Deployment System.Diagnostics ConfigurationDeployment/Management System.Windows System.Windows.Forms System.Console System.ServiceProcess System.Windows.Forms System.Web System.Storage System.Data.SqlServer Animation Controls Control Design Panel Controls Dialogs SideBar Notification System.Windows Documents Text Element Shapes Shape Ink UI Element Explorer Media System.Windows.Forms Forms Control Print Dialog Design System.Web.UI Page Control HtmlControls MobileControls WebControls Adaptors Design Ports InteropServices System.Runtime System.IO System.Collections Generic System.Search Annotations Monitoring Logging Relevance System.Data SqlClient SqlTypes SqlXML OdbcClient OleDbClient OracleClient Core Contact Location Message Document Event System.Storage System.Web Personalization Caching SessionState System.Xml Schema Serialization Xpath Query Permissions Policy Principal Token System.Security System.Collaboration RealTimeEndpoint TransientDataSession SignalingSession Media Activities HttpWebRequest FtpWebListener SslClientStream WebClient System.Net NetworkInformation Sockets Cache System.Web Administration Management Navigation Peer Group Policy Serialization CompilerServices Recognition System.Speech Synthesis SqlClient ObjectSpaces SqlXML DataSet
4
What’s New In System.Data Enhancements to System.Data Features added to relational APIs ADO.NET with ObjectSpaces Extending the programming model to support objects over SQL Server ADO.NET with SQLXML Extending the programming model to support XML Ability to query and update SQL Server as XML documents via XML Views Enhancements to System.Data Features added to relational APIs ADO.NET with ObjectSpaces Extending the programming model to support objects over SQL Server ADO.NET with SQLXML Extending the programming model to support XML Ability to query and update SQL Server as XML documents via XML Views
5
Selecting a Solution You are part of the answer… …your skills …your background …your familiarity What are you doing with the data? Does it contain business logic? What tools are you using with it? What is the destination of the data? Are you exchanging it with other partners? What type of project are you working on? Self-contained app versus enterprise framework You are part of the answer… …your skills …your background …your familiarity What are you doing with the data? Does it contain business logic? What tools are you using with it? What is the destination of the data? Are you exchanging it with other partners? What type of project are you working on? Self-contained app versus enterprise framework
6
ADO.NET Data Access Support DataSet and DataReader in ADO.NET ObjectSpaces in ADO.NET Technology Strengths Use if… SQLXML in ADO.NET Business level objectsBusiness level objects Relational mapping via metadataRelational mapping via metadata Decoupled from database schemaDecoupled from database schema Smaller working set than other object abstractionsSmaller working set than other object abstractions Interoperability. Format for the Web – B2B, A2AInteroperability. Format for the Web – B2B, A2A Sparse (semi-structured) dataSparse (semi-structured) data XML Services e.g. XQuery, XSDXML Services e.g. XQuery, XSD Relational mapping via metadataRelational mapping via metadata Decoupled from database schemaDecoupled from database schema Relational (tabular) modelRelational (tabular) model Highest performanceHighest performance Explicit controlExplicit control Fully exposes database functionalityFully exposes database functionality You need a strong business object layerYou need a strong business object layer You know the shape of the results you want to work withYou know the shape of the results you want to work with You need to query data from XML data sources e.g. XML Web ServicesYou need to query data from XML data sources e.g. XML Web Services You use vertical industry XML schemas for content publishing e.g. XBRL, RIXML, FinXMLYou use vertical industry XML schemas for content publishing e.g. XBRL, RIXML, FinXML You need to load XML documents into database tablesYou need to load XML documents into database tables You are using UI bound controls for XMLYou are using UI bound controls for XML You are comfortable with the relational modelYou are comfortable with the relational model You require maximum control/performance/functionalityYou require maximum control/performance/functionality You are using UI bound controlsYou are using UI bound controls Data is relational is objects is XML is Data
7
ReferenceNewsTradesPositionsCustomersAccounts News Loader (Windows Service) Stock Information (Web App) Customer Reporting (Web App) Trade Resolution/ History (Windows App) Portfolio Manager (Web App) Sample Application XML HTML XML XML ObjectSpaces DataReader DataSet
8
Agenda Whidbey Data Access System.Data Namespace Data Access Solutions Sample Application Whidbey Data Access Solutions DataSets and Data Providers ObjectSpaces SQLXML Related Technologies WinFS, MBF, and ObjectSpaces ObjectSpaces and Typed DataSets Summary Whidbey Data Access System.Data Namespace Data Access Solutions Sample Application Whidbey Data Access Solutions DataSets and Data Providers ObjectSpaces SQLXML Related Technologies WinFS, MBF, and ObjectSpaces ObjectSpaces and Typed DataSets Summary
9
DataSets And Data Providers Overview Architecture Scenarios Demo Overview Architecture Scenarios Demo
10
DataSets And Data Providers: Overview Goal: Integrate manipulation of relational data with the.NET Framework Accessing a Relational Store (.NET Data Providers) Connecting, Executing Commands, Retrieving Results Common in-memory representation for tabular data (DataSet) Container of tables, columns, relations, constraints May be populated from any store, application, XML Connectionless, provider-independent Explicit Architecture Predictable behavior, semantics Optimized performance Goal: Integrate manipulation of relational data with the.NET Framework Accessing a Relational Store (.NET Data Providers) Connecting, Executing Commands, Retrieving Results Common in-memory representation for tabular data (DataSet) Container of tables, columns, relations, constraints May be populated from any store, application, XML Connectionless, provider-independent Explicit Architecture Predictable behavior, semantics Optimized performance
11
.NET Data Provider DataReader Command Connection DataSet And Data Providers: Architecture DataSet DataAdapter
12
DataSets And Data Providers: Scenarios Work with data as relational tables Retrieve a single value from the database Execute a command and process the results as a stream Bind tabular results to a Windows Client Cache a set of results in memory Remote a collection of records Combine results from multiple stores Bulk load query results into SqlServer Work with data as relational tables Retrieve a single value from the database Execute a command and process the results as a stream Bind tabular results to a Windows Client Cache a set of results in memory Remote a collection of records Combine results from multiple stores Bulk load query results into SqlServer
13
DataSets And Data Providers Carl Perry Program Manager WebData Carl Perry Program Manager WebData
14
Positions Table System.Data Demo Architecture Account Table Customer Information ASP.Net Page Reader (Paging) Command Trade Resolution/History Windows Form App Data Set Connection Customers Table Customer Information Account Number Connection Data Adapter
15
ObjectSpaces Overview Architecture Scenarios Demo Overview Architecture Scenarios Demo
16
ObjectSpaces: Overview Access and manipulate data as domain objects: Customer, Order, Address Not as tables, columns, and rows Any CLR object of your choice can be persisted No need to inherit from our classes Provides a separation between business logic and data access logic We handle the CRUD operations Declarative mapping between objects and relational tables Natural, easy-to-use query language: OPath Single method call to persist a graph Access and manipulate data as domain objects: Customer, Order, Address Not as tables, columns, and rows Any CLR object of your choice can be persisted No need to inherit from our classes Provides a separation between business logic and data access logic We handle the CRUD operations Declarative mapping between objects and relational tables Natural, easy-to-use query language: OPath Single method call to persist a graph
17
ObjectSpaces: Architecture
18
ObjectSpaces: Scenarios Work with a common set of data classes across development organization Query results in terms of data classes Retrieve results as data classes Work with a set of data classes Add new objects Make changes to existing objects Delete Objects Submit changes back to database Work with a common set of data classes across development organization Query results in terms of data classes Retrieve results as data classes Work with a set of data classes Add new objects Make changes to existing objects Delete Objects Submit changes back to database
19
ObjectSpaces Dinesh Kulkarni Program Manager WebData Dinesh Kulkarni Program Manager WebData
20
Trades Table Positions Table System.Data.ObjectSpaces Demo Architecture Accounts Table ObjectReader ObjectSpace Customers Table Customer Information Managed Provider QueryUpdate Trade Business Objects ASP.Net Page
21
SQLXML Overview Architecture Scenarios Demo Overview Architecture Scenarios Demo
22
SQLXML: Overview Growing number of applications unifying under XML based interfaces Loose coupling Coping with decentralized data Managing sparse (semi-structured) data SQLXML supports XML over SQLServer XML programming model for queries and updates XQuery - Full fledged XML query language XML Views Mapping technology to expose logical XML views of SQL Server relational tables XML Views provide XQuery support over SQL Server. Growing number of applications unifying under XML based interfaces Loose coupling Coping with decentralized data Managing sparse (semi-structured) data SQLXML supports XML over SQLServer XML programming model for queries and updates XQuery - Full fledged XML query language XML Views Mapping technology to expose logical XML views of SQL Server relational tables XML Views provide XQuery support over SQL Server.
23
ADO.NET With SQLXML
24
SQLXML: Scenarios Represent data as XML Source and sink for XML Content management systems, B2B scenarios Queries and updates against XML Views Loading large XML data sets Bulk load data into existing relational table structure E.g. Catalog information Transfer data as XML between databases Agree on transfer format Apply mappings at either end Represent data as XML Source and sink for XML Content management systems, B2B scenarios Queries and updates against XML Views Loading large XML data sets Bulk load data into existing relational table structure E.g. Catalog information Transfer data as XML between databases Agree on transfer format Apply mappings at either end
25
SQLXML Alex Laskos Program Manager WebData Alex Laskos Program Manager WebData
26
SQLXML: Demo Architecture Reference Tables News XML Files News Query ASP XQueryProcessor XmlViewSchema Loader Application XmlBulkLoad XmlViewSchema News Table StockSymbol ArticleDate NewsXML
27
Agenda Whidbey Data Access System.Data Namespace Data Access Solutions Sample Application Whidbey Data Access Solutions DataSets and Data Providers ObjectSpaces SQLXML Related Technologies WinFS, MBF, and ObjectSpaces ObjectSpaces and Typed DataSets Summary Whidbey Data Access System.Data Namespace Data Access Solutions Sample Application Whidbey Data Access Solutions DataSets and Data Providers ObjectSpaces SQLXML Related Technologies WinFS, MBF, and ObjectSpaces ObjectSpaces and Typed DataSets Summary
28
Prescriptive Object model / Existing Storage Prescriptive Object Model / Prescriptive Storage Model Plain Old CLR Objects WinFS, MBF, And ObjectSpaces Programming Model Greater Flexibility Greater Functionality ObjectSpaces MBF WinFS
29
ObjectSpaces And Typed DataSets Typed DataSets: Strongly typed Relational objects Code-Gen classes for strongly typed access/navigation ObjectSpaces: Persistence of your objects Mapping and Query Services Typed DataSets: Strongly typed Relational objects Code-Gen classes for strongly typed access/navigation ObjectSpaces: Persistence of your objects Mapping and Query Services Typed DataSetsObjectSpaces Work with relational data in a strongly typed manner General object persistence Types based on relational classesDefine your own business classes Access to underlying datarowsEncapsulates underlying data Populate using SQLQuery in terms of Objects Generated mapping in codeDeclarative mapping in file Individual application classesShared classes across an enterprise Visual Studio designer experienceExplicit object modeling experience
30
Summary It’s all about Data… Understand the strengths of each technology DataSet and Data Providers Relational Model Ultimate Performance, Control ObjectSpaces Object Model Strong Business Objects decoupled from storage SQLXML XML Model Interoperable, self-describing format Pick the technology appropriate to your scenario How results will be used Tools to be applied Your knowledge/comfort level It’s all about Data… Understand the strengths of each technology DataSet and Data Providers Relational Model Ultimate Performance, Control ObjectSpaces Object Model Strong Business Objects decoupled from storage SQLXML XML Model Interoperable, self-describing format Pick the technology appropriate to your scenario How results will be used Tools to be applied Your knowledge/comfort level
31
Related Sessions Wednesday 10:00AM DAT402 Building Database Applications with SQL Server "Yukon": XQuery, XML Datatype 2:00PM ARC380.NET Framework: What's New in System.Xml for "Whidbey“ 5:00PM DAT410.NET Framework: Developing Applications Using the New Object-Relational Technologies in "Whidbey“ Caching Techniques for Scalable Enterprise Applications Wednesday 10:00AM DAT402 Building Database Applications with SQL Server "Yukon": XQuery, XML Datatype 2:00PM ARC380.NET Framework: What's New in System.Xml for "Whidbey“ 5:00PM DAT410.NET Framework: Developing Applications Using the New Object-Relational Technologies in "Whidbey“ Caching Techniques for Scalable Enterprise Applications
32
Other Resources “A First Look at ADO.NET and System.Xml V2” by Addison Wesley
33
Questions?
34
SQL Server Resources Week long SQL Server “Ask the Experts” lounge in: Foyer outside Room 309 Support for SQL Server “Yukon” PDC Preview at SQLJunkies http://www.sqljunkies.com/forums SQL Server “Yukon” FAQ Blog at SQLTeam http://yukonblog.sqlteam.com/ Other Key Resources http://www.microsoft.com/sql/community http://msdn.microsoft.com/sqlserver/ 34 world wide user groups, http://msdn.microsoft.com/usergroups/find.asp Our most active SQL Server newsgroups, Microsoft.public.sqlserver.programming Microsoft.public.sqlserver.server Microsoft.public.sqlserver.dts Microsoft.public.sqlserver.olap Microsoft.public.sqlserver.setup Microsoft.public.sqlserver.replication Microsoft.public.sqlserver.msde Week long SQL Server “Ask the Experts” lounge in: Foyer outside Room 309 Support for SQL Server “Yukon” PDC Preview at SQLJunkies http://www.sqljunkies.com/forums SQL Server “Yukon” FAQ Blog at SQLTeam http://yukonblog.sqlteam.com/ Other Key Resources http://www.microsoft.com/sql/community http://msdn.microsoft.com/sqlserver/ 34 world wide user groups, http://msdn.microsoft.com/usergroups/find.asp Our most active SQL Server newsgroups, Microsoft.public.sqlserver.programming Microsoft.public.sqlserver.server Microsoft.public.sqlserver.dts Microsoft.public.sqlserver.olap Microsoft.public.sqlserver.setup Microsoft.public.sqlserver.replication Microsoft.public.sqlserver.msde
35
© 2003-2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.