180 Chapter 6 Problem Solving and Algorithm Design Object-oriented design focuses on determining the objects within a problem, and abstracting (grouping) the objects into classes based on like properties and behaviors. Classes and objects can relate to each other in three ways: containment, inheritance, and collaboration. Containment is a has a relationship, where a class contains an object of another class. Inheri-tance is an is a relationship, where one class inherits the properties and behaviors of another class. Collaboration is a works with relationship, where one class calls upon another class for information or a service. There are four stages to object-oriented decomposition: • Brainstorming , in which we make a first pass at determining the classes in the problem • Filtering , in which we review the proposed classes •S cenarios , in which the responsibilities of each class are determined • Responsibility algorithms , in which the algorithms are written for each of the responsibilities
This is the end of the preview.
access the rest of the document.