VariationBehindInterface

Have a fixed interface that allows access to functionality

Definition

Have a fixed interface that allows access to functionality whose implementation may vary behind the interface.

Source

Variation Behind Interface

Discussion

This is the basis of encapsulation, one of the major advantages delivered by Object-Oriented Programming.  The interface might need to vary, because it is not possible to predict all the changes that might become necessary.  Even if we did predict all possible changes, we are likely to be allowing for things that will never be asked for.  However, the important point is that the interface is much more stable than the functionality behind the interface.  Changes to the functionality may ripple out, but if the interface doesn’t change, then the ripples stop there and go no further.

 

Note that the advantages of this approach can be diluted by failure to get ResponsibilitiesInTheRightPlace.  When each change in requirements causes changes in several parts of the code, then it is likely that this has happened.