What's new for Data Advances in Data Access for Visual Studio 2008

Post on 13-Mar-2016

31 views 0 download

Tags:

description

What's new for Data Advances in Data Access for Visual Studio 2008. Eric Nelson Developer & Platform Group Microsoft Ltd eric.nelson@microsoft.com http://blogs.msdn.com/ericnel http://twitter.com/ericnel. Not forgetting SQL Server 2008 ( Actually I am but bare with me ...). Relational - PowerPoint PPT Presentation

Transcript of What's new for Data Advances in Data Access for Visual Studio 2008

What's new for DataAdvances in Data Access for Visual Studio 2008Eric NelsonDeveloper & Platform GroupMicrosoft Ltderic.nelson@microsoft.com http://blogs.msdn.com/ericnel http://twitter.com/ericnel

Not forgetting SQL Server 2008(Actually I am but bare with me...)Relational

Improved XMLUDTs

NewFilestreamHierarchy IDDate & TimeSpatial dataSparse columns and wide tablesFiltered indexesChange trackingTable parameters to SP callsResource governorSP control and monitoringDatabase compressionDeclarative management...

SQL Server Integration Services

VSTA replaces VSAADO.NETPerformanceMerge...

Reporting Services“IIS free”TablixNew designer...

BICube designDeisgn alertsPerformance...

.NET 3.5 SP1 gave us...

Data Access over the yearsAccessing data in 2010• O

RM baby!

Object Relational MappingWhat is it?

Technique for working with relational tables as if they were objects in memoryIntention is to hide away the complexity of the underlying tables and give a uniform way of working with data

Why use it?ProductivityRetain database independence

NotesThere are many ORMs for .NET developers already in existence. E.g.

LLBLGen Pro http://www.llblgen.com/Nhibernate http://www.hibernate.org/343.htmlEntitySpaces http://www.entityspaces.net/Portal/Default.aspx

Objects vs Classes vs Entities

Entity Framework

ADO.NET Entity FrameworkWhat is it?

Tools and services to create an Entity Data Model

EDM gives ORM to SQL Server, Oracle, DB2 etcTools and services for consuming an Entity Data Model

Why use it?ProductivityComplex mapping between entities and database tablesWorks great with ADO.NET Data Services

NotesStrategic but just released...

Entity Data ModelApplication model

Mapped to a persistence store

Comprised of three layers:

Conceptual (CSDL)Mapping (MSL)Storage (SSDL)

Database agnosticComprised of:

EntitiesAssociationsFunctions

Conceptual

Mapping

Storage

Entity Data Model

{ Creating the EDM }

demo

Entity Data Model Consumption

Entity ClientEntity SQL

Object ServicesEntity SQLLINQ To Entities

Entity ClientFamiliar ADO.NET object model:

EntityCommandEntityConnectionEntityDataReaderEntityParameterEntityTransaction

Text-based resultsRead-onlyUses Entity SQL

Object ServicesQueries materialized as Objects

ObjectContextObjectQuery<T>

Built on top of Entity ClientTwo query options:

Entity SQLLINQ

Runtime services:Unit of workIdentity trackingEager/explicit loading

Entity Framework – Service Stack

LINQ To Entities

Object Services

Entity SQL

Entity Client

ADO.NET Provider

{ Using LINQ to Entities }

demo

EF Providers in ProgressVendor DB Support

Microsoft SQL ServerOracle Sample, Generic Sample

Devart Oracle, MySQL, PostgressPhoenix SQLiteIBM DB2, Informix Dynamic ServerMySQL AB MySQLNpgsql PostgreSQLOpenLink Many via OpenLink ODBC or

JDBCDataDirect Oracle, Sybase, SQL Server,

DB2Firebird Firebird

LINQ to SQL vs LINQ to Entities 1/2LINQ to SQL LINQ to

EntitiesDatabase Support

SQL Server Many

Object Relational Mapping Capabilities

Simple Complex

Requires Attributed .NET Code

No Yes

Status Released Just Released

Similar – but not quite 2/2LINQ to SQL

var products = from prod in db.Product where prod.Color == "Blue" select prod;

LINQ to Entitiesvar products = from prod in db.Product where prod.Color == "Blue" select prod;

In general – LINQ to Entities does more – but not always!Only migration that will ever happen is LINQ to SQL migration to LINQ to Entities

Data Services

ADO.NET Data ServicesWhat is it?

HTTP access to an object model exposed as RESTful Web ServicesData and/or methodsData returned using ATOM or JSONRead/Write

Why use it?Easy to expose data over the internet accessible by any client

Creating Data Services

Data Access LayerEntity

Framework

Relational

database Other sources

Data Services Runtime

Hosting/HTTP Listener

Custom

Iqueryable/Ienumerable [+ IUpdatable]

HTTP

RESTful Web Services?

ResourcesRes 1Res 2Res 3Res 4

HTTP RequestURL

VERBPayload

HTTP ResponseStatus

GETPOSTPUT

DELETEXML JSON

Payload

XML JSON

Objects? what kind of objects?

Provide a type with public properties which are;

IQueryable<T>, IEnumerable<T>Also get write access if your type implements;

IUpdatableWorks well with generated code from;

ADO.NET Entity Framework (ObjectContext)LINQ to SQL (DataContext*)

{ Data Services }

demo

Conclusion

•Data Access technology remained reasonably static•Procedural, API access•Surfaced the database schema

1990 to 2007 - Tables

•LINQ – excellent addition to the .NET languages•Entity Framework and the EDM – strategic investment•Data Services – as easy as it gets?•Productivity leap

2008 – Objects

Resourceshttp://blogs.msdn.com/ericnel - all the linksGeneral

ADO.NET Team Blog http://blogs.msdn.com/adonetMike in our team http://www.miketaulty.com ( search Entity or LINQ )Data Platform Developer Centre http://msdn.microsoft.com/en-gb/data/default.aspx

ADO.NET Entity FrameworkEF DM http://blogs.msdn.com/dsimmons FAQ http://blogs.msdn.com/dsimmons/pages/entity-framework-faq.aspx Entity Framework Design http://blogs.msdn.com/efdesign/default.aspx

ADO.NET Data ServicesTeam blog http://blogs.msdn.com/astoriateam

© 2008 Microsoft Ltd. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the

date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Appendix

AcronymsEDM = Entity Data ModelEF = ADO.NET Entity FrameworkESQL = Entity SQLLINQ = Language Integrated QueryCSDL = Conceptual Schema Definition LanguageSSDL = Store Schema Definition LanguageMSDL = Mapping Schema Definition LanguageLambda Syntax = customer.Select(...)Comprehension Syntax = from c in customer ...SQL = Structured Query Language

Entity Client

Entity Data Model

SSDL

All in one slide SQL

Oracle

Other

CSDL MSLAD

O.NE

T

Object Service

s

ESQL“select o from

orders”

LINQ to Entities

“from o in orders...”

ADO.NET Data services

Prov

ider

Prov

ider

Prov

ider

SSDLSSDL

HTTP Custom

Interceptors

(Query, Update)

Service Operations (Methods)

Entity Data Model

RESTful?REpresentational State Transfer

Server-side resources identified by a URIAccess is over HTTP, verb tied to action

GET to read the value of a resourcePOST to create a new resourcePUT to update an existing resourceDELETE to delete a resource

Returned data is “plain” – XML or JSONIs this “the death of SOAP”?