November 2013
Beginner
325 pages
9h 47m
English
It is pretty common to have relationships that go in two directions. For example, maybe an asset should know which employee is currently holding it. Let’s add that relationship. The new object diagram would look like this:
Figure 23.1 Adding holder relationship
From a design standpoint, you would say that you are adding a pointer from the child (an instance of BNRAsset) back to its parent (the instance of BNREmployee that is holding it).
In BNRAsset.h, add a pointer instance variable to hold on to the holding employee:
#import <Foundation/Foundation.h> @class BNREmployee; @interface BNRAsset ...
Read now
Unlock full access