Object-Oriented Design and Programming
Identify both the top-level objects and the GUI interfaces of an electronic product. Describe object-oriented, event-driven programming.
Describe a simple, object-oriented program.
Recognize the difference between object-oriented and structured program design.
1. CheckPoint: Interfaces and Communication Messages
Understanding object-oriented methodologies is often difficult. You already understand that object-oriented analysis and design emulates the way human beings tend to think and conceptualize problems in the everyday world. With a little practice, object-oriented programming will become second nature to you.
As an example, consider a typical house in which there are several bedrooms, a kitchen, and a laundry room—each with a distinct function. You sleep in the bedroom, you wash clothes in the laundry room, and you cook in the kitchen. Each room encapsulates all the items needed to complete the necessary tasks.
You do not have an oven in the laundry room or a washing machine in the kitchen. However, when you do the laundry, you do not just add clothes to the washer and wait in the laundry room; once the machine has started, you may go into the kitchen and start cooking dinner. But how do you know when to go back to check the laundry? When the washer buzzer sounds, a message is sent to alert you to go back into the laundry room to put in a new load. While you are folding clothes in the laundry room, the oven timer may ring to inform you that the meat loaf is done.
What you have is a set of well-defined components: Each provides a single service to communicate with the other components using simple messages when something needs to be done. If you consider a kitchen, you see it is also composed of several, smaller components, including the oven, refrigerator, and microwave. Top-level objects are composed of smaller components that do the actual work....