Re:Better Software Design with Clean Architecture
by UK-AL on Monday July 03, 2017 @07:23AM
(#14687435)
Most CQRS/Event store systems, simply just build up OO style domain objects by applying events to them.
Then apply a command to the domain object, then save the emitted events.
They are still entity centric.
When you want to ask questions about the state of the app, you make queries. These queries could be sql - in which case, your app is directly dependent on the type of storage, and is almost un-abstractable. it could be a custom/bespoke query language (where a set of hardcoded api calls to the Db/datastore counts as an api).
The event source system is responsible only for storing facts. Therefore, the "problem" of where the validation of students against courses doesn't exist, because that relationship is a "fact" in the event store (there must've been a registration happening at some point for this fact to exist). Therefore, a programmer _cannot_ make the mistake of accidentally adding a course to a student who didn't register, unless they maliciously do it.