Mark Michaelis' Weblog :
Updated: 9/1/2004; 6:57:46 AM.

 








Subscribe to "Mark Michaelis' Weblog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

Subscribe To
Mark's Weblog

 
 

Sunday, April 06, 2003

What is especially neat about this example is that it is thread safe (something you seldom see in IDispose examples).

"There is a lot of details involved in implementing a bullet-proof Dispose() and Finalize(), especially when inheritance is involved. The file is a generic template that handles class hierarchy, multiple calls to dispose and finalization."

You can check out other code sample downloads from IDesign here.


11:55:35 PM   []    comment []

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   []    comment []

Visual Studio.NET Solution Properties Dialog
Google Search It

When debugging or testing .NET Remoting you will often want to start a second process that hosts the Application server objects. Although you could always start this process manually there is a dialog within Visual Studio.NET that enables more than one project within the solution to start when you debug or run your application. To access the dialog simply right click on the solution and select the properties menu. In the Startup Project node (within the Common Properties folder) you will see a radio button that allows you to select to start multiple projects as shown in the image below:

Visual Studio.NET Solution Properties Dialog

While on the topic of starting and debugging processes, I will also mention an often overlooked menu item to start projects other than the default startup project.  Most developers know that if you right click on a project within a multi-project solution you can switch which project starts up.  In the same right-click menu you can select the Debug menu item to "Start new instance" or "Step in to new instance" of the selected project.


3:48:08 PM   []    comment []

© Copyright 2004 Mark Michaelis.



 


April 2003
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
Mar   May


Recent Posts