O'Reilly logo

C++ Gotchas: Avoiding Common Problems in Coding and Design by Stephen C. Dewhurst

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 8. Class Design

The design of effective abstract data types is as much art as science. The production of good interfaces involves equal parts technical knowledge, social psychology, and experience. Yet nothing is more important than clear, intuitive interfaces in assuring that code will be readily understood and correctly maintained.

In this chapter, we'll examine a number of common mistakes in the design of class interfaces and offer suggestions on how to circumvent them. We'll also examine several implementation issues that affect class interfaces.

Gotcha #80: Get/Set Interfaces

In an abstract data type, all member data should be private. However, a class that's just a collection of private data members with public get/set functions ...

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