Join Books.org — it's free

Book cover of Essential COM
Object-Oriented Programming, C/C++

Essential COM

by Don Box, Grady Booch (Foreword by), Charlie Kindel
Available on Bookshop Write a review

Books.org participates in affiliate programs including Bookshop.org and the Amazon Services LLC Associates Program. We may earn a commission from qualifying purchases made through links on this page, at no additional cost to you.

Log in to track your reading progress.

Overview

"Don Box makes it possible for mere mortals to join the COM cognoscenti. If youire a C++ COM programmer, buy this book." -David Chappell, Principal, Chappell & Associates and author of Understanding ActiveX and OLE

Written by a leading COM authority, this unique book reveals the essence of COM, helping developers to truly understand the why, not just the how, of COM. Understanding the motivation for the design of COM and its distributed aspects is critical for developers who wish to go beyond simplistic applications of COM and become truly effective COM programmers. As the COM programming model continues to evolve, such insight also becomes essential to remaining current with extensions, such as Microsoft Transaction Server and COM+. By showing you why Distributed COM works as it does, Don Box enables you to apply the model creatively and effectively to everyday programming problems.

This book examines COM from the perspective of a C++ developer, offering a familiar frame of reference to ease you into the topic. You will also find comprehensive coverage of the core concepts of Distributed COM (interfaces, classes, apartments, and applications), including detailed descriptions of COM theory, the C++ language mapping, COM IDL (Interface Definition Language), the remoting architecture, IUnknown, monikers, threads, marshalers, security, and more. In addition, the book offers a thorough explanation of COMis basic vocabulary, provides a complete Distributed COM application to illustrate programming techniques, and includes the authoris tested library of COM utility code.

0201634465B04062001


This is definitely a developer's guide for Microsoft's Component Object Model (COM), written from the perspective of a C++ programmer. A very interesting aspect of this publication is that the solutions presented are not based on object-oriented dogma, but on pragmatic and realistic best practices. The author distills the essentials of this flexible substrate (COM) by guiding you outside the constraints of SDK documentation while explaining building concepts of distributed object-oriented systems. Don separates interface from implementation then leads you through COM interfaces to COM object implementation and run-time integration. Next he covers objects, primitives, threads, processes and distributed access. He examines process and application management issues, including pitfalls, then reviews pointers, memory management and arrays before concluding with miscellaneous topics such as flow control, dynamic versus static invocation, and bi-directional interface controls.

Synopsis

"Don Box makes it possible for mere mortals to join the COM cognoscenti. If youire a C++ COM programmer, buy this book." -David Chappell, Principal, Chappell & Associates and author of Understanding ActiveX and OLE

Written by a leading COM authority, this unique book reveals the essence of COM, helping developers to truly understand the why, not just the how, of COM. Understanding the motivation for the design of COM and its distributed aspects is critical for developers who wish to go beyond simplistic applications of COM and become truly effective COM programmers. As the COM programming model continues to evolve, such insight also becomes essential to remaining current with extensions, such as Microsoft Transaction Server and COM+. By showing you why Distributed COM works as it does, Don Box enables you to apply the model creatively and effectively to everyday programming problems.

This book examines COM from the perspective of a C++ developer, offering a familiar frame of reference to ease you into the topic. You will also find comprehensive coverage of the core concepts of Distributed COM (interfaces, classes, apartments, and applications), including detailed descriptions of COM theory, the C++ language mapping, COM IDL (Interface Definition Language), the remoting architecture, IUnknown, monikers, threads, marshalers, security, and more. In addition, the book offers a thorough explanation of COMis basic vocabulary, provides a complete Distributed COM application to illustrate programming techniques, and includes the authoris tested library of COM utility code.

Marcato

The Ultimate COM Reference

The Component Object Model (better known simply as COM) is Microsoft’s response to the increasing need for a solid foundation onto which modular software components can be built and upon which they can interact. Centered on the principle of separation between interface and implementation, COM achieves truly effective component-based management and language independence by defining not only a binary standard, but also a set of mandatory rules and design/implementation idioms that allow components to expose their functionality in a consistent manner. The paradigm abstracts the physical location of the objects; thus, with DCOM (Distributed COM), clients and servers can almost transparently reside in any nodes of a network.

