Object Models

An object model is a hierarchy of COM classes. It’s a hierarchy because some classes are subordinate to or contained within others. The relationships among classes in the hierarchy are often represented by an object model diagram. An object model for accessing databases might have a Table class, which might have as one of its properties a reference to an instance of a Fields class, which in turn would maintain multiple references, each to an instance of a Field class. This portion of the object model might be represented in diagram form as shown in Figure 5-3.

A portion of a typical object model diagram

Figure 5-3. A portion of a typical object model diagram

The Fields class in this example commonly would be referred to as a collection class, because its purpose is to maintain a collection of objects (in this case, objects of class Field). Collection classes are common in typical object models.

This concept of making functionality available through object models is also known as Automation.

Get CDO & MAPI Programming with Visual Basic: now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.