To-one relations

To-one relations are implemented as simple pointers. Their treatment is similar to that of attributes; that is, they also have accessor and mutator functions.

If B is a class related to A by the role name role, A contains the following data member:

B* role;

It contains the following methods:

B* getRole();
void setRole(B* p_B);

These defaults are modifiable through the properties of the role.


Feedback