Team LiB
Previous Section Next Section

Referencing the Same Object Simultaneously from Multiple Collections

As we mentioned earlier, when we talk about inserting an object into a collection, what we really mean is that we're inserting a reference to the object, not the object itself. This implies that the same object can be referenced by multiple collections simultaneously. Think of a person as an object, and his or her telephone number as a handle for reaching that person. Now, as we proposed earlier in this chapter, think of an address book as a collection: it's easy to see that the same person's phone number (reference) can be recorded in many different address books (collections) simultaneously.

Now, for an example relevant to the SRS: given the students who are registered to attend a particular course, we may simultaneously maintain the following:

This is depicted conceptually in Figure 6-11.

Click To expand
Figure 6-11: A given object may be referenced by multiple collections simultaneously.

Team LiB
Previous Section Next Section