This is a work in progress.
Domain and Persistence Separation
Our primary motivation for this architecture is separating Domain and Persistence concepts.
- When Domain and Persistence logic are mixed together in ActiveRecord Models, the resulting code is hard to reason about, difficult to test well, and resists change.
- AR Callbacks are a hellish way to manage domain logic
- Managing different validation contexts is not straightforward
- There is no clear Domain API (everything is a Model#save side effect)