ICollectionDef Interface

Meta Data Services Programming

Meta Data Services Programming

ICollectionDef Interface

A collection type (also referred to as a collection definition) defines how instances of a particular type of collection behave. The properties of the collection type determine:

  • The minimum and maximum number of items in a collection.

  • Whether the collection type is an origin collection type.

  • Whether the collection type permits the naming of destination objects and, if so, whether those names are case-sensitive and required to be unique.

  • Whether the collection type permits the explicit sequencing of items in the collection.

  • What happens to related objects when objects or relationships in the collection are deleted.

  • Whether origin collections of this type are automatically copied to new object versions by the CreateVersion method.

  • Whether the MergeVersion method combines origin collections of this type as a whole, or item by item.

  • Whether the FreezeVersion method requires destination object versions of relationships of this type to be frozen before their origin object versions can be frozen.

The kind of relationship that a particular collection type uses to relate objects to each other is determined by its CollectionItem collection. The CollectionItem collection associates a single relationship type to the collection type.

To add a new collection type, use the IInterfaceDef interface.

When to Use

Use the ICollectionDef interface to retrieve or modify the properties of a collection type or to determine the kind of relationship that the collection implements.

Methods
IUnknown method Description
QueryInterface Returns pointers to supported interfaces
AddRef Increments the reference count
Release Decrements the reference count

IDispatch method Description
GetIDsOfNames Maps a single member and a set of argument names to a corresponding set of dispatch identifiers
GetTypeInfo Retrieves a type information object, which can be used to get the type information for an interface
GetTypeInfoCount Retrieves the number of type information interfaces that an object provides (either 0 or 1)
Invoke Provides access to properties and methods exposed by an Automation object

IRepositoryDispatch method Description
get_Properties Retrieves the IReposProperties interface pointer. The IReposProperties interface provides access to the Properties collection.

Properties
Property Description
Flags Flags that determine the behavior of this type of collection
IsOrigin The indicator of whether collections of this type are origin collections
MaxCount The maximum number of target objects that can be contained in a collection of this type
MinCount The minimum number of target objects that must be contained in a collection of this type

Collections
Collection Description
CollectionItem The collection of one relationship type that defines the relationship between target objects of this type of collection and a single source object

See Also

CollectionDef Class

IInterfaceDef Interface