Home Segments Top Top Previous Next

321: Mainline

The no-duplication principle: Instance variables and instance methods should be distributed among class definitions to ensure that there is no needless duplication. Otherwise, duplicate copies are bound to become gratuitously different.

For example, in Segment 316, the minutes instance variable and the getMinutes method are declared and defined in the Attraction class, rather than in the Movie and Symphony classes, making that instance variable and that method more generally available.