Previous | Table of Contents | Next |
Much of the detail of the MOF computational model depends on a notion of equality of values. For example, the precise formulation
of the “no duplicates? rule for link sets depends on a definition for what it means for object type instances to be equal.
Equality of MOF Values is defined as follows:
1. Instances of Classes are equal if and only if they have the same identity. Equality does not take into account the values of Attributes for the instances or the links involving the instances. The null Class instance is only equal to itself.
2. Values of all MOF data types are incomparable if they do not have the same type.
3. Values of MOF standard primitive data types are equal if and only if they denote the same element of the set that defines the primitive type.
4. Values of MOF enumeration data types are equal if and only if they denote the same enumerator.
5. Values of MOF collection data types are equal if and only if they have the same number of elements. For a ‘bag’ or ‘set,’ there must be a 1-for-1 correspondence between the collection elements such that the corresponding elements be equal according to these rules. For a ‘list’ or ‘ordered set,’ the elements at each position in the collection must be equal according to these rules.
6. Values of MOF structure types are equal if and only if they have the same type and the corresponding structure fields are equal according to these rules.
7. Values of MOF alias types are equal if and only if they have the same type and their values compare as equal in the context of the alias type’s base type.
8. The meaning of equality for native type values is not specified here. In some mappings, some native values may be incomparable.
NOTE: The meaning of equality for values of incomparable types is not defined. However, this is not an issue since the semantics
of MOF metadata do not depend on being able to compare such values.