O'Reilly logo

Quality Code: Software Testing Principles, Practices, and Patterns by Stephen Vance

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Adjusting Visibility

The ideals of object-oriented encapsulation generally steer us toward limiting the visibility of methods and attributes to the greatest extent possible and still satisfying the functional needs of the software. In general, this guidance is good. It lets us essentially virtualize our data elements so that all manipulation of those elements meets uniform expectations. Our most public methods represent the intrinsic behaviors that the outside world associates with the object being modeled. All other methods have lesser visibility motivated by their design purpose. Some methods are only visible to other classes—such as derived classes—of the same type. Different languages have additional variations in access levels. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required