1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Designing with objects
This section has largely been paraphrased [Stroustrup, 1997, Chapter 23].

Rules of thumb

* * * *

Don't expect to know everything before you start Get something working as soon as possible Change the design as you go
Try to make your mistakes as early as possible

Design steps

*

* *

* *

* * * *

*

Find the concepts (classes) and their fundamental relationships
Refine the classes by specifying the operations on them Classify these operations. Consider construction, copying, and destruction
Consider minimalism, completeness, and convenience Refine the classes by specifying their dependencies on other classes
Consider inheritance
Use dependencies
Specify the interfaces for the classes
Separate functions into private, public and protected operations
Specify the exact type of the operations on the classes

Discovering classes

22-Mar-98

Page 8

C201/TAM