Basic OOP Terms


Before we could understand OOP we had to become familiar with the language. Understanding each of these terms, and particularly what separates theory from practice, was what allowed us to use them in our design.

Method: A function by any other name. A method is code bound to an object. The code provides an interface for messages requesting an operation and a means to perform the requested operation.

Object: A conceptual entity, implemented in software, which has distinct boundaries and contains both data and code. There are two types of code in an object — methods, which transfer data across the object's boundaries, and internal functions, which provide private services to the object.

Class: A class is the template from which an object is derived. It defines what data, functions and methods can be bound to the object. An object is formed by creating an instance of the class and filling in the blanks.

Inheritance: This is the ability to derive a new class from an existing one. The child class can be a sub or super set of the parent. Multiple Inheritance is the ability to derive a new class from more than one parent class.

Polymorphism: Polymorphism is when two objects bind a different method but access it by the same name. The classic example is to create two classes, car and boat. An object from either class can perform an operation "Move" but the method which carries out the operation is different. The use of the same command to generate similar effects using different code is polymorphism.

Information Hiding: Information hiding denies outside entities direct access to the object's private data and functions. Instead it forces outsiders to access the data in a controlled fashion via the object's methods. As with some government agencies, if you don't need to know, your knowing will gum the works.

Messaging: The act of communicating with an object to get something done. It consists of invoking a method, supplying that method with the information it requires, and receiving a reply from the method. Clearly, messaging can be something as simple as a function call.