HP (Hewlett-Packard) Reliable Transaction Router Network Router User Manual


 
Object-Oriented Programming
Polymorphism
Polymorphism is the ability of objects, inherited from a common
base or parent class, to respond differently to the same message.
This is done by dening different implementations of the same
method name within the individual child class denitions. For
example: A DogArray object, "DogArray OurDogs[2];" refers to
two element objects of class Dog, the base class:
King, of class Doberman, is a derived or child class of Dog.
•Fi, of class Minipoodle, is a derived or child class of Dog.
If, in a program, OurDogs[n]->Bark( ) is called in a loop, then:
In iteration one ([1]), method King::Bark( ) is called.
In iteration two ([2]), method Fi::Bark( ) is called.
King’s bark does not sound like Fi’s bark because each Bark( )
call is a separately dened method within its child object
denition. The virtual parent class (Dog) method Bark( ) is
dened in the class denition of Dog.
Object
Implementation
Benets
The benets of creating RTR solutions with objects include the
following:
Each major RTR concept is represented by its own individual
foundation class.
Simple methods within RTR classes transform features of
RTR for streamlined solutions.
Major classes include Get and Set methods for changing
transaction states.
Default handling code is provided for all Messages and
Events, where appropriate.
You do not need to provide handling code for all messages
and events.
The sending and receiving of data is abstracted to a higher
level with transaction controller and data classes.
No buffers and links coding is needed.
Internal RTR information is accessible without a need to
know RTR internals.
2–10 Architectural Concepts