Home > Articles > Programming > C/C++

C++ Reference Guide

Hosted by

Object-Oriented Programming and Design Principles

Last updated Jan 1, 2003.

Despite a common belief to the contrary, object-oriented programming isn't new. Back in the late 1960s, the Modula programming language already implemented many of the principles of this paradigm. Smalltalk, which appeared in 1972, was the first pure object-oriented language. Unlike other languages, it enforced—rather than enabled—strict object-oriented practices. Although Smalltalk never gained much popularity, it inspired many other programming languages such as Eiffel and Java (but not C++), which adopted its object model. The primary data abstraction mechanism in OO programming languages is a class. A class is a user-defined type that represents an object or a concept—a file, a hardware device, a database record, a document, an airplane, etc. An object is an instance of a class, just like a variable in procedural programming languages is an instance of a type. Before we continue our discussion, let's look at the principles of object-oriented programming and see how they're implemented in C++. The six major criteria are as follows:

  • Abstract datatyping
  • Information hiding
  • Encapsulation
  • Inheritance
  • Polymorphism
  • Dynamic binding