Class Factories
Purpose
This example shows how to use a Class Factory to generate three types of
server:
- Singleton: all clients access a single server object.
- Single Call: server instances are created on demand and destroyed after processing the method call.
- Pooled: multiple server instances are accessible by clients. This
factory works exactly the same as Singleton, unless the first server instance is
busy.
Note: to test this sample properly, you need to run at least two clients.
Examine the Code
- See how the three services were defined by editing the service library. Do this by making the server
the selected project and by using the menu option: RemObjects | Edit Service Library.
Note: if you don't see this menu option but see 'Service Builder' instead,
you still have the client set as the current project.
- The implementation of the three server types is held in three Impl.pas files: SingletonService_Impl,
SingleCallService_Impl and PooledService_Impl.
- Examine the simple code needed to invoke the methods in ClassFactoryClientMain.pas.