- Information hiding
- Classes hide implementation details from clients
- Example: stack data structure
- Data elements added (pushed) onto top
- Data elements removed (popped) from top
- Last-in, first-out (LIFO) data structure
- Client only wants LIFO data structure; Does not care how stack implemented
- Data abstraction; Describe functionality of class independent of implementation
- Abstract data types (ADTs)
- Approximations/models of real-world concepts and behaviors; int, float are models for a numbers
- Data representation
- Operations allowed on those data
- ADTs receive as much as attention today as structured programming did over the last two decades. (ADTs do not replace structured programming. rather, they provide an additional formalization that can further improve the program-development process.)
- C++ extensible; Standard data types cannot be changed, but new data types can be created
The job of high-level languages is to create a view convenient for programmers to use. There is no single accepted standard view-that is one reason why there are so many programming languages. Object-oriented programming in C++ presents yet another view.
The primary activity in C++ is creating new types (i.e., classes) and expressing the interactions among objects of those types.
Subsections
2004-07-08