This week on Herding Code, the guys talk with Microsoft MVP, MSDN Magazine columnist and Programming Entity Framework author Julie Lerman about what’s new in Entity Framework 4. 

  • The show begins with Julie providing a broad look at the new features and improvements around the EF designer, the run-time, POCO support and disconnected entities.
  • Julie talks about her world of database-first development and learning about persistence ignorance, repositories and domain driven development.
  • The group talks about the history of Entity Framework and how it is more than a typical ORM.
  • K Scott and Julie dive into the designer support for database-generated entities and starting with a blank slate for POCOs.  Julie notes that one can create the DDL in the Visual Studio designer and then generate the database from what is modeled.
  • The group talks about green field vs legacy database development and Jon comments on migrations and updating models.
  • Scott K asks about hurdles such as generated code being overwritten when using the designer. Julie speaks to updating the model from the database and using views rather than tables to generate the model.  Julie shares complications around foreign keys and RIA services and managing large models in the designer.
  • K Scott brings the talk back to POCOs and Julie discusses code generation templates customization with T4 templates. 
  • Jon mentions the Visual Studio Extension Manager and how adding template items from the online gallery is just so easy.
  • K Scott asks Julie about Code First development with EF 4 CTP4 and compares Code First to  Fluent NHibernate.
  • The conversation jumps between versioning, plain old PHP objects, ALT.NET kerfuffle and the Vote of No Confidence.
  • Julie and K Scott speak to the two types of POCO support, virtual properties, dynamic proxies, lazy loading and select n + 1.
  • Jon asks about EF’s context lifecycle management for ASP.NET and the complexity around disconnected entities.  Julie shares her recommendations on change tracking, entity state properties, self-tracking entities and persisting to the database.
  • Julie talks about her book, Programming Entity Framework, the rewrite for EF 4, her Data Points column in MSDN Magazine and the MSDN Development videos.
  • The show wraps with comments about Domain-Driven Design and the Norwegian Developers Conference talks.
  • Postscript – Jon calls Julie back to talk about the new CTP 4 release.
  • Julie talks about how some of the changes are specific to code-first, and others enhance to the core API in CTP 4 to facilitate use of code-first.
  • Julie describes the DbContext and DbSet, how they relate to ObjectContext and ObjectSet, and how they’re so much simpler to work with.
  • Julie then talks about how the code-first changes make it possible to remove a lot of code because the model is inferred, but you can override things using model builder code or attributes.
  • Jon and Julie talk about the Ugly Buddy class, which allow adding attributes to an EF model.
  • Julie talks about how the conventions have gotten a lot smarter.
  • We talk about Scott Guthrie’s post, and how he’s demonstrating how to take maximum use of the EF / Code First approach.
  • We wrap up by talking about improvements in how updates are handled. There’s support for a few workflows – manually keeping them in sync, having EF drop and create, and have EF drop / create / populate. However, as far as we can tell, this drop doesn’t include a migration system.

Show Links:

Show notes compiled by Ben Griswold. Thanks!

Download / Listen:

Herding Code 88: Julie Lerman on Entity Framework 4

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Bookmark and Share