Messages; Class Relationships - HP Reliable Transaction Router Getting Started

Reliable transaction router
Table of Contents

Advertisement

Example 2–1 Objects-Defined Sample
Dog.h:
class Dog
{ ...
};
main.cpp:
#include "Dog.h"
main()
{
}
Objects communicate by sending messages. This is done by

Messages

calling an object's methods.
Some principal categories of messages are:
Classes can be related in the following ways:
Class
Relationships
Dog King;
Dog Fifi;
Constructors: Create objects
Destructors: Delete objects
Selectors: Return part or all of an object's state. For
example, a Get method
Modifiers: Change part or all of an object's state. For
example, a Set method
Iterators: Access multiple element objects within a container
object. For example, an array.
Simple association: One class is aware of another class. For
example, "Dog object is associated with a Master object." This
is a "Knows a" relationship.
Composition: One class contains another class as part of its
attributes. For example, "Dog objects contains Leg objects."
This is a "Has a" relationship.
Inheritance: A child class is derived from one or more
parent, or base, classes. For example, "Mutt object derives
from Collie object and Boxer object which both derive from
Dog object." This is an "Is a" relationship. Inheritance
enables the use of polymorphism.
Object-Oriented Programming
Architectural Concepts 2–9

Advertisement

Table of Contents
loading

This manual is also suitable for:

Aa-rle1c-te

Table of Contents