Now back to the inventory system. You were reading about pens and how they had colors and other identifying features. In object talk, these features are called properties . Figure 14.1 shows how the pen class looks at this stage of the discussion. The Pen Class and its properties Now that you have a class, it's time to generalize.
Some people generalize first.
I like to look at the details first and then extract the common information. Of course, usually you'd need several classes before any common features will appear. But because I've already thought this example through, you can cheat a little. Therefore, you can create a more general class than Pen. Figure 14.2 shows this new class.