A C++ Class Design Checklist

Steven J. Zeil

August 3, 2013

Course Home   e-mail

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 Have you appropriately treated the default constructor?
 2.8 Have you appropriately treated 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?
3 Summary

[Previous]