next up previous
Next: Class in C++ Up: C++ Design Issues Previous: Relationships within a class

Specify Interfaces

Private functions are don't usually need to be considered at the design stage. What implementation issues must be considered in the design stage are best dealt as part of the consideration of dependencies. Even more: there is a strong rule is used by Mr. Stroustrup as a rule of thumb: that unless at least two significantly different implementations of a class are possible, then there is probably something wrong with the class. That it, it is simply an implementation in disguise and not a representations of a proper concept. Motto: Ask, whether the interface to this class sufficiently implementation independent.

Public bases and friends are part of the public interface of a class.

This is the step, where exact types of arguments are considered and specified. The ideal is to have as many interfaces as possible statically typed with application-level types.



Porkoláb Zoltán 2001-09-03