Tips for the Business-Services Tier


Designing Objects for Reuse

Question

The BDG documentation specifically states that n-tier is where n is greater than 2 for a Windows DNA application. Is there an approved approach that allows for maximum code reuse where n is 1? I am trying to find the best approach for maximum code reuse across a broad line of architectures to include desktop, intranet, and Internet.

Our Response

This is an interesting question. Consider the viewpoint that object reuse has nothing to do with n-tier programming, per se. Reusable binary objects (such as those that COM produces) are extremely important to n-tier development, but not vice versa. Here are a few tips to keep in mind as you design your object for reuse:


Creating COM Objects with MTS

Whether to create COM objects with MTS (using the MTS.CreateInstance method) has been a topic of some controversy. For more information on this issue, see About Creating COM Objects in MTS.