Declaring an Association Class

[This is preliminary documentation and subject to change.]

An association class is a special type of class that defines a relationship between two other classes. Every association class is identified by the Association qualifier and has two or more properties that are of type ref (reference) that provide a path to an object. Association class can also have other types of properties.

The following syntax illustrates how to declare an association class. The MyAssocClass class defines a relationship between ClassX and ClassY. . The reference properties PathToClassX and PathToClassY contain the paths to the classes to be associated. The keyword ToInstance is one of several flags that are defined by WBEM to provide information about the use of a qualifier. These flags are known as qualifier flavors. ToInstance indicates that the association class is inherited by all instances of the class. In this way, the client software can determine that an instance belongs to an association class without having to retrieve the class definition to look for the Association qualifier. For more information about qualifier flavors, see Using Qualifier Flavors

[Association : ToInstance] 
class MyAssocClass
{
    ClassX ref PathToClassX ;
    ClassY ref PathToClassY ;
} ;