Monteverdi

The Future of DCOM

Microsoft's Distributed Component Architecture Vision

by Rich Fedrigon

COM+

 

What exactly is COM+?

(Summary information from the Tom Armstrong Report in Visual C++ Developers Journal, February/March 1999 issue, on the 1998 PDC COM+ Internals presentation by Mary Kirkland of Microsoft)

Assuming there is a basic understanding of COM/DCOM,  MTS follows the COM/DCOM evolution. It provides server-side component services.  It also fixes some of DCOMs deficiencies in the areas of security, component management, and configuration. COM+ strives to unify COM and MTS into a total enterprise component technology. COM+ also provides better:

Component Administration

Load Balancing/Object Pooling

Improved Event Model

COM+ is Microsoft's next step in their COM technology evolution. One should first be aware of the fact that this strategy is even now in a state of flux - so expect lots of changes in the future. COM+ is a core service of Windows DNA architecture. In the previous sections I have addressed the software component issue, COM, and its logical consequence for the distributed model, DCOM. Now COM+ is a major upgrade to Microsoft's long-term component strategy. It will be part of Microsoft's final release of Windows 2000 (formerly Windows NT 5.0).

COM+ Environment Legacy Issue

"Microsoft has promised and demonstrated that legacy COM and MTS components will work just fine in the new COM+ environment. Today, you should continue to invest in the COM and MTS programming models. If you are building COM and MTS applications, continue to do so. However, you should start looking into the component features provided by Windows 2000 as they are broad and will have a significant impact on the development and delivery of applications."

Addressing the Difficulties of COM Development

Those of us who worked through TheServer/ThePusher/TheControl Tutorial know first hand both the usefulness and difficulties of developing COM/DCOM components. ATL is a very useful tool in making this job less tedious. However to make COM/DCOM a widely used technology, Microsoft had to make it easier and more transparent for developers.

Unfortunately the COM and C++ programming models are too distinctive. Knowledge of low-level COM is still very important to utilizing it in a C++ environment. COM requires a completely different mindset and is very difficult for programmers to learn.   Attribute-based programming is Microsoft’s solution here.

Attribute-based Programming

Attribute-based programming is the technique of using declarative instructions in your code to guide the implementation. Since there is so much redundancy in writing such code, tools are developed to implement the "glue" code. Refer to the Attribute-based Programming link for examples of the syntax and more details on this subject.

More Attributes Coming

Although the small number of currently defined attributes only pertain to COM now, expect it to be extended to include other technologies in the future. This technology extensibility is an important point to note although language purist might be concerned.

C++ Environment Changes

The C++ compiler hasn’t been changed to support COM component construction. Instead an extension to the build process was defined that supported the addition of these new language attributes. "As the compiler encounters attributes in the source, it passes them to the attribute provider. The provider then converts the attribute to C++ code and passes it back to the compiler, which compiles it into the resulting object code." Again note that currently the only provider now identified is ATL. The beauty of this framework is that other providers can later be identified as extensions to the environment. "Providers can also generate their own inputs (e.g. IDL) to the build process."

Another benefit to this approach is that ATL versioning have been decoupled from C++ language versioning. Each can be changed independently. This is an example of "walking the talk" or practicing what you preach regarding the spirit of component technology.

New COM+ Services: Load Balancing

Load balancing is not currently supported in the current COM/MTS model. We now must identify explicitly the name of the remote machine on which to create an instance. This is similar to the grocery store queue example that Roger Sessions used to explain the benefits of clustering. What we want is an airport type queue system. This provides the ability to scale an application (e.g. add more clerks during busy times and send a customer to the next available clerk). COM+ addresses this issue by providing the ability to transparently route the remote creation request to the machine with the lightest load. Refer to the Load Balancing link for more detailed information and insights on the implementation.

New COM Services: COM+ IMDB

COM+ In-Memory Database is another service trying to provide scalability. This service is provided primarily for Web applications where thousands of users access database information. Its attempts to take advantage of the fact that data-intensive applications are more responsive if as much of the data as possible is loaded into physical memory. So this service more generically will to benefit any application where rapid access to large amounts of data is required.

