Object Collections vs. Relationship Collections

You can read each relationship in two directions. For example, you can say Herman Melville wrote Moby Dick or Moby Dick was written by Herman Melville. We can paraphrase each of these two statements as follows:

Although awkward, this way of articulating relationships highlights the existence of collections. In the following table, each collection is shown as a collection of objects.

Collection (inside the gray ovals)

Commentary

The collection of books written by Herman Melville.

Collection (inside the gray ovals)

Commentary

The collection of books written by Kraig Brockschmidt.

Collection (inside the gray ovals)

Commentary

The collection of persons who wrote Moby Dick.

You can also think of collections as collections of relationships. The following table shows how every collection of objects has an equivalent collection of relationships.

Object collection

Commentary

The collection of books written by Herman Melville.

Relationship collection

Commentary

The collection of authorships for which Herman Melville is the writer.

Object collection

Commentary

The collection of authors of Moby Dick.

Relationship collection

Commentary

The collection of authorships in which Moby Dick is the written thing.

As the preceding figures show, you can think of each collection in two ways: a collection contains either relationships or objects. When you manipulate a collection object from a COM program, you can manipulate it with an interface called ITargetObjectCol or with an interface called IRelationshipCol. The first interface lets you manipulate a collection as if it contained objects. The second interface lets you manipulate a collection as if it contained relationships.

(c) 1988-1998 Microsoft Corporation. All Rights Reserved.