On Mon, Jul 12, 2010 at 1:08 AM, Stanislav Muhametsin <[email protected]> wrote: > Quoting Niclas Hedhman <[email protected]>: >> Personally i have previously viewed your case as "We need a easy >> mechanism to 'transform' an Entity to a Value.", which in previous >> reviews have shown to be hard to define in precise terms. >> > > Let's try to define it more precise terms then: Have a (transient?) > composite with custom methods, which can access the state of the entity > composite it represents. Whenever the state of entity changes, this > composite will reflect the changes immediately. It should be also possible > for client code to invoke calls, which may change state of entity (in my > case, giving the changeable role happens in few precisely predetermined > places), without worrying about things like unit of work. In other words, > some kind of entity proxy.
No, that doesn't sound like a good idea at all. Implicit Uow handling is outright evil and will cause more problems that it solves, I am sure. What we have been discussing is; Given an Entity instance, and a Value type implementing the same interfaces (which one exactly?) there should be a method either in Entity, the ValueBuilder or separate utility class, where I can retrieve a Value instance of such Entity. The problem revolves around "which interfaces" to use for all the internal states, especially how to handle associations. > It is true that my case is in big part about transforming an Entity to a > Value. Yet still, the abilities mentioned in QI-165 would help (at least me) > in many other cases too, where strict separation of roles is required. Yeah, this may be something rather useful, but I am also worried that we are missing the target without realizing it until too late. Cheers -- Niclas Hedhman, Software Developer http://www.qi4j.org - New Energy for Java I live here; http://tinyurl.com/2qq9er I work here; http://tinyurl.com/2ymelc I relax here; http://tinyurl.com/2cgsug _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