Starting from the progressive definition of an informal set of requirements for modular software architectures, the first chapter of Essential COM highlights how, by itself, the C++ language is not capable of satisfying many of them, even when associated with DLLs. Several possible design alternatives are then evaluated, and the final decision leads to the rough engineering of COM. This is perhaps the most vaporware-free introduction to the subject I have ever read because it explains through facts and not conjecture how and why the C++ object model maps well to COM.

The following chapter dives straight into the core of COM by clearly explaining the key notion of interfaces (including the root of all of them, IUnknown), the rules to which they must adhere, and the way they should be described in IDL (Interface Definition Language). The subsequent chapters focus on the other fundamental aspects of the paradigm: coclasses, monikers, object identity, marshaling, apartments, security. Although DCOM is not cited explicitly in the title, the presentation of object activation and of the apartment models takes into account the distributed case from the beginning, instead of delegating such discussion to a final chapter as many other books not specifically focused on distributed architectures do.

As the book proceeds, more and more room is given to complex technical issues and useful (while not trivial) COM programming idioms, such as tear-off interfaces for saving memory as the number of interfaces climbs significantly but not all of them happen to be constantly in use. In all cases the solutions make use of only the raw COM API and interfaces at the C++ level. Neither the theory, nor any of the numerous code snippets sprinkled throughout in the book, mention high-level frameworks such as ATL or MFC. The dissertation on multithreading issues and marshaling are very detailed and betray the vast experience of the author in the implementation of nontrivial COM systems.

Let me state clearly that this is not an easy read. The density of the book (calculated as actual information per page) is incredibly high and, while a rare quality in today’s books, it requires particular concentration to be digested. The editing is overall of good level, although the writing style in certain parts becomes a little heavy and academic, which does not help overcome the toughest conceptual barriers of certain topics. Additional diagrams would have aided comprehension, too.

In the preface the author himself admits he took the style of the notorious book, The C++ Programming Language (authored by the equally notorious Bjarne Stroustrup) as inspiration. Although one covers a single object-oriented programming language and the other a language- independent object-oriented paradigm, I believe the comparison is apt. Just as Stroustrup’s text is widely considered the definitive reference for C++ for its depth and completeness, so Essential COM deserves to be elected the definitive reference for COM due to the same outstanding quality.

The emphasis is on amassing a solid ground on the so-called COM lifestyle and on understanding how and why to opt for certain techniques rather than the other possible approaches to both common and advanced problems. If you are looking for a book that exposes up front to the reader ATL or MFC code snippets to cut and paste into his or her ongoing ActiveX project, look elsewhere. When you have read this however, rest assured that you will be able to benefit from such other hands-on books immensely more.

Also, following up the previous observation, just as I would be reluctant to suggest Stroustrup’s book to someone who is going to meet C++ for the first time, I wouldn’t suggest COM illiterates to begin their explorations from this one, unless they knew C++ and another distributed model like CORBA quite well. Other books on the marketplace take a milder approach while attempting to explain basically the same subject. They generally fall short of deep technical details and advanced facets, nonetheless they can offer a somewhat more progressive path to the complexity of the argument. One such book that I would suggest is Inside COM, written by Dale Rogerson and published by Microsoft Press.

Unfortunately other COM/DCOM correlated topics, such as MTS and COM+, are not even touched. It could be objected that it is not the goal of this book to offer quick-and-dirty overviews of anything, but an indication of where those new acronyms integrate in the big picture would have been interesting in my opinion.--Dr. Dobb's Electronic Review of Computer Books

About the Author, Don Box

Don Box is a leading educator, recognized authority on the Component Object Model (COM), coauthor of the Simple Object Access Protocol (SOAP) specification, and coiner of the term "COM is Love." He recently joined Microsoft as an architect in the Microsoft® .NET Developer and Platform Evangelism Group.

Earlier in his career, Box cofounded DevelopMentor Inc., a component software think tank aimed at educating developers on the use of the COM, Java, and

Reviews

There are no reviews yet. Log in to write one.

Editorials

Marcato

The Ultimate COM Reference