"The IMDB implements a DB-oriented, caching system that optimizes look-ups and retrievals. The IMDB can load tables from an existing back-end database or can house transient data as part of your application. One example of where the IMDB is useful is a large Web application, where servicing thousand of requests per minute for data within a relational database is an expensive proposition. By using the IMDB for those tables that get read frequently, the application can support many more requests simply by adding more memory, which gets cheaper every day. Also, all requests for data from those tables will be handled on the application tier where IIS and its components reside, eliminating a network trip for data."

New COM Services: Object Pooling

"Object pooling is the process of maintaining a set of component instances loaded into memory so that they are immediately available for use by client applications. It is another important feature required to build large, scalable applications."

In most cases our applications will not need to support pooling since MTS is very efficient at caching component information. However there are two rules to consider in deciding on the use of this feature:

If the construction time for the object will be longer than the actual use period of that object.

If the component accesses a limited resource such as a database, mainframe, or socket connection.

New COM Services: Queued Components

"Currently COM is based on procedural interactions. A client connects to a component, queries for an appropriate interface, and makes synchronous method calls through the returned interface.The lifetime of the client and the component are tightly coupled, and information is retrieved from the componentvia [out] parameters.

RPC-based services like those provided with COM are necessary for building distributed applications. However, there are certain applications that can benefit from another development technique called "messaging." A message-based application decouples the execution lifetimes of the client and its components. The new COM+ Queued Components service provides for this type of application." Tom Armstrong

This feature allows asyncronous communication. If the component isn't available, the client can still execute. Client and component lifetimes are now decoupled. This is very analogous to amessage based email system. The implementation model also borrows from the email system. A proxy recorder at the client end and a proxy player at the server end are defined. These proxies are functionally similar to the role the ISPs play in an email system. Obviously id your computer is off, you still receive email.

COM Events

"Today, COM provides two techniques for handling events or callbacks between a component and any associated clients. The first technique uses an interface callback mechanism where the client implements an interface described by the component. Events or notifications are then fired by calling through the client's interface.

A second technique called Connectable Objects, uses standard COM IConnectionPoint interfaces. This technique is similar to that described above but provides a more general way of connecting the cooperating entities." Tom Armstrong

The whole client/component concept blurs here and the terms publisher (provider of info) and subscriber (consumer of info) are used instead. The old COM model tightly bind them and causes several other problems. The new event model decouples them and creates an intermediary object called event class. Check out the Armstrong article for more specifics.

Fresh off the DNA/COM+ Presses

A new technology concept called Forms+ has been introduced to deal with the developers choice regarding which user to target: thin client or rich client. It has the goal of merging the WIN32 GUI and Web APIs. Evolving information on Internet Explorer 5 will reveal more on this subject.
DCOM, MTS, IIS, and Active Server Pages are some of the middle tier technologies to handle business logic and other applications. Middle tier component have access to the back-end data using ADO (Active Data Object) or OLE DB. Tools for accessing non-Windows platforms such as UNIX are also included (e.g. ODBC, COM services on UNIX, and the new COM Transaction Integrator, or COMTI).

As with Forms+, Storage+ is another incomplete technology whose goal is directed towards the future of the Windows file system for back-end services. Not much is available yet on this subject.

What's Not covered?

 

What about Visual Basic and Java?

Roger Sessions writes much about the importance of using Visual Basic at the presentation layer and Java being the perfect language to write components at the application layer. I have stayed away from mentioning Java because so much is uncertain with Microsoft’s strategy here after recently losing a lawsuit with Sun on this subject. There have been all kinds of amazing reports about Microsoft developing a new Java-like language called "Cool." The question of how Microsoft will simplify COM component creation in other languages is worthy of more investigation. Java is such a popular and efficient developers language that I expect Microsoft will have to somehow parallel the approach used with the C++ compiler/build process.

The Visual Basic front-end now appears to me to have less of a future if you agree that thin clients will become progressively more important than rich clients supported by the Windows API. Developers certainly could use Visual Basic for applications for Windows CE appliances. More expert opinion and wisdom on this subject would be welcomed too.