When designing a class, think about the objects that will be created from it:
- Things the object knows
- Things the object does
For instance:
- Class
ShoppingCart— knowscartContents; doesaddToCart(),removeFromCart(),checkOut(). - Class
Alarm— knowsalarmTime,alarmMode; doessetAlarmTime(),getAlarmTime(),isAlarmSet(),snooze().
Things an object knows about itself are its instance variables (state). Things it can do are its methods (behavior).