Published Nov 17, 2020

Episode 435: Julie Lerman on Object Relational Mappers and Entity Framework

Julie Lerman delves into the intricacies of Object Relational Mappers, with a focus on the Entity Framework's evolution, discussing its transition to EF Core, improvements in data handling, and performance trade-offs, while offering strategies for optimizing applications using ORMs.
Episode Highlights
Software Engineering Radio - the podcast for professional software developers logo

Popular Clips

Episode Highlights

  • Evolution

    Entity Framework has undergone significant transformations since its inception, evolving through multiple versions to enhance functionality and adaptability. explains that the original Entity Framework was rewritten to align with modern software practices, resulting in the creation of EF Core, which offers cross-platform capabilities and a more flexible API 1. This evolution addressed initial criticisms, such as the framework's intrusion into domain classes, by adopting a more respectful approach to domain logic 2.

    They rewrote it from scratch, keeping a lot of the same concepts. So people who were familiar who've been using it framework, they wouldn't be totally thrown for a loop.

    ---

    The transition from EF6 to EF Core marks a shift towards a cleaner architecture, allowing developers to achieve more functionality that was previously unattainable with the older stack 1.

       

    Domain Models

    Handling domain model design has been a challenge for Entity Framework, but recent versions have made significant strides. highlights that EF Core allows developers to encapsulate collections and protect them from misuse, a feature that was previously impossible 3. This advancement enables developers to design their APIs with greater control, ensuring that only intended operations are permitted 4.

    You can write your class the way you want to, and you can use the patterns that we use to encapsulate collections and protect them from abuse, misuse.

    ---

    Additionally, EF Core supports creating databases from domain models, offering flexibility for projects without existing databases 4.

       

    Eager Loading

    Eager loading in Entity Framework has seen notable improvements, particularly with the introduction of EF Core 5. discusses how the new version allows developers to include related data with filters, a capability that was previously cumbersome 5. This enhancement simplifies data retrieval by enabling more precise queries, reducing the need for complex workarounds.

    The include method says, please get me the customers and their orders. And include transforms that into like a join query or something like that.

    ---

    These advancements make it easier for developers to manage data efficiently, leveling the playing field for those less familiar with SQL 5.

Related Episodes