This is one area where code reuse bites us and I think this is why you see so many systems starting to resemble functional code principles.
There are many code bases where you delegate an action to a module that goes out and modifies state (or doesn't) based on its own rules. Composing these things becomes challenging.
It leads to situations where verbs that sound like they should be side effect free are unknowingly causing an avalanche of updates behind the scenes.
And when two calls can touch the same objects in a different order (eg, when you have many-to-one relationships), then you are up a creek without a paddle.
Comments
This is one area where code reuse bites us and I think this is why you see so many systems starting to resemble functional code principles.
There are many code bases where you delegate an action to a module that goes out and modifies state (or doesn't) based on its own rules. Composing these things becomes challenging.
It leads to situations where verbs that sound like they should be side effect free are unknowingly causing an avalanche of updates behind the scenes.
And when two calls can touch the same objects in a different order (eg, when you have many-to-one relationships), then you are up a creek without a paddle.