Messages; Class Relationships - Compaq Reliable Transaction Router Getting Started

Reliable transaction router
Hide thumbs Also See for Reliable Transaction Router:
Table of Contents

Advertisement

Object-Oriented Programming
Example 2–1 Objects-Defined Sample
Dog.h:
class Dog
{ ...
};
main.cpp:
#include "Dog.h"
main()
{
}

Messages

Objects communicate by sending messages. This is done by
calling an object's methods.
Some principal categories of messages are:
Classes can be related in the following ways:
Class
Relationships
2–8 Architectural Concepts
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.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rtr

Table of Contents