Programming Transient Object Collections

Meta Data Services Programming

Meta Data Services Programming

Programming Transient Object Collections

Transient object collections are not stored in a repository database. This means that you can populate a transient object collection dynamically, using application code to determine the criteria for including objects.

Transient object collections extend your ability to create collections by providing a way to create collections at run time. Typically, the way you do this is through script. In this case script, instead of stored repository data, is used to dynamically populate a transient object collection. After a transient object collection is instantiated, you can use the collection in your application code just as you would any other repository collection.

Because it is based on script, a transient object collection can contain any combination of objects that you want. It is not subject to the conformance constraints that apply to other kinds of repository object collections.

Transient object collections are exposed through the ITransientObjCol interface.

The following example illustrates how you can use script to populate a transient object collection. Suppose you have an information model that defines a catalog, schemas, and tables. Script that creates a collection of all tables for all schemas in the catalog can be something like the following:

Function GetTables()
Set ObjCol = CreateObject("Repository.TransientObjectCol")
Set reposCatalog = CurReposObject
For each reposSchema in reposCatalog.Interface("Catalog").Schemas
     For each reposTable in reposSchema.Interface("Schema").Tables
          ObjCol.Add reposTable
     Next
Next
Set GetTables = ObjCol
End Function

See Also

Accessing Repository Objects

Accessing Target Object Collections

Defining Script Objects

ITransientObjectCol Interface

Understanding Collections

Understanding Relationship Roles