A C++ Class Design Checklist
A C++ Class Design Checklist
Steven J. Zeil
Old Dominion University, Dept. of Computer Science
Copyright © 1999-2006 Steven J. Zeil, Old Dominion University
Table of Contents
1. The Checklist
2. Discussion and Explanation
2.1. Is the interface complete?
2.2. Are there redundant functions or functions that can be generalized?
2.3. Have you used names that are meaningful in the application domain?
2.4. Preconditions and Assertions
2.5. Are the data members private?
2.6. Does every constructor initialize every data member?
2.7. Describe the default constructor…
2.8. Describe the
“
big 3
”
2.9. Does your assignment operator handle self-assignment?
2.10. Does your class provide
“
==
”
and
“
<
”
operators?
2.11. Does your class provide an output routine?
2.12. Is your class const-correct?