February 2014
Beginner
1248 pages
62h 25m
English
The benefits of data integrity do not follow automatically simply because instance variables are declared private—you must provide validity checking. A class’s set methods could determine that attempts were made to assign invalid data to objects of the class. Typically set methods have void return type and use exception handling to indicate attempts to assign invalid data. We discuss exception handling in detail in Chapter 11.
Software Engineering Observation 8.7
When appropriate, provide public methods to change and retrieve the values of private instance variables. This architecture helps hide the implementation ...
Read now
Unlock full access