next up previous contents
Next: Parameter Passing Up: Class Interface Previous: Order by access level   Contents

getState(), setState(), and isProperty()

For a given ``property'' of an object, there should be two access methods. A getProperty method that retrieves the value, and a setProperty method that sets the value. The data member that actually stores this property should be hidden. You should use the methods instead of the data member wherever possible. The getProperty method should be declared const. Get-state methods that return boolean values can be of the form isProperty rather than getProperty.


6#6



Falko Kuester 2001-08-24