.NET 4.0 and Data Class Interfaces

.NET 4.0 and Data Class Interfaces

Old forum URL: forums.lhotka.net/forums/t/7016.aspx


rcollette posted on Thursday, May 28, 2009

Hi Rocky,

Just wondering if you have had a moment to start a cursory look at the data class interfaces of the entity framework in .NET 4.0 to form an opinion as to whether that would be something to integrate into CSLA.NET.

From reading the feature list of 4.0, it appears that it may be possible to generate custom objects rather than just objects inheriting from EntityObject using the entity modeler.  It would be sweet to get that functionality with CSLA.NET

Thanks,
Rich

RockfordLhotka replied on Thursday, May 28, 2009

I've been monitoring their work, but from a short distance.

As I've said before, the reason the object factory concept was added to the data portal in CSLA 3.6 is in anticipation of EF gaining the ability to directly persist a CSLA object graph.

There's more to it than just creating the correct object instances though. Most objects in 3.6 and higher (in my code at least) use managed backing fields. And many objects have fields that are not exposed directly through public read-write properties. And even if they all were exposed through public read-write properties, using the property interface triggers authorization and business rule processing.

So there's also the need for EF to delegate the get/set operations for field values to CSLA or the business object, so those operations can be done properly within the context of CSLA .NET.

I've talked to the EF team about this, and there's a very real possibility that they'll enable this scenario - maybe in 4.0, maybe later.

My priorities right now though, put .NET 4.0 a bit in the future:

  1. Finish the CSLA .NET for Silverlight videos
  2. Speak at the VS Live LV and Norwegian Developers Conference events
  3. Create CSLA .NET 3.7 to support Silverlight 3
  4. Create CSLA .NET 4.0 to support .NET 4.0

And of course do various work for Magenic, finish a project I'm doing for Microsoft and enjoy my short summer (living in Minnesota, we have to enjoy the nice weather while it is here :) ).

Copyright (c) Marimer LLC