charlessolar / Aggregates.NET

.NET event sourced domain driven design model via NServiceBus and GetEventStore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

External state object

charlessolar opened this issue · comments

Entities can really be divided into 2 operations, reading and writing.

Only 1 entity should be opened for writing, whereas many entities can be opened for reading. To more easily define and enforce this best-practice we can support a "State" object which can be read from the store and hydrated but cannot raise new events.

The idea being when an entity is defined the user will define the read and write side separately and entities that depend on information in other entities will receive access to the state of the entity not the entity itself.

I aggree with you, and that approach looks cleaner as you can see here

Yes, something more like this model too