Bill Blogs in C#

Bill Wagner discusses C#, LINQ, and other items of interest

This is all Seth Godin's fault

Or, what I think about the Alt.Net Vote of No Confidence on the Entity Framework.

 

Almost a month ago, some folks post the Entity Framework Vote of No Confidence petition.  I didn't say anything at that time for a few reasons: I was on vacation, something that controversial requires a thoughtful response, and I wanted to wait for the predictable firestorm to die down.

Last week, the Alt.Net podcast featured Ward Bell and Jeremy Miller discussing, among other things, the petition. It's well worth a listen. For one, the length of the show, almost 44 minutes of content, gives enough space for Ward and Jeremy to go into much more detail about each of the points in the petition. Regardless of how you felt when you first saw the petition, you'll find yourself nodding in agreement at many of their points.

That's why I chose this title for this blog post. Seth Godin is great at marketing and getting attention. He preaches (among other things) to make a big splash when you want to make a point: knock your audience far out of their comfort zone immediately; it makes them much more reachable.

That works great for marketing, but it's lousy as a technical argument.

For the record, I agree with every technical point in the Entity Framework petition. It's v1 software, and it shows a long history of the 'everything is a table in a database' design philosophy that plagues almost all data access libraries. From that assumption several decisions are clear:  You won't want to test without attaching to a database. Your data is model a set of tables and relations. All your entities are coming from and stored back into a relational database. What else is there? (If you don't fit that model, EF isn't for you).

This data-centric view is difficult to reconcile with modern agile and object oriented principles. It's no surprise that EF (v1) failed to deliver on the promise of bridging the gap between an arbitrary storage model and a in-memory object model. That to me is the biggest failing with EF, as it exists today. If I start with a business problem, my first reaction isn't "Let's go design the database". It's "Let's build some scenarios." Those scenarios will start to reveal some objects that need both behavior and persistent storage. That persistent storage will be designed, but it will also evolve over several sprints. Some sprints will be about normalizing the data store, if a relational data store is the right answer. Those sprints shouldn't have a huge impact on the other layers. Unfortunately, nothing in the current Entity Framework helps me work that way. They expect, or even demand, that an existing database schema (and probably even sample data) exists. Northwind anyone?  AdventureWorks?

But, a signed petition calling it a 'vote of no confidence' is obviously an attention grabber.  It clearly grabbed attention. We don't yet know if it achieved the desired result. The EF team is clearly going to make some changes, but the open question is whether those changes will be what the signatories want, or a different direction, attempting to prove that the signatories had the wrong idea about what EF should be.

As for me, I'd much prefer that MS spent more time producing a library that enabled developers to write their own IQueryProvider implementations for specific vertical scenarios.  Matt Warren has written quite a few blog posts discussing the design, and some of the implementation for the IQueryProvider used by LINQ to SQL. Read those articles, and you'll get a feel for just how much work this is. You'll also get a good feel for how much of the code is common code to visit nodes and parse expressions. I'd really prefer seeing those common algorithms exposed for the rest of us. That would go a long way toward many different application types: data in the cloud, data in other blogs, data in almost anything but a relational structures in a database.  From that standpoint, Entity Framework is an evolutionary dead end no matter what they add.

LINQ to Live Mesh anyone? Or even more powerful:  LINQ to <your data stored on LiveMesh>...

To close, yes, I've got issues with the Entity Framework design. yes, all the technical arguments in the vote of no confidence are valid. But, that's not they way I want technical debates to proceed. It gives me visions of glib people spouting nonsense to make a point, not technologists discussing the merits of their work. Our work environments would be much better with more of the latter.

Published Monday, July 28, 2008 6:19 PM by wwagner
Filed under: ,

Comments

# re: This is all Seth Godin's fault@ Tuesday, July 29, 2008 12:06 AM

Thanks for the kind words about the podcast. I'm glad it could lead towards some understanding on the subject. That's kinda the point of Alt.NET. :)

# re: This is all Seth Godin's fault@ Monday, August 04, 2008 11:29 AM

LINQ to <My Data>...

"You'll also get a good feel for how much of the code is common code to visit nodes and parse expressions"

Amen to that and IMHO it should have shipped with LINQ, what Matt is doing is great, but it goes to show that L2S EF NH and everyone else has to build the same code over ond over, not productive at all. Even more disturbing is the long list of classes in L2S marked internal.

Thanks for this post.

by Mike D

# User links about "livemesh" on iLinkShare@ Friday, September 12, 2008 3:49 PM

Pingback from  User links about "livemesh" on iLinkShare