Programming WCF Services: Instance-Management



Behaviors

By and large, the service instance mode is strictly a service-side implementation detail that should not manifest itself on the client side in any way.

Per-Call Services

When the service type is configured for per-call activation, a service instance (the CLR object) exists only while a client call is in progress. Every client request (that is, a method call on the WCF contract) gets a new dedicated service instance.

Per-Session Services

WCF can maintain a session between a client and a particular service instance. When the client creates a new proxy to a service configured as a sessionful service, the client gets a new dedicated service instance that is independent of all other.

Singleton Service

The singleton service is the ultimate sharable service. When a service is configured as a singleton, all clients independently get connected to the same single well-known instance, regardless of which endpoint of the service they connect to. The sing...

Demarcating Operations

Sometimes, a sessionful contract has an implied order to operation invocations. Some operations cannot be called first, while other operations must be called last. For example, consider this contract used to manage customer orders.

Instance Deactivation

The sessionful service instance management technique as described so far connects a client (or clients) to a service instance. Yet, the real picture is more complex. Recall from Chapter 1 that each service instance is hosted in a context, as shown.

Throttling

While it is not a direct instance management technique, throttling enables you to restrain client connections and the load they place on your service. enables you to avoid maxing out your service and the underlying resources it allocates and uses.

 

Read more