Stable Interface
What makes a StableInterface?
please add -- PeterSommerlad
-
it is supported by a GreatAbstraction
-
it incorporates DesignForSlippage
-
it is easy to use
-
it avoids too strong typing (TypeSafeInterfacesConsideredHarmful)
-
it provides good default behavior, even if it is misused
-
it doesn't leak implementation details, such as data structures
-
it can serve implementations and clients far beyond its initial intention
-
everybody understands it and its limitations
-
it was invented by its users and used by its inventors
-
it is usually a result of rigorous refactoring or designed by very great practical thinkers that are thinking practitioners
-
it lacks any really bad features, so no-one feels driven to fix them
-
it lacks any really obvious gaps or missing features, so no-one feels driven to add them
-
it follows the LawOfDemeter
Tongue in cheek answers:
-
It's too hard to change
-
Nobody's using it, so no need to change
-
It is not permitted to change, everyone codes work arounds to use it
What else makes a StableInterface an AbsoluteJoyToUse? -- DavidBennett
-
it can be queried for additional services or extensions. (This PatLet is used in Unix file I/O, X11, OpenGL, COM, CORBA etc.) In PoSaTwo this is called ExtensionInterface (aka ExtensionObject).
-
it can be queried for information about itself (eg COM/TLB, .NET)
Can we make a pattern from this stuff?
I think that a StableInterface is a synergistic result of several patterns --NatPryce.
But is a stable interface always worth the cost?
see LeastFlexibleProtocolWins, ImplementationIndependenceLimits