It’s impossible to delegate responsibility for implementing a method without a specification.
The specification acts as a contract:
the implementor is responsible for meeting the contract.
a client that uses the method can rely on the contract.
Many of the nastiest bugs in programs arise because of misunderstandings about behavior at interfaces.
Specifications are good for the client of a method because they spare her the task of reading code.
Specifications are good for the implementor of a method because they give her freedom to change the implementation without telling clients.
Until now, we were concerned only with whether a dependence existed. Here, we are investigating the question of what form the dependence should take.
By exposing only the specification of a procedure, its clients are less dependent on it, and therefore less likely to need changing when the procedure changes.
Copyright © 1998-2009 Dilvan Moreira