SAP:
-
- Packages that are maximally stable should be maximally abstract. Unstable packages should be concrete. The abstractness of a package should be in proportion to its stability. (http://www.objectmentor.com/resources/articles/stability.pdf)
One of the
PrinciplesOfObjectOrientedDesign. Closely related to the
StableDependenciesPrinciple.
Also see
OpenClosedPrinciple. The reliable part is "closed" but subclassing is "open".
I think that maybe the "should be"s in that should be replaced with "will tend to be"s. Abstract base classes and interfaces are the most stable things in the system -- every time one of them changes it forces a bigger change in one or more other classes. --
PhilGoodwin
The
EverythingIsRelative or
AllAbstractionsLie crowd would perhaps avoid any abstraction, at least "global" abstractions. Not enough software engineering books confront dynamic abstractions very well in my opinion, focusing too much on "fitting the formal requirements" and "hiding the implementation". I almost think some of these guys have no experience on the front lines. Perhaps shape and device driver examples should be banned from such books for a decade or two.
CategoryAbstraction CategoryModellingLawsAndPrinciples