3 ms·
> I suspect a lot of apps are better done via the Rails approach as it's much simpler, if slower to test. I have been inclined to agree with this, but lately h
by grandalf 11y ago
> I suspect a lot of apps are better done via the Rails approach as it's much simpler, if slower to test.
I have been inclined to agree with this, but lately have begun to wonder. I think the relational model (and document model) lead to the need for lots of manual traversal/management of the graph/hierarchy of a domain model.
And, in an OOP sense, models have behavior (and of course state).
But behavior involves mutating the state of one domain object and others, via their public API (behaviors). Yet most of the so-called behaviors are actually just adding/changing nodes/edges to the graph, which makes the model's main behavior data validation.
So we have this elaborate, tightly-coupled system that pretty much only does data validation, but via the elaborate mechanism of object behavior and internal state.
The typical test suite tests the propagation of this data through the system and verifies that the proper object state has been mutated/persisted, since the proper functioning of the system is easy to doubt.
- eldavido 11y agoEmail me if you want to discuss this further. My email's in my profile. I came from using Rails to doing DDD-style C#/.NET development. It feels very "enterprise" but then, there are some very good lessons I've learned, one being how to write fast code-only unit tests.