ADO Entity Framework.ppt
《ADO Entity Framework.ppt》由会员分享,可在线阅读,更多相关《ADO Entity Framework.ppt(114页珍藏版)》请在麦多课文档分享上搜索。
1、ADO.NET Entity Framework, Jos A. BlakeleyPartner ArchitectMicrosoft Corporation, Michael PizzoPrincipal ArchitectMicrosoft Corporation,10-12:00 Section 1: Evolution of ADO.NET 12:00-1:15 1:15-2:30 Section 2: ADO.NET and LINQ 2:30-2:45 2:45-4:00 Section 3: ADO.NET Entity Framework Deep Dive 4:00-4:15
2、 4:15-5:45 Section 4: Building on ADO.NET,ADO.NET A to Z: Agenda,Evolution of Data Access APIs Proprietary APIs Object Databases Standard SQL Data Access APIs ODBC, DAO, RDO Componentized Data Access OLE DB, ADO .NET Data Access ADO.NET ADO.NET 1.0 Building a Data Platform The ADO.NET Entity Framewo
3、rk,Section 1: Evolution of ADO.NET,Application-specific, monolithic data access Files, hierarchical DBMSs CICS, IMS, etc. Relational DBMSs emerged DBMS-specific APIs and protocols OCI, DBLIB, SQL*, TDS, DRDA Embedded SQL 1xN data access problem Each app writes data-source-neutral data access layer,P
4、roprietary APIs 70s & early 80s,ODBC Common C API for accessing SQL Databases Driver Manager loads DBMS-specific drivers Developed with SQL Access Group, ANSI/ISO Adopted as SQL-CLI Addendum to SQL92 DAO “OLE Automation“ interface to Microsoft Access Provided Access, VB developers access to ODBC sou
5、rces RDO DAO-style interfaces directly over ODBC Subsumed by DAO “ODBC Direct“ mode,SQL APIs Late 80s & early 90s,Transparent Language Persistence C+, Lisp, SmallTalk Transaction support - low throughput Very transparent persistence Fast navigational performance Object graph loaded to memory Most na
6、vigation in memory Object faulting based on memory mapped IO and pointer swizzling Limited query support ODMG OQL standard No efficient implementations Limited indexing support Limited customer acceptance,Object Databases Mid 90s,OLE DB COM-Based Data Access API Relational and non-relational sources
7、 Tables, hierarchies, OLAP, documents Factored interfaces Providers: SQL, ISAM, Excel, AS400 FS, Exchange Services: cursor engine, shaping, remoting, resource pooling, transaction enlistment Used by SQL Server internally and externally SQL Engine, Federated Query, Integration Services, ADO “OLE Auto
8、mation“ interface for OLE DB Interface for VB developers Similar programming model to DAO Introduced disconnected RecordSets,Component Data Access Late 90s,Need a managed API for the new .NET Framework Consistency across framework Explicit separation of connected access from disconnected Connected M
9、odel Lower-level, common API for exposing the functionality native to a data store Higher level abstractions, common functionality built on top Dataset as “in-memory data cache“ Database independent Predictable semantics, latency, error handling, Combine data from multiple sources Support for XML,AD
10、O.NET 1.0 Early 00s,Evolution of Data Access APIs ADO.NET 1.0 Architecture Getting Data from a SQL Database Working with Data ADO.NET and XML Building a Data Platform The ADO.NET Entity Framework,Section 1: Evolution of ADO.NET,ADO.NET 1.0 Architecture,OLTP operations, Programmatic Processing, Frame
11、works,Getting Data From a SQL Database ADO.NET Data Provider,Specific to a particular DBMS Directly exposes consumer interfaces No more COM/Automation dichotomy ADO.NET DataProvider Object Model Connection Establishes connection to DataSource Transaction Explicit Transaction Control Command Execute
12、SQL statement DataReader Forward-only, Read-Only Result Stream Fields accessed through strongly typed, indexed accessors,Relational View of Data Tables, Columns, Rows, Constraints, Relations Directly create metadata and insert data Explicit Disconnected Model Disconnected, remotable object No knowle
13、dge of data source or properties Common Behavior Predictable performance characteristics Array-like indexing Strong Typing,Working with Data DataSet,DataSet Scenarios,Application Data Remoting Results SOAP, WebMethods, Remoting Caching Results ASP.NET Cache Persisting results Save Data as XML, Schem
14、a as XSD User interaction Scrolling, sorting, filtering DataView, DataViewManager Binding Windows controls,DataAdapter,Loads a table from a data store and writes changes back. Exposes two methods: Fill(DataSet,DataTable) Update(DataSet,DataTable) Provides mappings between tables & columns User provi
15、des insert/update/delete commands Allows use of Stored Procedures CommandBuilder component available Allows single DataSet to be populated from multiple different datasources,Data store,DataAdapter,InsertCommand,UpdateCommand,DeleteCommand,SelectCommand,Fill(),Update(),DataSet,ADO.NET and XML,The Da
16、taSet Loads/saves XML data into/out of DataSet Schema can be loaded/saved as XSD Schema can be inferred from XML Data The DataSet can be associated with an XmlDataDocument Exposes a relational view over structured XML According to the DataSet schema Allows strong typing, control binding, relational
17、access of XML data Allows XML tools (schema validation, XSL/T, XPath queries) against relational data Preserves full fidelity of XML Document,ADO.NET 1.0,demo,Evolution of Data Access APIs ADO.NET 1.0 Building a Data Platform Why a Conceptual Model? The Microsoft Entity Data Model Entity SQL The ADO
18、.NET Entity Framework,Section 1: Evolution of ADO.NET,Writing queries is difficult No help from compiler Results are untyped rectangular records Database Schemas optimized for storage concerns Relational Tables contain flat, homogenous records Implicit Logic Embedded in Application Brittle, Hard to
19、maintain Lack of common syntax across relational databases,The Problem Programming Data is Hard,Rapid Development Strongly typed queries Strongly typed results with Business Logic Lower TCO Work with an explicit data model Types, Inheritance, Relationships, Complex Properties, Decouple application f
20、rom storage schema Better Portability Common query language across disparate sources,The Opportunity Increase Developer Productivity,Applications Today Implicitly Contain the Data Model Logic and Model Intertwined Conceptual Mismatch Often encapsulate in a “Data Access Layer“,Wheres Your Data Model?
21、,Applications Today Implicitly Contain the Data Model Logic and Model Intertwined Conceptual Mismatch Often encapsulate in a “Data Access Layer“,Wheres Your Data Model?,The Need Applications work with a well Defined Model Storage Schema Abstraction Declarative mapping between application and storage
22、 models No brittle, hard-coded mapping,An extended relational model with Entity-Relationship Model concepts Entity Types Strong type with Identity Inheritance Scalar/Complex properties EntitySets Hold instances of Entity Types Similar to relational tables Can have multiple Entitysets of the same Ent
23、ityTypes Relationships (“Associations“) Named relationships between Entities 01:*, 01:01, 1:1, 1:M, M:N Navigation may be exposed as NavigationProperties on EntityTypes AssociationSets Contains instances of associations May be queried directly EntityContainers Contains EntitySets, AssociationSets,Th
24、e Microsoft Entity Data Model,1,1,N,SQL extended to support the Entity Model SELECT Value Promotes a single column to the record Entity construction Useful in DefiningQueries Type Operations OFTYPE, TREAT, Relationship Navigation Navigate(), . Manipulation of Keys Key(), Ref()/DeRef(), CreateRef, Ro
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ADOENTITYFRAMEWORKPPT
