Understanding DCOM

William Rubin, Marshall Brain

Prentice Hall

ISBN 0-13-095966-9

Reviewed Mar 5, 1999

DCOM books tend to be very thick. This one stands out of the rest with its 300- pages and use of a big font. Nevertheless, it does a great job at giving a good overview of COM and DCOM.

Even though this is not mentioned in the title, this book also talks of ATL (Active Template Library), Microsoft's latest attempt at bringing the level of complexity of DCOM within the grasp of feeble human minds such as mine. Therefore, the book assumes Visual C++ 6.0 as your main development tool, the only IDE supporting ATL as of today.

The first four chapters give some definitions and guide you through a quick Beep application. Note that this example is written almost entirely by hand, using the ATL. The author decided not to use any of the Wizard feature offered by Visual C++ 6.0 in order to show that the task is not that daunting. And as it turns out, ATL can indeed be manipulated by hand, as long as you rely on the many default behaviors it offers (through default template parameters). The other examples throughout the book do use the Wizards though, but this quick example allows the reader to be a little more familiar with the occasionally weird syntax that the ATL cannot always completely avoid (Win32 is still lurking under the hood).

The chapter 5 serves as a transition : it examines in details what the generated code looks like and tries to demystify it (it partially succeeds). This is too often overlooked by Win32 books. Wizards are a great help when it comes down to Win32 programming but sooner or later, debugging will force you to hold your breath and take a deep dive in the gazillions files that VC++ generated for you.

The next three chapters discuss more anecdotal issues like : accessing COM objets through Visual Basic and how to use MIDL to represent your interfaces accurately.

Chapter 10 details the various thread policies that COM offers. If you leave aside the annoying non-standard naming scheme invented by Microsoft (Apartment Threaded or Free Threaded, sir ? Will you have fries with that ?), you will reach the end of this chapter with a pretty good vision of what your options are. Should you opt for the Free Threading strategy, you will need to get acquainted with the thread locking classes that the ATL offers (and which are unfortunately barely scratched in this book, but this is part of the trade off for having 300 pages).

The next chapter details the interaction between COM and the Registry, another important point too often overlooked. Sometimes your servers will just not be activated because your GUID's don't match, and being able to check out the Registry and make sure everything is in there is the first reflex one should have.

Then we switch to more advanced functionalities :

Finally, DCOM is discussed. Actually, the step from COM and DCOM is very small (it's mainly about how you initialize COM). DCOM has come a long way since its early age but it is still far from being as complete as CORBA in this respect. While distributed support in COM is crude, I still believe it addresses a pretty good part of the problems Win32 programmers face every day.

The book concludes on some random topics that didn't fit in any other category : how ATL uses templates and smart pointers.

Overall a very enjoyable and interesting read. This is one of the first books to cover the ATL (another one being ATL COM) and this technology is definitely the way to go for any COM developer. Microsoft has succeeded in using the latest C++ features to their advantage. Interestingly enough, a few years ago, the Win32 API had already considerably gained in ease of use when Microsoft switched to C++. The painfully long parameter lists suddenly became usable thanks to default parameters. The ATL is now bringing templates into the picture and it's for the good of everyone. Note too that CORBA's POA did exactly that not so long ago by switching from preprocessor-governed TIE's to templatized ones.

Cedric Beust

Back to the menu