1 / 30

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

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

Download Presentation

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

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What's new for DataAdvances 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

  2. Not forgetting SQL Server 2008(Actually I am but bare with me...) • Relational • Improved • XML • UDTs • New • Filestream • Hierarchy ID • Date & Time • Spatial data • Sparse columns and wide tables • Filtered indexes • Change tracking • Table parameters to SP calls • Resource governor • SP control and monitoring • Database compression • Declarative management • ... • SQL Server Integration Services • VSTA replaces VSA • ADO.NET • Performance • Merge • ... • Reporting Services • “IIS free” • Tablix • New designer • ... • BI • Cube design • Deisgn alerts • Performance • ...

  3. .NET 3.5 SP1 gave us...

  4. Data Access over the years

  5. Object Relational Mapping • What is it? • Technique for working with relational tables as if they were objects in memory • Intention is to hide away the complexity of the underlying tables and give a uniform way of working with data • Why use it? • Productivity • Retain database independence • Notes • There are many ORMs for .NET developers already in existence. E.g. • LLBLGen Pro http://www.llblgen.com/ • Nhibernatehttp://www.hibernate.org/343.html • EntitySpaceshttp://www.entityspaces.net/Portal/Default.aspx • Objects vs Classes vs Entities

  6. Entity Framework

  7. ADO.NET Entity Framework • What is it? • Tools and services to create an Entity Data Model • EDM gives ORM to SQL Server, Oracle, DB2 etc • Tools and services for consuming an Entity Data Model • Why use it? • Productivity • Complex mapping between entities and database tables • Works great with ADO.NET Data Services • Notes • Strategic but just released...

  8. Entity Data Model Entity Data Model • Application model • Mapped to a persistence store • Comprised of three layers: • Conceptual (CSDL) • Mapping (MSL) • Storage (SSDL) • Database agnostic • Comprised of: • Entities • Associations • Functions Conceptual Mapping Storage

  9. { Creating the EDM } demo

  10. Entity Data Model Consumption • Entity Client • Entity SQL • Object Services • Entity SQL • LINQ To Entities

  11. Entity Client • Familiar ADO.NET object model: • EntityCommand • EntityConnection • EntityDataReader • EntityParameter • EntityTransaction • Text-based results • Read-only • Uses Entity SQL

  12. Object Services • Queries materialized as Objects • ObjectContext • ObjectQuery<T> • Built on top of Entity Client • Two query options: • Entity SQL • LINQ • Runtime services: • Unit of work • Identity tracking • Eager/explicit loading

  13. Entity Framework – Service Stack Entity SQL LINQ To Entities Object Services Entity Client ADO.NET Provider

  14. { Using LINQ to Entities } demo

  15. EF Providers in Progress

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

  17. Similar – but not quite 2/2 • LINQ to SQL • var products = from prod in db.Product • where prod.Color == "Blue" • select prod; • LINQ to Entities • var 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

  18. Data Services

  19. ADO.NET Data Services • What is it? • HTTP access to an object model exposed as RESTful Web Services • Data and/or methods • Data returned using ATOM or JSON • Read/Write • Why use it? • Easy to expose data over the internet accessible by any client

  20. Creating Data Services HTTP Hosting/HTTP Listener Data Services Runtime Iqueryable/Ienumerable [+ IUpdatable] Data Access Layer Entity Framework Custom Relational database Other sources

  21. RESTful Web Services? Resources HTTP Request Res 1 URL GET Res 2 VERB POST Payload PUT Res 3 JSON JSON XML XML DELETE Res 4 HTTP Response Status Payload

  22. 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; • IUpdatable • Works well with generated code from; • ADO.NET Entity Framework (ObjectContext) • LINQ to SQL (DataContext*)

  23. { Data Services } demo

  24. Conclusion

  25. Resources • http://blogs.msdn.com/ericnel - all the links • General • ADO.NET Team Blog http://blogs.msdn.com/adonet • Mike in our teamhttp://www.miketaulty.com ( search Entity or LINQ ) • Data Platform Developer Centre http://msdn.microsoft.com/en-gb/data/default.aspx • ADO.NET Entity Framework • EF 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 Services • Team blog http://blogs.msdn.com/astoriateam

  26. Appendix

  27. Acronyms

  28. All in one slide  SQL ESQL “select o from orders” Entity Client ADO.NET Provider Provider Oracle Object Services LINQ to Entities “from o in orders...” Provider Other Entity Data Model Entity Data Model ADO.NET Data services Interceptors (Query, Update) HTTP Custom SSDL SSDL Service Operations (Methods) CSDL MSL SSDL

  29. RESTful? • REpresentationalState Transfer • Server-side resources identified by a URI • Access is over HTTP, verb tied to action • GET to read the value of a resource • POST to create a new resource • PUT to update an existing resource • DELETE to delete a resource • Returned data is “plain” – XML or JSON • Is this “the death of SOAP”?

More Related