Previous Topic: ISCApplicationEnvironmentNext Topic: Using the API as an Add-in Tool


Accessing a Model

An API client accesses model data by working with a pool of available persistence units. A persistence unit is the API concept that describes all data related to a single model. A persistence unit can be accessed and saved to persistence storage, such as a file or a model in a mart. A client manipulates persistence units by using the Persistence Units collection.

The existence of some persistence units in the application is dictated by a context in which an instance of the application was created. For example, in standalone mode, none of the units exist at launch time. Methods from the unit collection interface must be used to accumulate units in the collection. In add-in component mode, the collection contains all the units known to the erwin DM user interface at the time when the client component is activated.

When the client program is terminated, the arrangement for the persistence units in memory for standalone mode is that all units are closed. In add-in component mode, after the client program has ended, the units are still open and available in the erwin DM user interface with the exception of those that were explicitly closed and removed from the persistence unit collection before exiting the program.

Note: For erwin DM, the collection is a snapshot. The collection includes only those units that exist at the moment of collection construction (such as at the moment when the PersistenceUnits method of the ISCApplication interface was called). An exception to this is units added or deleted from the collection-these changes are reflected. All new collections reflect the changes as well.