2009/1/12 Niclas Hedhman <[email protected]> > On Mon, Jan 12, 2009 at 8:08 PM, Rickard Öberg <[email protected]> > wrote: > > > From a both practical and principal point of view, if Entity A has a > > Value B with a reference to Entity C, then if A is aggregated then B > > *may or may not* be a valid value, if you take aggregate logic into > > account (i.e. are A and C part of the same Aggregate or not, or is C an > > aggregate root). To have a value be ok or not depening on who is > > referencing it is wrong. For this simple reason I would say that Values > > cannot have references to Entities. > > Ahhh... I now remember the very clever discussion we had a few weeks > ago about Aggregates and how to have Aggregate Support built into Qi4j > Runtime, which invalidate the whole argument I was giving before. > Thanks for the reminder. > > > Now, back to the simple Address case; In a 'simple system', the > Address is a Value and it has values for both City and Country, which > could be returned from some 'repository'-type service. And if such > service is backed by entities, is irrelevant to the Address, as long > as the Entity instances are not returned directly. So, does it make > sense to create a library to support such pattern, incl the > Entity-to-Value conversion??
I'd say yes - if Values can't refer to Entities then some way of quickly converting an Entity to a Value would be very useful - otherwise you could get situations where a developer over-uses Entities, because of the Value->Entity restriction... In reality, that would create an Enumeration system, but flexible > enough to allow for dynamic update of what are relevant values > available. > > Cheers > Niclas > -- Cheers, Stuart
_______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