The Component Object Model (better known simply as COM) is Microsoft's response to the increasing need for a solid foundation onto which modular software components can be built and upon which they can interact. Centered on the principle of separation between interface and implementation, COM achieves truly effective component-based management and language independence by defining not only a binary standard, but also a set of mandatory rules and design/implementation idioms that allow components to expose their functionality in a consistent manner. The paradigm abstracts the physical location of the objects; thus, with DCOM (Distributed COM), clients and servers can almost transparently reside in any nodes of a network.

Starting from the progressive definition of an informal set of requirements for modular software architectures, the first chapter of Essential COM highlights how, by itself, the C++ language is not capable of satisfying many of them, even when associated with DLLs. Several possible design alternatives are then evaluated, and the final decision leads to the rough engineering of COM. This is perhaps the most vaporware-free introduction to the subject I have ever read because it explains through facts and not conjecture how and why the C++ object model maps well to COM.

The following chapter dives straight into the core of COM by clearly explaining the key notion of interfaces (including the root of all of them, IUnknown), the rules to which they must adhere, and the way they should be described in IDL (Interface Definition Language). The subsequent chapters focus on the other fundamental aspects of the paradigm: coclasses, monikers, object identity, marshaling, apartments, security. Although DCOM is not cited explicitly in the title, the presentation of object activation and of the apartment models takes into account the distributed case from the beginning, instead of delegating such discussion to a final chapter as many other books not specifically focused on distributed architectures do.

As the book proceeds, more and more room is given to complex technical issues and useful (while not trivial) COM programming idioms, such as tear-off interfaces for saving memory as the number of interfaces climbs significantly but not all of them happen to be constantly in use. In all cases the solutions make use of only the raw COM API and interfaces at the C++ level. Neither the theory, nor any of the numerous code snippets sprinkled throughout in the book, mention high-level frameworks such as ATL or MFC. The dissertation on multithreading issues and marshaling are very detailed and betray the vast experience of the author in the implementation of nontrivial COM systems.

Let me state clearly that this is not an easy read. The density of the book (calculated as actual information per page) is incredibly high and, while a rare quality in today's books, it requires particular concentration to be digested. The editing is overall of good level, although the writing style in certain parts becomes a little heavy and academic, which does not help overcome the toughest conceptual barriers of certain topics. Additional diagrams would have aided comprehension, too.

In the preface the author himself admits he took the style of the notorious book, The C++ Programming Language (authored by the equally notorious Bjarne Stroustrup) as inspiration. Although one covers a single object-oriented programming language and the other a language- independent object-oriented paradigm, I believe the comparison is apt. Just as Stroustrup's text is widely considered the definitive reference for C++ for its depth and completeness, so Essential COM deserves to be elected the definitive reference for COM due to the same outstanding quality.

The emphasis is on amassing a solid ground on the so-called COM lifestyle and on understanding how and why to opt for certain techniques rather than the other possible approaches to both common and advanced problems. If you are looking for a book that exposes up front to the reader ATL or MFC code snippets to cut and paste into his or her ongoing ActiveX project, look elsewhere. When you have read this however, rest assured that you will be able to benefit from such other hands-on books immensely more.

Also, following up the previous observation, just as I would be reluctant to suggest Stroustrup's book to someone who is going to meet C++ for the first time, I wouldn't suggest COM illiterates to begin their explorations from this one, unless they knew C++ and another distributed model like CORBA quite well. Other books on the marketplace take a milder approach while attempting to explain basically the same subject. They generally fall short of deep technical details and advanced facets, nonetheless they can offer a somewhat more progressive path to the complexity of the argument. One such book that I would suggest is Inside COM, written by Dale Rogerson and published by Microsoft Press.

Unfortunately other COM/DCOM correlated topics, such as MTS and COM+, are not even touched. It could be objected that it is not the goal of this book to offer quick-and-dirty overviews of anything, but an indication of where those new acronyms integrate in the big picture would have been interesting in my opinion.--Dr. Dobb's Electronic Review of Computer Books

Book Details

Published
December 1, 1997
Publisher
Addison-Wesley
Pages
464
Format
Paperback
ISBN
9780201634464

More by Don Box

Similar books