On Sat, Jul 2, 2016 at 11:18 PM, Paul Merlin <[email protected]> wrote:
> On 2016-06-22 14:45 (+0200), Niclas Hedhman wrote: > > > Entity == "Identity with Value property", > > versus DTO == "Value with Identity property" > > It makes sense in the DDD mindset but blurs the very definition of > entities. > > You can persist entities and navigate through their relationships but > you can't do that with Values. > Well, we allow navigation of Values that has Entity references if there is an active/valid UnitOfWork. The underlying driver for me to even visit this basic concept (since Zest 0,1), is that I am looking at direct timeseries support, which is a specialized case of event sourcing, and also touches on Aggregates, something that we never managed to solve although it was discussed at length in 2008. Right now I am leaning towards redefinition of entities to become; Entity = Identity + Value + Invariant Constraints + Metadata Metadata are things like "lastModified", "version", "composite types" and other Pros that I see with this model; a. toValue and toEntity conversion becomes magnitudes faster. b. Aggregate support is stronger c. Historical snapshots becomes trivial to support. The Cons; a. Event Sourcing is not expressed directly in model. b. Timeseries doesn't really fit, since it wants "values within timerange" views. So, I the jury is still out. Niclas -- Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java
