On 8/5/11 13:58 , Niclas Hedhman wrote:
On Fri, Aug 5, 2011 at 12:12 PM, Rickard Öberg<[email protected]>  wrote:

So, does anyone have a case with several EntityStores being involved in one
UoW? If no, can we enforce that only one can be involved.

As you said, I doubt it is supported at the moment...

The reason is that the current commit handling is a bit complicated due to
having to allow several EntityStores to be used. Not a single EntityStore
supports this properly though, AFAIK. I would therefore prefer to make it a
"1 phase commit", which would probably also make it easier to support the
EventStore commit.

I am actually thinking that we should make a much more radical change,
or at least explore it.

IF an entity is redefined to be "A Value currently assigned to an
Identity, which is also a Value", then the GutFeeling(tm) says that
entity management becomes a lot easier, faster and there is a natural
and simple "detach"/"attach" concept.

public interface Entity<T>
{
     Property<Identity>  identity();
     Property<T>  value();
}

provided of course that we have Association support in Values.

What would access code look like? What would the Associations reference? Association<Entity<Person>>?

Values are immutable. What would modification code look like?

With the latest changes Values have support for Associations, and so the EntityToValue converter should be enough for detach/attach, if you want to.

/Rickard



_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to