Entity Framework Thoughts

I agree that there is quite a bit of work to do yet with the Entity Framework. Earlier today Scott posted his thoughts on the challenges that the Entity Framework faces. He makes some good points which really show how the approach to application development greatly influences which tools and development strategies developers will choose. I agree that applications have a better chance to succeed when they are "business rule" driven.

I prefer to build a data model and a business model together, not one before the other. In its current state the Entity Framework can be generated from an existing data model (or can be created by hand with XML). The data team at Microsoft knows this is a limitation and is working on solutions to make building and tweaking entities, mapping the conceptual model to a logical model, and overall design of the EDM much more fluid. I am very excited about seeing what they produce on this end.

Building off of the example that Scott worked, assume you have an entity that you are working with and realize that you need to add a new property (or field) to it to establish a business rule (or to write a test if you are using TDD).  You want to add the field or property to the entity and keep moving along with your business rule (probably using Resharper or the like to create the field/property combination). The idea is to keep your brain patterns flowing with the business rule and not to step outside of tat to implement a new field/property and populate it. You want to create the additional property, use it in your code, and map it to the models quickly.

With the Entity Framework in its current state you could add a new partial class and add the field and property to it, but then you are deviating from the EDM with a field that you will eventually want to persist in the database anyway. Another option with the Entity Framework is to add the property to the conceptual model and mapping it to a database field (that you must create). This is an option that  makes sense but is the most difficult to implement at this time. I believe this is one area where the Entity Framework has room to grow and the data team can add more value to the development community: Having a way to easily amend business entities, have it flow through the conceptual model ,and map them to a logical model to the database.

There is a lot left to work out and the more people who use the Entity Framework, participate in the forums, test the CTP’s, and provide feedback where they can, the better the end result will be. I believe that the data teams at Microsoft are absolutely committed to this technology and I am personally very excited about the Entity Framework ….. more excited than I have been about a technology in a long, long time.

Tweet Post Share Update RSS

Hi, I'm John Papa. I author this blog, create courses for Pluralsight and am a Google Developer Expert and Microsoft Regional Director. I travel speaking at events and train technology thought leaders

Tags:
All