Home Segments Index Top Previous Next

253: Mainline

The explicit-representation principle: Whenever there is a natural category that your program needs to work with, there should be a class in your program that corresponds to that category.

In the railroad-car domain, for example, there are natural categories corresponding to the various sorts of railroad cars and containers. Accordingly, the program in Segment 239 has classes corresponding to those cars and containers.