Does hiding mutation remove coordination costs?
An object can conceal its state and still require callers to coordinate operations. Examine what happens when independently safe operations must work together.
Read on through a shared source
Why don’t two locked objects make a safe transaction? →Compare what each lock protects with what the combined operation requires. This is a cost of coordinating shared mutable state, not a claim that every lock is wrong.Small objects or small interfaces? →One talk breaks code into smaller responsibilities. The other limits what callers must learn. Count the decisions exposed to callers as well as the objects inside the implementation.When does a module boundary freeze a decision? →An interface can shelter callers from a changing implementation. Once clients depend on its behavior, changing the interface itself becomes more expensive.
Compare the passages
They hide mutation – they mutate some state inside, right?feels like an immutable
object, except that it has state inside it.