Juval does a good job summarizing remoting in this article. I especially liked his descriptions of the various instantiation models: client-activated object, server-activated single call and server-activated singleton. Unfortunately, he did not provide any code for the client-activated object and although this is the most simply to understand (at least from the perspective of the DCOM programmer) I find it to be the least documented.
Here is a quote from about the limitations of the single call activation model:
Applying the single-call model Single-call activation clearly offers a trade-off in performance (the overhead of reconstructing the object's state on each method call) with scalability (holding on to the state and the resources it ties in). There are no hard and fast rules as to when and to what extent you should trade performance for scalability. You may need to profile your system and ultimately redesign some objects to use single-call activation and some not to use it.
In addition, the single call activation model works only when the amount of work to be done in each method call is finite, and there are no more activities to complete in the background once a method returns. For this reason you should not spin-off background threads or dispatch asynchronous calls back into the object because the object will be disposed of once the method returns. In every method call the single-call object retrieves its state from some storage, so single-call objects work very well in conjunction with a load-balancing machine as long as the state repository is some global resource accessible to all machines. The load balancer can redirect calls to different machines at will knowing that each single-call object is capable of servicing the call after retrieving its state.
(At times I was not able to view the article because it was considered premier content. However, when I accessed if from the Code Magazine archive page it seemed to work.... hmmm.)
11:31:00 PM
|