Building and registering class libraries
The generic server uses SOM's run-time facilities to load class libraries
dynamically. Thus, dynamically linked libraries (DLLs) should be
created for the classes, just as they would be for non-distributed SOM-based
applications. For more information, see the topic Creating a SOM class library
in Chapter 5 "Implementing classes in SOM."
During the development of the DLL, it is important to remember the following
steps:
- Export a routine called SOMInitModule in the
DLL, which will be called by SOM to initialize the class objects implemented
in that library. SOMInitModule should contain a <className>NewClass
call for each class in the DLL.
- For each class in the DLL, specify the DLL name in
the class's IDL file. The DLL name is specified using the dllname=<name>
modifier in the implementation statement of the interface definition.
If not specified, the DLL filename is assumed to be the same as the class
name.
- For each class in the DLL, compile the IDL description
of the class into the Interface Repository. This is accomplished by invoking
the following command syntax:
sc -sir -u stack.idl (On AIX or OS/2)
Note: If the classes are not compiled into the Interface Repository,
DSOM will generate a run-time error (30056: SOMDERROR_BadDescriptor) when
an attempt is made to lookup the signature of a method in the class (for
example, on a method call).
Put
the DLL in one of the directories listed in LIBPATH for AIX or OS/2, or
listed in PATH for Windows. This is necessary for both OS/2, AIX, and Windows.)
[Back: Parameter memory management]
[Next: Configuring DSOM Applications]