3 ms·
From my reading, DCI doesn't supplant MVC, but is an architecture for organizing code. Object behaviors are mixed in (via mixins, traits, or templates) accordin
by jimfl 17y ago
From my reading, DCI doesn't supplant MVC, but is an architecture for organizing code. Object behaviors are mixed in (via mixins, traits, or templates) according to roles (the common examples are ATM withdrawal and deposit) which are implemented separately.
There would be a couple of benefits of this aside from the advertised ones: Automated tests are associated with the role bahaviors. Instead of testing all of the possible behaviors of an object, tests are targeted at the individual traits. Also, by separating the roles from the data it's easier to mock the data layer.
When code needs to be removed or refactored, it is easy to find the code (and tests!) involved. Adding features becomes less of a refactor, and more just adding traits.