holisticon/ranked

Spring Configuration and CQRS

zambrovski opened this issue · 1 comments

After a small discussion with @jangalinski we identified the following problem. A system configuration provided by properties file (application.yml) should not change the system behavior. In general this is a problem, because the properties are exactly made for this: change the behaviour of the application. Having no "current" state in the application makes it difficult to handle. Here is an example:

Imagine we configure the property of number of sets to win a set to 6. The matches created with this value are validated against this number and the corresponding events are stored. If this number changes (because we consider the new rules and play till 10), the events created with value 6 become invalid.

To handle this issue, ths configration must be held inside of an aggregate. A config change should be considered as a system command, and the aggregate may reject it, or send the corresponding events to the components.

I started working on this today ...