<<< Specifying the operations | Index | Choosing operations >>> |
Consider how an object of the class is to be constructed, copied (if at all), and destroyed.
Define the minimal set of operations required by the concept the class is representing.
Consider which operations could be added for notational convenience.
Consider which operations are to be virtual, that is, operations for which the class can act as an interface for an implementation supplied by a derived class.
Consider what commonality of naming and functionality can be achieved across all the classes of the component.
All of the above is a a statement of minimalism! Adding operations too early constrain the implementation and the further evolution of the system.
Remember: adding public operations reduces the level of abstraction from a concept to its implementation!
It is much easier to add a function once the need for it has been clearly established rather than to remove it once it has become a liability.
<<< Specifying the operations | Index | Choosing operations >>> |