Chapter 7. Overview

Table of Contents
Usecases
Building and Installation
Limitation

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.

Usecases

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;  (1)
begin
   Create( H, Name => "Table" );                           (2)
                                                                                                                   
   TID :=  Start_Or_Join_Transaction;
   Reserve_Object(H);                                      (3)
                                                                                                                       
   Add( H, 3, OID1 );                                      (4)
                                                                                                                       
   Commit_Transaction;                                     (5)
                                                                                                                       
   Get( H, 99, Result );
end
	   
(1)
This declared a collection object on the client side.
(2)
Create an instance of the type OOS.Collection.Client.Object on the server. If the object with the name "Table" is already existing return the object contents.
(3)
Reserve the object exclusively for this process. Other processes will block till the commit is executed.
(4)
Add the object id of some object to index 3 of the collection.
(5)
Commit the change to the server. From this point on other processes my access retrieve the index value 3.