Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Pablo Castro, Britt Johnston, Michael Pizzo: ADO.NET Entity Framework - One Year Later

Download

Right click “Save as…”

You might recall last year's introduction of the ADO.NET Entity Framework and the Channel 9 discussion of this new managed data framework with Technical Lead Pablo Castro, Product Unit Manager Britt Johnston, and Principal Architect Michael Pizzo.

The ADO.NET team just released Beta 2 of the Entity Framework so I went to have a somewhat quick chat with Pablo, Britt and Michael to learn first hand about what they've been up to for the last year as it relates to the evolution of the Entity Framework. Well, they've come a long way from last year and the Entity Framework is almost done (it's in beta 2, after all) with LINQ support (of course...), Astoria (incredibly cool - it's basically a service layer over the Entity Framework for client programming using script or simply properly contstructed URLs).

So, what's new, exactly? What were some of the challenges in getting to Beta 2? What are the most profound changes to the Entity Framework since last year's conversation? What's the future of the Entity Framework? Are developers jazzed about the Entity Framework?

Tune in. There's some great work going on in Data World these days. Apparently, the coffee in Building 35 contains special innovation enzymes. Smiley

Tags:

Follow the Discussion

  • Christian Liensbergerlittleguru <3 Seattle
    *wondering when we're going to see Alex James in a video about the Entity Framework*
  • samdruksamdruk samdruk
    We do intend to let him find his desk first, of course.
  • I hope those innovation enzymes are anabolic rather than catabolic Wink

    Looking forward to watching this video when I get home - my IT department really whinges when I download these MASSIVE videos during office hours...
  • CharlesCharles Welcome Change

    The enzyme metaphor was perhaps misleading as enzymes can often break things down. In this case, they stimulate the production of innovation.

    C

  • Since you are using Norhtwind I guess the designer doesn’t support schemas in the database as the other visual studio designers and wizards in 2005 and 2008!!!
    Maybe we should ban Northwind and Pubs in demos and use Adventureworks.

  • Christian Liensbergerlittleguru <3 Seattle
    samdruk wrote:
    We do intend to let him find his desk first, of course.


    Yeah! He's very smart. I enjoy chatting with him very much. I wanted to visit him in Aukland but I have no time to fly over Sad Anyway: once he found his desk I would enjoy an interview with him.
  • DonaldBydia Donald
    Where can I get the WebDataService Template that I saw in the video on Channel9?

    Also,  I installed everything into a clean install in a VPC with all hotfixes.  I typed everything like in the demo but I got an error with the following line:
    using (NorthwindEntities db = NorthwindEntities())

    the second NorthwindEntities has error when compiled as:
    'NorthwindModel.NorthwindEntities' is  'type' but is used like a 'variable'.

    Right, that's what we want no?



  • hamper wrote:
    

    Since you are using Norhtwind I guess the designer doesn’t support schemas in the database as the other visual studio designers and wizards in 2005 and 2008!!!
    Maybe we should ban Northwind and Pubs in demos and use Adventureworks.



    We actually now fully support databases that use owning schemas to group tables (we didn't back a year ago when we did the original Channel 9 video that's referenced by this one).

    You can point the EDM designer to AdventureWorks and we'll automatically generate a fully-functional EDM schema and default mapping for it. (to be very specific, we generate 1 warning from the whole process where we let you know that there is a table with a column with more numeric precision than what the CLR can represent with its "decimal" type and thus we skipped it).

    We use Northwind just for demos and just because it's a small schema...it's definitely not our reference test database Smiley
  • Bydia wrote:
    Where can I get the WebDataService Template that I saw in the video on Channel9?


    That template is part of Project Astoria, and we have not released a beta 2-compatible version yet (we will very soon).

    Bydia wrote:
    Also,  I installed everything into a clean install in a VPC with all hotfixes.  I typed everything like in the demo but I got an error with the following line:
    using (NorthwindEntities db = NorthwindEntities())

    the second NorthwindEntities has error when compiled as:
    'NorthwindModel.NorthwindEntities' is  'type' but is used like a 'variable'.

    Right, that's what we want no?


    You are missing a "new" keyword after the "=" symbol, so the compiler is getting confused about the meaning of the statement.
  • First of all, fascinating project.

    I do have a question though.  Currently in VS 2008 Beta 2 there is a new item which is LINQ to SQL which creates a couple files including a mapping to the database which can be queried using LINQ.  You also get a design surface that looks similar to the Entities Design Surface.

    What are the differences between the two (ie, why do they both exist) and why would one use one or the other?

    Cheers,
    Clint

  • This video was oddly sexual...the demos I mean. No offense guys.
  • Upon further inspection I have also noticed a few issues where the Linq to SQL makes more sense.

    For example, adding and deleting data.

    The context.AddObject() and context.DeleteObject() need the entity set name passed as a string which means that the value can't be checked at compile time (actually, I am getting a exception about the Type not existing or something right now.)

    The Linq to SQL has a more natural approach which uses a simple Add and Remove on the (in the L2SQL case) table.

    So the L2SQL looks like

    context.TableName.Add(object); Cool

    whereas the EF looks like

    context.AddObject("EntitySetName", object); Perplexed

    which in my opinion is not very nice.

     

    I am curious why the design decision and would like to know if there are any plans to go to a design that is more like Linq to SQL especially since EF already knows about the mappings?

    Cheers,

    Clint

  • I've been following this project for a while and I'm very excited.  It's almost like the "missing link" to really getting apps up and running more quickly.

    One thing I am concerned about though is the fact that very often Entity Diagrams can get really complicated and crowded.  Most ER Diagramming tools allow you to have multiple pages, or multiple sub-diagrams to help you organize your entity model.  I haven't tried the product yet but I am hoping that the visual tool allows for such a thing - multiple pages /  sub-diagrams.

    fingers crossed.

  • Thanks Pablo,

    Thats good to know and i appreciate that you have fixed that.

    Now if it just could get fixed in the other wizards in VS 2008 and even better vs 2005 Smiley
  • Charles wrote:
    

    The enzyme metaphor was perhaps misleading as enzymes can often break things down. In this case, they stimulate the production of innovation.



    Then I think you meant hormones Wink

  • DiegoV wrote:
    
    Charles wrote:
    

    The enzyme metaphor was perhaps misleading as enzymes can often break things down. In this case, they stimulate the production of innovation.



    Then I think you meant hormones



    I think Catalyst is more appropriate.
  • Christian Liensbergerlittleguru <3 Seattle
    Awesome work, guys! Smiley I like how the stuff works... Very interesting ideas! I hope we get more videos about the Entity Framework.
  • Christian Liensbergerlittleguru <3 Seattle
    clintsinger wrote:
    I do have a question though.  Currently in VS 2008 Beta 2 there is a new item which is LINQ to SQL which creates a couple files including a mapping to the database which can be queried using LINQ.  You also get a design surface that looks similar to the Entities Design Surface.

    What are the differences between the two (ie, why do they both exist) and why would one use one or the other?


    As far as I have understood is the difference that the Entity Framework provides a lot more features/services (look at the web services demo at the end of the video) and uses a middle layer that abstracts the actual database model into a model that you are using in your application. In there you can have entities look as one entity that are two or more in the database or have certain fields always joined into an enitity etc.
  • clintsinger wrote:
    

    First of all, fascinating project.

    I do have a question though.  Currently in VS 2008 Beta 2 there is a new item which is LINQ to SQL which creates a couple files including a mapping to the database which can be queried using LINQ.  You also get a design surface that looks similar to the Entities Design Surface.

    What are the differences between the two (ie, why do they both exist) and why would one use one or the other?



    Excellent question. It seems like MS has been trying to give us an O/R Mapping type product/services since the Object Spaces annoucment. Since then it has been false start after false start. I remember that Italian guy doing a C9 demo on Object Spaces years ago... where did he go?

    Now, it seems like you have two competing technologies that actually might ship. Wink I see alot of overlap between the two and also each has some features the other doesn't have.

    Do these two teams know about each other? Why not merge the projects and come up with a single, consistent set of libraries to solve the problem of moving data from relational to object model.

    Also, is there an Object first design paradim that you can do. I understand why all of these demos reverse engineer a db... but, can I create an object model first and then have in create my schema for me?

    The LINQ to SQL objects also have partial method hooks that allow you to add business rules/validations to them. Is there anything like that in the Entities? Are the entities designed to also be the DTO's or are the entities just a way to tell link how to shape the objects that are returned from queries.

    Confused,

    BOb

  • pilotbob wrote:
    
    clintsinger wrote:
    

    First of all, fascinating project.

    I do have a question though.  Currently in VS 2008 Beta 2 there is a new item which is LINQ to SQL which creates a couple files including a mapping to the database which can be queried using LINQ.  You also get a design surface that looks similar to the Entities Design Surface.

    What are the differences between the two (ie, why do they both exist) and why would one use one or the other?



    Excellent question. It seems like MS has been trying to give us an O/R Mapping type product/services since the Object Spaces annoucment. Since then it has been false start after false start. I remember that Italian guy doing a C9 demo on Object Spaces years ago... where did he go?

    Now, it seems like you have two competing technologies that actually might ship.  I see alot of overlap between the two and also each has some features the other doesn't have.

    Do these two teams know about each other? Why not merge the projects and come up with a single, consistent set of libraries to solve the problem of moving data from relational to object model.

    Also, is there an Object first design paradim that you can do. I understand why all of these demos reverse engineer a db... but, can I create an object model first and then have in create my schema for me?

    The LINQ to SQL objects also have partial method hooks that allow you to add business rules/validations to them. Is there anything like that in the Entities? Are the entities designed to also be the DTO's or are the entities just a way to tell link how to shape the objects that are returned from queries.

    Confused,

    BOb



    I think The main difference between the Entity Framework and Linq To SQL is that EF provides an extra layer of abstraction over your data model, whereas in LINQ to SQL you code more directly against the DB schema.  This allows for a much more robust entity model that is not not as tightly coupled - giving you the freedom to change your actual DB schema without affecting your business logic.  You can redesign your "store" to maximize performance / normalization without breaking code.

    I'm not sure, but i think if you take an inheritance hierarchy from your data model - say Person -> Customer - and see how it is translated by each technology, you will see a difference.  I think the EF would allow you to access all the person properties directly in your customer class (like an inherited class should be) but in Linq to SQL you would access the person interface using Customer.Person...   

    It is my understanding that the "Object Services" feature of EF creates partial classes which allows you to create your own partials to do all of your other work - non persistent properties, methods, authorization, validation, etc.

  • justncase80justncase80 Carpe Noctem
    pilotbob wrote:
    

    Also, is there an Object first design paradim that you can do. I understand why all of these demos reverse engineer a db... but, can I create an object model first and then have in create my schema for me?



    There is an open source project you can check out called NBusiness that focuses on generating business objects that you design. It is primarily concerned with an object first design paradigm. Well actually it's more like an Entity first than object first. You design your entities then it generates the objects and the database / stored procedures.

    Of course you don't have to use the generated sql you can use it with existing databases by creating the necessary stored procedures for working with the existing database. It's also completely template driven and therefor the generated code is completely customizable and integrated into visual studio.
  • MS had a web cast on this... can't remember if it was on EntityFW or on LINQ to SQL... but the [main] differences as it explained them:

    Linq to SQL

    1. Only suports SQL Server

    2. One to one mapping from Table to Object (although the Linq to SQL designer does seem to have inheritence stuff in it... so I'm not sure if this is 100% true.)

    EnityFramework

    1. Provider based data model to support multiple back ends.

    2. An object (entity) can be mapped to multiple tables.

    This tells me I need to be using the EntityFramework. Item 1 doesn't bother me since all of my projects are SQL server. But, I want to do DDD and it doesn't look like Linq to SQL is really designed for that.

    So, I still don't understand why we (Microsoft) have both projects. I think the Linq to SQL should be dropped and all resources should be invested in the EntityFramework. It has better design goals and is a superset of Linq to SQL.

    BOb

     

     

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.