3/24/2017 3:58 PM © 2007 Microsoft Corporation. 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.
{Evolución de la Plataforma de Acceso a Datos} 3/24/2017 3:58 PM {Evolución de la Plataforma de Acceso a Datos} Jose Murillo Responsable Programas Técnicos Partners División de Desarrollo y Plataforma (DPE) Microsoft Spain © 2007 Microsoft Corporation. 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.
Agenda La Plataforma de Acceso a Datos Language INtegrated Query (LINQ) LINQ to Object, DataSets y XML LINQ to SQL ADO .NET Entity Framework Entity Data Model (EDM) LINQ to Entities Modelos de Datos Avanzados Recursos
La Plataforma de Acceso a Datos
La Plataforma de Acceso a Datos
Beneficios de la Plataforma Language Integrated Query Consultas embebidas en lenguaje Sintaxis nativa en C# y VB Soporte a múltiples fuentes de datos Entity Data Model (EDM) Eleva el nivel de abstracción “Artefactos” reutilizables Crea un eco-sistema de servicios Acceso a la Información Compromiso a una amplia plataforma Compromiso continuado a ODBC Soporte para terceros en EF (JDBC, ...)
Como encajan las piezas Sistemas Externos Capa de Datos ADO .NET Data Services (“Astoria”) SQL Server Lógica de Negocio Modelo de Objetos (Datasets/Objetos) Entidades Relaciones ADO.NET 2.0 Data Provider LINQ to Datasets LINQ to SQL Presentación LINQ to Objects ADO .NET 2.0 Data Providers LINQ to Entities Modelo Conceptual (EDM) Entidades Relaciones ADO.NET Entity Framework (entitySQL) Clientes ADO.NET Entity Framework (Entity Data Model) LINQ to Objects Otras BDs
Agenda La Plataforma de Acceso a Datos Language INtegrated Query (LINQ) LINQ to Object, DataSets y XML LINQ to SQL ADO .NET Entity Framework Entity Data Model (EDM) LINQ to Entities Modelos de Datos Avanzados Recursos
Language INtegrated Query Lenguaje de consultas único Datos == Objetos Funciona contra objetos, relacional y XML
Language INtegrated Query C# 3.0 Visual Basic 9.0 Otros .NET Language Integrated Query (LINQ) LINQ to Objects LINQ to DataSets LINQ to SQL LINQ to Entities LINQ to XML In-Memory Objects <XML> </XML> Relacional EDM
{LINQ to Objects LINQ to DataSets LINQ to XML} 3/24/2017 3:58 PM {LINQ to Objects LINQ to DataSets LINQ to XML} demo © 2007 Microsoft Corporation. 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.
LINQ to SQL Lenguaje de Consulta Integrado - RAD Vista de la BD fuertemente tipada Extensibilidad de Código Soporte de herencia Soporta procedimientos almacenados Incluido e integrado con Visual Studio 2008 Limitaciones Solo soporta la familia SQL Server No hay soporte de mapeos complejos (EF)
Arquitectura de LINQ to SQL from c in db.Customers where c.City == "London" select c.CompanyName db.Customers.Add(c1); c2.City = “Seattle"; db.Customers.Remove(c3); Aplicación Enumerate Objetos SubmitChanges() LINQ to SQL Consulta SQL o SProc Filas DML o SProcs SELECT CompanyName FROM Customer WHERE City = 'London' SQL Server INSERT INTO Customer … UPDATE Customer … DELETE FROM Customer …
demo {LINQ to SQL} 3/24/2017 3:58 PM © 2007 Microsoft Corporation. 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.
Agenda La Plataforma de Acceso a Datos Language INtegrated Query (LINQ) LINQ to Object, DataSets y XML LINQ to SQL ADO .NET Entity Framework Entity Data Model (EDM) LINQ to Entities Modelos de Datos Avanzados Recursos
ADO.NET Entity Framework La siguiente capa del stack de ADO.NET Describe tus datos usando un modelo conceptual y ADO.NET hará el resto Herramientas de diseño para el Entity Data Model Mapeo declarativo con la Base de Datos Generación de clases .NET para las entidades de negocio Consulta utilizando LINQ to Entities y Entity SQL Se encarga de las actualizaciones automáticamente con T-SQL o procedimientos Actualmente en Beta3
Impedance Mismatch
Entity Data Model (EDM) Vocabulario para describir el esquema del modelo conceptual “Dibuja la aplicación que quieras ver” Entidades Tipos distintos Propiedades simples o complejas Relaciones Describe las relaciones entre las entidades Declaradas explícitamente: Nombre y cardinalidad
Entity Data Model (EDM) Espacio S Almacén o Storage SSDL (Store Squema Definition Language) Tablas, Vistas, SP… Consulta igual que ADO.NET 2.0 Modelo de Objetos Espacio O Modelo Conceptual Espacio C (CSDL) Almacén de Datos Espacio S (SSDL) Mapeado O-C mediante atributos Mapeado C-S mediante esquema MSL
Entity Data Model (EDM) Espacio C Modelo Conceptual CSDL (Conceptual Schema Definition Language) Entidades, Asociaciones Entity Data Provider EntityConnection EntityCommand EntityDataReader E-SQL Necesitamos conocer: SSDL MSL ( Mapeado entre SSDL y CSDL ) Modelo de Objetos Espacio O Modelo Conceptual Espacio C (CSDL) Almacén de Datos Espacio S (SSDL) Mapeado O-C mediante atributos Mapeado C-S mediante esquema MSL
Entity Data Model (EDM) Espacio O Espacio superior Nivel de objeto en código. Mapeado con CSDL mediante atributos Con E-SQL Para consultar usamos ObjectQuery<T> Con LINQ to Entities Modelo de Objetos Espacio O Modelo Conceptual Espacio C (CSDL) Almacén de Datos Espacio S (SSDL) Mapeado O-C mediante atributos Mapeado C-S mediante esquema MSL
Entity Data Model (EDM) Nivel Se Modela Con Contiene Se Consulta Con Espacio O Código .NET Clases, propiedades … - ObjectQuery<T> con E- SQL - Sentencias LINQ Mapeado 1:1 Mediante atributos Espacio C Conceptual Schema Definition Language Entidades, Asociaciones.. Conjuntos - EntityProvider utilizando E-SQL Mapeado mediante MSL Espacio S Store Schema Tablas, Vistas, procedimientos… - ADO.NET con el proveedor específico
Language INtegrated Query C# 3.0 Visual Basic 9.0 Otros .NET Language Integrated Query (LINQ) LINQ to Objects LINQ to DataSets LINQ to SQL LINQ to Entities LINQ to XML In-Memory Objects <XML> </XML> Relacional EDM
LINQ to Entities La flexibilidad del modelado y mapeo del EF...con la productividad de LINQ Roadmap Framework in Beta 3 Herramientas en CTP V3.0 LINQ .NET Provider (eSQL) Modelo Conceptual Mapeo Almacén .NET Provider V2.0
{Creación y Consultas con un EDM Básico} 3/24/2017 3:58 PM {Creación y Consultas con un EDM Básico} demo © 2007 Microsoft Corporation. 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.
Modelos de Datos Avanzados Tipos complejos Por ejemplo un campo “Dirección” Herencias por Jerarquía Una tabla física para todos los tipos con un campo discriminador Herencias por SubTipo Una tabla física por cada tipo en la jerarquía con relaciones 1:1 en el modelo relacional Herencias por Tipo Múltiples tablas para un mismo tipo Dos tablas para una misma entidad Procedimientos Almacenados
demo {Modelos Avanzados} 3/24/2017 3:58 PM © 2007 Microsoft Corporation. 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.
Ventajas e Inconvenientes Ignorancia de la Persistencia (PI) Complete Persistence Ignorance POCO (Plain Old Code) – Atributos en Clases IPOCO – Implementación de Interfaces Clases Prescriptivas – Herencia de clases base EF – Actualmente IPOCO y Herencia Mayor rendimiento y servicios base Futuro EF – Mayor independencia POCO con metadatos externos Otros proveedores además de SQL Server
Agenda La Plataforma de Acceso a Datos Language INtegrated Query (LINQ) LINQ to Object, DataSets y XML LINQ to SQL ADO .NET Entity Framework Entity Data Model (EDM) LINQ to Entities Modelos de Datos Avanzados Recursos
{Y ya para ir cerrando…} 3/24/2017 3:58 PM {Y ya para ir cerrando…} Recursos © 2007 Microsoft Corporation. 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.
Modelo de Objetos (Datasets/Objetos) Modelo Conceptual (EDM) Resumiendo... Sistemas Externos Capa de Datos ADO .NET Data Services (“Astoria”) SQL Server Lógica de Negocio Modelo de Objetos (Datasets/Objetos) Entidades Relaciones ADO.NET 2.0 Data Provider LINQ to Datasets LINQ to SQL Presentación LINQ to Objects ADO .NET 2.0 Data Providers LINQ to Entities Modelo Conceptual (EDM) Entidades Relaciones ADO.NET Entity Framework (entitySQL) Clientes ADO.NET Entity Framework (Entity Data Model) LINQ to Objects Otras BDs
Enlaces de Interés Data Team site in MSDN http://msdn.microsoft.com/data ADO.NET Team blog http://blogs.msdn.com/adonet CodePlex ADO.NET Samples http://www.codeplex.com/adonetsamples Carl Perry - Senior Program Manager Lead http://blogs.msdn.com/cperry Pablo Castro - Technical Lead http://blogs.msdn.com/pablo Daniel Simmons http://blogs.msdn.com/dsimmons Zlatko Michailov http://blogs.msdn.com/esql
Próximos Libros en Castellano “Entity Framework en profundidad” Editorial Krasis Unai Zorrilla Castro Octavio Hernandez Leal Eduardo Quintás Serantes Sesiones Relacionadas LINQ a Fondo – D136 – 26/Feb – 15h EF a Fondo – D137 – 26/Feb – 15h Acelera el Desarrollo con Frameworks – D235 – 27/Feb – 12h30