!Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) by Nikos Drakos (firstname.lastname@example.org), CBLU, University of Leeds >
Separate interfaces and implementations.
Next: Minimize the number
Previous: Identify and encapsulate
- One can reuse a component's interface (design) or
implementation (code) or both.
- Reusable component = multiple users = single interface with
multiple implementations. Each interface can have multiple
- Enhances verifiability, locality, prevention of
side-effects, future evolution, subclassibility, and eases
change of components,
- Languages vary widely in support of the principle. E.g., Ada
package specification, C++ abstract classes, and C header
files, as do techniques for exploiting them.
- Use interface specification as a barrier to access the
- Don't let client break the component abstraction defined by the
- When possible, use value arguments and results, not pointers or
references that reveal helpers or other internal features.
- Use authentication measures in cases where you must export
(e.g., friends in C++).
Sat Apr 8 09:58:22 EDT 1995