Per-Client Class Factory

The Per-Client Class Factory will maintain separate service instances for each client and ensure that subsequent calls from the same client will be served by the same instance. This allows you to store per-client state inside the class fields between calls, but limits the scalability of the server, because the number of active service instances (and with it, the memory consumption) will grow linearly with the number of clients.

A timeout can be provided, after which services instances linked to clients that have been inactive will be destroyed.

Use Cases

Use the per-client class factory if you need per-client data in class fields to be persisted between calls. You should limit the use of this class factory to scenarios where the number of users is reasonably small, and consider use of the Pooled Class Factory and Session Management if you expect a large or unlimited number of users accessing your server.

Class Factory Types

See Also