next up previous contents
Next: Virtual destructor Up: Class Interface Previous: Class Interface   Contents

Data hiding

Class member data variables should be protected via private or protected in a class declaration. Since private access limits a variable's usefulness, you should initially designate all class member variables as protected and only promote those variables that meet the following rule to private:

The use of private results in a well-protected class, though it can limit the derived classes' speed and maximum level of performance. To improve access to private members, use inline methods to access them.



Falko Kuester 2001-08-24