A Quick Look at Object-Oriented Programming



next up previous
Next: Design of the Up: The CWP Object-Oriented Optimization Previous: Optimizing With COOOL

A Quick Look at Object-Oriented Programming

Object-Oriented Programming is a modern approach to the old ideas of code modularity and reusabilty. Many programming languages provide support for OOP features, including C++, Smalltalk, LISP and Pascal. C++, due to the popularity of C, is the most widely used OOP environment so we will focus our short tour on it. COOOLhas been developed using the Free Software Foundation's C/C++ compiler gcc, which is freely available via ftp from prep.ai.mit.edu.

Anything other than a superficial account of OOP is beyond the scope of this paper. For more details see the book by Stanley Lippman cited at the end. Here we content ourselves to mention the basic ideas without really explaining them.

The objects in OOP, called classes in C++, can be abstractions of either the primary problem or its supporting implementation. The principal tasks are to define the classes and their inter-relationship among one another. These relationships can be of two types. One class can be an example of another-a house is a kind of building-or one class can be a member of another-a house has windows. We also must define the set of operations provided by each class; this is the class hierarchy.

All OO languages provide some support for encapsulation, sharing, and inheritance of code. We briefly explain these feature in terms of C++.



next up previous
Next: Design of the Up: The CWP Object-Oriented Optimization Previous: Optimizing With COOOL




Sun Feb 25 12:08:00 MST 1996