328: Highlights
- Programs should obey the explicit-representation principle, with classes
included to reflect natural categories.
- Programs should obey the no-duplication principle, with instance methods
situated among class definitions to facilitate sharing.
- Programs should obey the look-it-up principle, with class definitions
including instance variables for stable, frequently requested
information.
- Programs should obey the need-to-know principle, with public interfaces
designed to restrict instance-variable and instance-method access, thus
facilitating the improvement and maintenance of nonpublic program
elements.
- If you find yourself using the phrase an X is a Y when
describing the relation between two classes, then the
X
class is a
subclass of the Y
class.
- If you find yourself using X has a Y when describing the
relation between two classes, then instances of the
Y
class appear
as parts of instances of the X
class.