|User's Guide: Small Ada 95 Object Database; Version 0.1.0; Document Revision $Revision: 1.9 $|
In difference to the normal use case, where the class is implemented in the client, this service provides the capability to install classes in the server.
A typical use case is the so called sequence class. This class provides a method to provide a new unique value on each call. Since the class it implemented on the server these values are unique over the object space.
The example below shows how to use the collection class. This class provides a simple array index by an integer where the object id of any object could be stored.
Example 7-1. Usage of the collection class
declare H : OOS.Collection.Client.Object renames This.Data.H; begin Create( H, Name => "Table" ); TID := Start_Or_Join_Transaction; Reserve_Object(H); Add( H, 3, OID1 ); Commit_Transaction; Get( H, 99, Result ); end