
An approach to
Object-Oriented Design
Identifying the objects and classes
- place the candidate objects into two categories
- objects that are the primary abstractions of
the problem domain
- objects that support the implementation
e.g.: Joe has-a leg but not (Joe is-a
leg)
Defining the interface
- assign the responsibilities
- leads to operations that will be used to manipulate
the objects we've identified
Questions to consider for each operation
- How specific is the operation?
- Is it common to an entire class hierarchy?
- Or is it specific to a subtype?
-
- Is the operation common across several types?
- If so, is it a candidate for a template function?
-
- Is the operation type-dependent?
- What is the visibility of the operation?
- Should it be available to the entire program?
(Þ
public visibility)
- Should it be restricted to the class hierarchy?
(Þ
protected visibility)
Describing the process control
The structure tree