Lesson 18: Designing a class model
You now have all the tools: classes, encapsulation, inheritance, composition. The last question isn't "how" but "what": how do you look at a real-world problem and decide which classes to build? Today we learn the working method — and it will serve you in the capstone.
Modeling is like reading a story pen in hand: the nouns are class candidates, the verbs — methods, and the descriptions — attributes.
- class model
- A program's set of classes and the relations between them — who inherits from whom, who contains whom.
- the noun/verb method
- A design technique: nouns in the problem description become classes, verbs become methods.