Object-Oriented Programming
Table 2–1 Functional and Object-Oriented Programming Compared
Functional Programming |
A program consists of data structures and algorithms.
The basic programming unit is the function, that when run, implements an algorithm.
Functions operate on elemental data types or data structures.
An application's architecture consists of a hierarchy of functions and
A program consists of a team of cooperating objects.
The basic programming unit is the class, that when instantiated, implements an object.
Objects communicate by sending messages.
An applications architecture consists of objects that model entities of the problem domain. Objects' relationships can vary.
Objects | In the | |
| is a grouping of cooperating objects. The basic programming | |
| unit is the class. Instantiating, or declaring an instance of, | |
| a class implements an object. RTR provides | |
| programming capabilities with the C++ API, described in the | |
| C++ Foundation Classes manual. Objects are instances of a | |
| class. In a transaction class, each transaction is an object. An | |
| object is an instantiated (declared) class. Its state and behavior | |
| are determined by the attributes and methods defined in the | |
| class. An object or class is defined by its: | |
| • | State (attributes) |
| • | Behavior (methods) |
| • Identity (name at instantiation) |
The name given at object declaration is its identity. In Example
Architectural Concepts