Daily Archives: April 16, 2008

Ruurd Boeke has succeeded in implementing IPOCO across tiers

While this has been an unfolding process on Ruurd’s blog and on the CodePlex/EFContrib site, today marks an impressive day in the evolution of the PostSharp4EF project that Ruurd Boeke has been working on.

He has used the available interfaces for IPOCO in Entity Framework to create a tool for using Entity Framework in a way that is more affable to Domain Driven developers.

His solution enables client side classes that are not dependant on Entity Framework APIs and supports a fully disconnected tiered application – the thing we have all been struggling to achieve.

Ruurd also solved the XML Serialization problem along the way, though in the meantime, changes to WCF actually solve the problem across the board for all WCF XML Serialization, including Entity Framework objects. So I’m sure that was frustrating for him to have this announced shortly after he completed that arduous step, but think of how much you learned, Ruurd and how much respect you have earned as well! 🙂

Here is short description of the project. You can find much more on the PostSharp4EF project site under the CodePlex/EFContrib home as well as on Ruurd’s blog.

PostSharp4EF: Automatically implement IPoco This project uses PostSharp to post-compile your assemblies. When it encounters a simple attribute, it will implement everything needed to use it in EF: Typelevel attributes, EDMscalar attributes, changetracking and default values. This means there are no runtime performance penalties. See Introducing EF Contrib post for more detailed information about this project. The following supporting projects are included as well and will enable the use of full disconnected n-tier usage of your domain objects:

  • Circular Serializer: enables the serialization of object graphs (including circular references) with knowledge of ‘original values’.
  • Editable Business Objects: does changetracking and provides the serializer with the correct values

Entity Framework is …. complex

On Friday, I did a full day workshop on Entity Framework called Entity Framework 0-60. Well, I translated it into the local measurement and renamed it 0-100 (km).

One of the comments I got back from an attendee was:

“It was a great overview on a really interesting topic. It was a bit more complex than I expected so it was good to get the expert’s view”

“A bit more complex.” This is definitely one of the things that makes EF so difficult to teach or to write about. Even in 6 hours there’s so much that I have to glaze over. I tried not to linger in introductory information which they can get more easily elsewhere and spent more time teaching some of the things that are not so obvious and harder to grasp. The last 45 minutes was free form as I invited them to pick my brain and take advantage of all that I have learned so far. I plan to do that again in upcoming workshops.

I think one of the critical things I shared with them during the day was something that is also common to any LINQ queries, which is that you can very easily and unknowingly make trips to the database when you think you are just looking at only the cached objects. When I first mentioned this, the room went silent and their eyes got very big, so I realized that I better spend a little more time exploring this than I had planned.

I’m doing this workshop again this coming Sunday at DevConnections in Orlando (still seats available!) and I expect the day to transpire very differently than it did in Sweden this past Friday. I even completely reorganized the slides on my way home from Sweden because I learned a lot from the questions and reactions of Friday’s attendees.

Yes, Entity Framework is complex. And, as the day progressed, I surprised myself with how much I have really learned about this technology. And I seem to have a Rolodex in my head with listings of forums threads and blog posts that I frequently referred to which was very handy.