Home » Headline | ASP.NET

Entity Framework 4

9. November 2009 by thebeebs 0 Comments


JLS I’m as excited as an 11-year-old girl at a JLS concert today as I know that soon Entity framework 4 will be a reality and quite frankly the current version of the entity framework saves about as much time as a battery operated travel iron.


Throughout our application we use the IQueryable repository pattern which ensures that our business logic is completely abstracted from our data layer but enables deferred execution, sadly, the entity framework requires us to write a great deal of code to get it to work. EF4 claims to remedy this situation by focusing on Persistence Ignorance which will hopefully mean we can use our standard business classes rather than generating new classes simply to enable database persistence. Who knows maybe mapping Entity Objects to Business Logic Object will become a thing of the past..


When I write code I like to write the model first and then the database. The new ADO.NET Entity Data Model designer now enables you to do this much like Teleriks ORM which is a really great feature, especially if you already have legacy code.


I hear murmurs, but I've not seen any solid code,  that building Tiered applications will be easier which is great because it’s very rare that I'd write anything using the EntitytDatasources that are provided in the majority of Demo projects from Microsoft.


The code that the Entity framework generates is appalling and throws up a ton of StyleCop errors, therefore it’s a relief that they have decided to integrate T4 templates. I’ve never used them but I remember Dan telling me that he’d used them when he was developing a code generation add-in and that they were a delight.


The SQL that the Entity framework generates is often a bit of a mess and with this release comes the promise that it will be easier to read. It doesn't seem that important but when you find yourself spending 15mins cleaning up a trace from SQL profiler, just so you can diagnose a bottleneck, it’s obvious why this will be such a time saver.


My other hope is that the new framework will support more complex Linq scenarios, like supporting more than just primitive types. I guess I’ll get all the answers when I finally download and run through some sample code, I just hope that the reality lives up to the hot air because the Entity Framework could be so good, I dream of the day where I can hit a button and just generate the database from my business objects…imagine the time I'd save, maybe I could take up golf.


Add comment

(Will show your Gravatar icon)  

  Country flag

  • Comment
  • Preview