skip to main content
Skip header Section
Essential COMDecember 1997
Publisher:
  • Addison-Wesley Longman Publishing Co., Inc.
  • 75 Arlington Street, Suite 300 Boston, MA
  • United States
ISBN:978-0-201-63446-4
Published:01 December 1997
Pages:
464
Skip Bibliometrics Section
Bibliometrics
Skip Abstract Section
Abstract

From the Book: My work is done. I can finally rest, knowing that I have finally put into writing what many have termed the rich oral history of COM. This book reflects the evolution of my own understanding of this rogue technology that Microsoft was kind enough to reveal to the programming world in 1993. While I did not attend the original OLE Professional Developer's Conference, I still feel as if I have been doing COM forever. After almost four years of working with COM, I can barely remember the pre-COM era of computing. I can, however, vividly remember my own painful trek across the COM landscape in early 1994. It took me roughly six months before I felt I understood anything about COM. During this initial six-month period of working with COM, I could successfully write COM programs and almost explain why they worked. However, I had no organic understanding of why the COM programming model was the way it was. Fortunately, one day (August 8, 1994, roughly six months after buying the book Inside OLE2), I had an intense epiphany and at once COM seemed obvious to me. This by no means meant that I understood every COM interface and API function, but rather, that I understood the primary motivating factors behind COM. From this, it became clear how to apply the programming model to everyday programming problems. Many other developers have related similar experiences to me. As I write this preface three Augusts after the fact, developers still must go through this six-month waiting period prior to becoming productive members of COM society. I would like to think that this book might shorten that time period, but I make no promises. As this book emphasizes, COM is more a programming discipline than a technology. To this end, I have attempted to not bludgeon the reader with detailed descriptions of each parameter to each method from each interface. Rather, I have tried to distill the essence of what COM is really about, leaving the SDK documentation to fill in the gaps left behind by each chapter. Wherever possible, I have attempted to address the underlying tensions that motivate a particular aspect of COM rather than provide detailed examples of how to apply each interface and API function to a contrived example program. My own experience has shown that once the why is understood, the how follows fairly naturally. Conversely, simply knowing the how rarely provides adequate insight to extrapolate beyond the documentation. This insight is critical if one hopes to keep up with the programming model's continual evolution. COM is an extremely flexible substrate for building distributed object-oriented systems. To take advantage of COM's flexibility, one must often think outside the constraints of the SDK documentation, articles or books. My personal recommendation is to assume that anything you read (including this book) may be incorrect or woefully out of date and instead form your own personal understanding of the programming model. The surest way to understand the programming model is to focus on mastering the basic vocabulary of COM. This can only be accomplished through writing COM programs and analyzing why those programs work the way they work. Reading books, articles and documentation can help, but ultimately, dedicating the time to contemplate the four core concepts of COM (interfaces, classes, apartments and security) can only enhance your effectiveness as a COM developer. To help the reader focus on these core concepts, I have tried to include as much code as possible without explicitly providing elaborate implementations for the reader to simply copy into their own source code. To ensure that COM programming techniques are also presented in context, Appendix B contains one complete COM application that is an example of many of the concepts discussed throughout the book. Additionally, Appendix B contains a library of COM utility code that I have found useful in my own development. Some parts of this library are discussed in the book in detail, but the entire library is included as a demonstration of how to architect de facto C++ implementations. Also note that much of the code that appears in each chapter uses the C runtime library macro assert to emphasize that certain pre- or post-conditions must be met. In production code, many of these assert statements should be replaced with somewhat more forgiving error handling code. One downside of published books is that they are often obsolete by the time they arrive at the local bookstore. This book is no different. In particular, the pending release of COM+ and Windows NT 5.0 will certainly render various aspects of this book incorrect or at least incomplete. I have tried to anticipate the evolution of the model imposed by the release of Windows NT 5.0, however, at the time of this writing, Windows NT 5.0 has not yet entered its public beta cycle and all information is subject to change. COM+ promises to evolve the model even further, however, it was impossible to include COM+ coverage and still deliver my manuscript this year. I highly encourage you to investigate both Windows NT 5.0 and COM+ when they become available. One rather painful decision I had to make was how to address the various commercial libraries used to implement COM components in C++. After observing the common questions that appear on various Internet newsgroups, I elected to ignore ATL (and MFC) and instead focus on the bread-and-butter topics of COM that every developer must master irrespective of the library used. More and more developers are generating ATL spaghetti and wondering why things don't work. I firmly believe one cannot learn COM by programming in ATL or MFC. This does not mean that ATL and MFC are not useful tools for developing COM components. It simply means that they are not suited to demonstrating or learning COM programming concepts and techniques. This makes ATL inappropriate for a book focused on the COM programming model. Fortunately, most developers find that once COM is understood, the basics of ATL can be mastered in short order. Finally, the quotes that begin each chapter are a chance for me to write whatever I felt like for a small section of the book. In an effort to keep my writing as direct as possible, I restricted my wild off-topic stories to no more than 15 lines of C++ code per chapter. Usually, the code/quote represents the pre-COM approach to a problem or concept presented in the chapter. I leave it as an exercise for the reader to deconstruct my state of mind when writing a particular chapter based on these hints. Acknowledgements Writing a book is incredibly hard, at least it was for me. Two people who I know for certain suffered more than I did were my patient wife Barbara and my tolerant son Max (who prefers COM to other object models despite his youth). To both of you, thanks for tolerating my absence and generally cranky disposition while I tried to write. Fortunately, my freshly-instantiated daughter Evan was born after the bulk of this book was written and has had a fairly present and pleasant father. A related thanks goes out to all the staffers at DevelopMentor who had to cover for me when I "went dark" to crank out chapters. A lot of my early thinking about distributed systems was formed working for Tatsuya Suda at UC Irvine in the early 1990's. Tatsuya taught me how to write, how to read, and how to deal with unruly train passengers in Tokyo. Thanks and sorry. Thanks to my old office-mate Doug Schmidt for introducing me to Stan Lippman at the C++ Report. Despite Stan's rousing rejection of my first article, I first got my name in lights thanks to you two. Thanks to Mike Hendrickson and Alan Feuer at Addison Wesley for getting this project started. Thanks to Ben Ryan and John Waite for being patient. Thanks to the folks at Microsoft Systems Journal who tolerated my late submissions during the production of this book. In particular, thanks to Joanne Steinhart, Gretchen Bilson, Dave Edson, Joe Flanigen, Eric Maffei, Michael Longacre, Joshua Trupin, Laura Euler, and Joan Levinson. I promise never to be late again. Thanks to David Chappell for writing the finest book on COM available. I heartily recommend that everyone buy a copy and read it at least twice. Thanks to the CORBA and Java partisans and zealots who have engaged me in flame-wars on various Usenet newsgroups over the years. Your constant vigilance has made my own understanding of COM infinitely better. Despite the fact that I still feel many of your arguments are specious and somewhat Martian, I respect your desire to survive. Several people at Microsoft proper have been very helpful to me over the years and either directly or indirectly helped me write this book. Sara Williams was the first COM person from Microsoft I had ever met. Right after explaining that she didn't know Bill all that well, she introduced me to Gretchen Bilson and Eric Maffei at Microsoft Systems Journal as consolation. Sara has always been a great "Box Evangelist" within the big house and I am forever grateful. Charlie Kindel wrote the nice forward to my book despite his heavy schedule and exceedingly regular trips to the barber. Nat Brown was the first person to show me apartments and has irrevocably polluted my vocabulary with the word "schwing." Kraig Brockschmidt explained to me that one particular aspect of COM that looks incredibly elegant was actually a grotesque last-minute hack. Dave Reed introduced me to Viper and listens to my clams each time I visit Redmond. Pat Helland spent the entire week of TechEd 97 twisting my brain and forcing me to reexamine most of my basic assumptions about COM. Scott Robinson, Andreas Luther, Markus Horstmann, Mary Kirtland, Rebecca Norlander, and Greg Hope have been great at keeping me out of the dark. Ted Hase helped me spread the word. Rick Hill and Alex Armanasu did a great job watching my back on the technical front. Other Microsoft people who have influenced my work through their own include Tony Williams, Bob Atkinson, Craig Whittenberg, Crispin Goswell, Paul Leach, David Kays, Jim Springfield, Christian Beaumont, Mario Goertzel, and Michael Montague. The DCOM mail reflector has been a great source of inspiration and ideas for this book. Special thanks go to the following DCOM-listers: the infamous Mark Ryland, COM wunderkind Mike Nelson, Keith Brown, Tim Ewald, Chris Sells, Saji Abraham, Henk De Koenig, Steve Robinson, Anton von Stratten and Randy Puttick. The story in this book has been greatly influenced by my teaching COM at DevelopMentor for the past several years. The story has been shaped as much by the students as it has by my fellow instructors. While I wish I could thank every student personally (Addison Wesley has limited my preface to less than 20 pages), I can thank the current set of DevelopMentor-ites who have helped me refine my own understanding by teaching our Essential COM course and providing invaluable feedback: Ron Sumida, Fritz Onion, Scott Butler, Owen Tallman, George Shepherd, Ted Pattison, Keith Brown, Tim Ewald and Chris Sells. Thanks guys! Thanks also to Mike Abercrombie of DevelopMentor for creating an environment where personal growth isn't stiffled by commerce. This book would have been released considerably earlier had it not been for Terry Kennedy and friends at Software AG. Terry was nice enough to invite me to help with the DCOM/UNIX effort in Germany during the sabbatical I had initially carved out to write the book. While this book is a year late because I couldn't say no to Terry (this is my fault, not Terry's), I think that the book is infinitely better due to the time I spent working on the project. In particular, I gained many insights working with Harald Stiehl, Winnie Froehlich, Volker Denkhaus, Deitmar Gaertner, Jeff Lee, Deiter Kesler, Martin Koch, Blauer Afe, and the notorious Thomas Vogler. Finally, thanks to Shah Jehan and the Coca-Cola Corporation for fueling this effort by respectively producing the most delicious Indian food and soft drinks available. Don Box Redondo Beach, CA August 1997 4 Draft: The Component Object Model - Don Box The Component Object Model (final draft) - Don Box 5 Copyright 1997 Don Box/Addison Wesley Do not photocopy or redistribute without the express written permission of the author.

Cited By

  1. ACM
    Choe H, Baek J, Jeong H and Park S MetaService Proceedings of the 2011 ACM Symposium on Research in Applied Computation, (56-60)
  2. Trofin M, Blumhardt N and Szyperski C The .NET primitives for open, dynamic and reflective component frameworks Proceedings of the 9th international conference on Software composition, (138-153)
  3. ACM
    Cook W (2009). On understanding data abstraction, revisited, ACM SIGPLAN Notices, 44:10, (557-572), Online publication date: 25-Oct-2009.
  4. ACM
    Cook W On understanding data abstraction, revisited Proceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applications, (557-572)
  5. Carneiro G, Fortuna P and Ricardo M FlowMonitor Proceedings of the Fourth International ICST Conference on Performance Evaluation Methodologies and Tools, (1-10)
  6. ACM
    Tavares A and Valente M (2008). A gentle introduction to OSGi, ACM SIGSOFT Software Engineering Notes, 33:5, (1-5), Online publication date: 31-Aug-2008.
  7. Zaraket F, Aziz A and Khurshid S Sequential Circuits for Relational Analysis Proceedings of the 29th international conference on Software Engineering, (13-22)
  8. Lau K and Wang Z (2007). Software Component Models, IEEE Transactions on Software Engineering, 33:10, (709-724), Online publication date: 1-Oct-2007.
  9. Podorozhny R, Khurshid S, Perry D and Zhang X Verification of multi-agent negotiations using the alloy analyzer Proceedings of the 6th international conference on Integrated formal methods, (501-517)
  10. ACM
    Reitz M and Nögel U Components Proceedings of the 4th international symposium on Principles and practice of programming in Java, (153-162)
  11. ACM
    McVeigh A, Kramer J and Magee J Using resemblance to support component reuse and evolution Proceedings of the 2006 conference on Specification and verification of component-based systems, (49-56)
  12. Erlingsson Ú, Abadi M, Vrable M, Budiu M and Necula G XFI Proceedings of the 7th symposium on Operating systems design and implementation, (75-88)
  13. Lau K and Ukis V Defining and checking deployment contracts for software components Proceedings of the 9th international conference on Component-Based Software Engineering, (1-16)
  14. Lüders F, Flemström D, Wall A and Crnkovic I A prototype tool for software component services in embedded real-time systems Proceedings of the 9th international conference on Component-Based Software Engineering, (222-237)
  15. Lau K and Taweel F Towards encapsulating data in component-based software systems Proceedings of the 9th international conference on Component-Based Software Engineering, (376-384)
  16. Allan B, Armstrong R, Bernholdt D, Bertrand F, Chiu K, Dahlgren T, Damevski K, Elwasif W, Epperly T, Govindaraju M, Katz D, Kohl J, Krishnan M, Kumfert G, Larson J, Lefantzi S, Lewis M, Malony A, Mclnnes L, Nieplocha J, Norris B, Parker S, Ray J, Shende S, Windus T and Zhou S (2006). A Component Architecture for High-Performance Scientific Computing, International Journal of High Performance Computing Applications, 20:2, (163-202), Online publication date: 1-May-2006.
  17. Tansalarak N and Claypool K Finding a needle in the haystack Proceedings of the 8th international conference on Component-Based Software Engineering, (171-186)
  18. Lau K, Velasco Elizondo P and Wang Z Exogenous connectors for software components Proceedings of the 8th international conference on Component-Based Software Engineering, (90-106)
  19. ACM
    Artzi S and Ernst M Using predicate fields in a highly flexible industrial control system Companion to the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, (319-330)
  20. ACM
    Arntsen A and Karlsen R ReflecTS Proceedings of the 4th workshop on Reflective and adaptive middleware systems
  21. ACM
    Zhu L, French J and Oglesby C UbiquitousSurvey Proceedings of the 43rd annual Southeast regional conference - Volume 2, (70-74)
  22. Muskens J, Chaudron M and Lukkien J A component framework for consumer electronics middleware Component-Based Software Development for Embedded Systems, (164-184)
  23. Bondarev E, de With P, Chaudron M and Muskens J Modelling of Input-Parameter Dependency for Performance Predictions of Component-Based Embedded Systems Proceedings of the 31st EUROMICRO Conference on Software Engineering and Advanced Applications, (36-43)
  24. Hu H, Chen D and Huang C A new trust framework for resource-sharing in the grid environment Proceedings of the 5th international conference on Computational Science - Volume Part III, (221-228)
  25. Alsaid A and Mitchell C Installing fake root keys in a PC Proceedings of the Second European conference on Public Key Infrastructure, (227-239)
  26. Curbera F, Ferguson D, Nally M and Stockton M Toward a programming model for service-oriented computing Proceedings of the Third international conference on Service-Oriented Computing, (33-47)
  27. Lau K, Ornaghi M and Wang Z A software component model and its preliminary formalisation Proceedings of the 4th international conference on Formal Methods for Components and Objects, (1-21)
  28. Lau K and Wang Z A Taxonomy of Software Component Models Proceedings of the 31st EUROMICRO Conference on Software Engineering and Advanced Applications, (88-95)
  29. Blakeley J, Cunningham C, Ellis N, Rathakrishnan B and Wu M Distributed/Heterogeneous Query Processing in Microsoft SQL Server Proceedings of the 21st International Conference on Data Engineering, (1001-1012)
  30. Lüders F, Crnkovic I and Runeson P Adopting a component-based software architecture for an industrial control system Component-Based Software Development for Embedded Systems, (232-248)
  31. Henning M (2004). A New Approach to Object-Oriented Middleware, IEEE Internet Computing, 8:1, (66-75), Online publication date: 1-Jan-2004.
  32. Dolstra E, Visser E and de Jonge M Imposing a Memory Management Discipline on Software Deployment Proceedings of the 26th International Conference on Software Engineering, (583-592)
  33. Cervantes H and Hall R Autonomous Adaptation to Dynamic Availability Using a Service-Oriented Component Model Proceedings of the 26th International Conference on Software Engineering, (614-623)
  34. Norris B Software architecture issues in scientific component development Proceedings of the 7th international conference on Applied Parallel Computing: state of the Art in Scientific Computing, (629-636)
  35. Feng V, Lin Y and Chou S Design and implementation of a softswitch for third generation mobile all-IP network Wireless communications systems and networks, (359-381)
  36. Da Silva M, De C. Guerra P and Rubira C A Java component model for evolving software systems Proceedings of the 18th IEEE International Conference on Automated Software Engineering, (327-330)
  37. ACM
    Hamilton J (2019). Language integration in the common language runtime, ACM SIGPLAN Notices, 38:2, (19-28), Online publication date: 1-Feb-2003.
  38. ACM
    Hall R and Cervantes H Gravity Proceedings of the 9th European software engineering conference held jointly with 11th ACM SIGSOFT international symposium on Foundations of software engineering, (379-382)
  39. ACM
    Hall R and Cervantes H (2003). Gravity, ACM SIGSOFT Software Engineering Notes, 28:5, (379-382), Online publication date: 1-Sep-2003.
  40. Schantz R, Loyall J, Rodrigues C, Schmidt D, Krishnamurthy Y and Pyarali I Flexible and adaptive QoS control for distributed real-time and embedded middleware Proceedings of the ACM/IFIP/USENIX 2003 International Conference on Middleware, (374-393)
  41. Dutka Ł and Kitowski J Flexible component architecture for information web portals Proceedings of the 1st international conference on Computational science: PartI, (629-638)
  42. Li J Monitoring and Characterization of Component-Based Systems with Global Causality Capture Proceedings of the 23rd International Conference on Distributed Computing Systems
  43. ACM
    Emmerich W Distributed component technologies and their software engineering implications Proceedings of the 24th International Conference on Software Engineering, (537-546)
  44. ACM
    Emmerich W and Kaveh N Component technologies Proceedings of the 24th International Conference on Software Engineering, (691-692)
  45. ACM
    Gordon A and Pucella R Validating a Web service security abstraction by typing Proceedings of the 2002 ACM workshop on XML security, (18-29)
  46. ACM
    Brunsch D, O'Ryan C and Schmidt D (2019). Designing an Efficient and Scalable Server-side Asynchrony Model for CORBA, ACM SIGPLAN Notices, 36:8, (223-229), Online publication date: 1-Aug-2001.
  47. ACM
    Brunsch D, O'Ryan C and Schmidt D Designing an Efficient and Scalable Server-side Asynchrony Model for CORBA Proceedings of the ACM SIGPLAN workshop on Languages, compilers and tools for embedded systems, (223-229)
  48. ACM
    Brunsch D, O'Ryan C and Schmidt D Designing an Efficient and Scalable Server-side Asynchrony Model for CORBA Proceedings of the 2001 ACM SIGPLAN workshop on Optimization of middleware and distributed systems, (223-229)
  49. ACM
    Emmerich W and Kaveh N Component technologies Proceedings of the 8th European software engineering conference held jointly with 9th ACM SIGSOFT international symposium on Foundations of software engineering, (311-312)
  50. ACM
    Emmerich W and Kaveh N (2001). Component technologies, ACM SIGSOFT Software Engineering Notes, 26:5, (311-312), Online publication date: 1-Sep-2001.
  51. ACM
    Ostermann K and Mezini M Object-oriented composition untangled Proceedings of the 16th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, (283-299)
  52. ACM
    Ostermann K and Mezini M (2019). Object-oriented composition untangled, ACM SIGPLAN Notices, 36:11, (283-299), Online publication date: 1-Nov-2001.
  53. Weerawarana S, Curbera F, Duftler M, Epstein D and Kesselman J Bean markup language Proceedings of the 6th conference on USENIX Conference on Object-Oriented Technologies and Systems - Volume 6, (13-13)
  54. Karsai G, Ledeczi A, Sztipanovits J, Peceli G, Simon G and Kovacshazy T An approach to self-adaptive software based on supervisory control Proceedings of the 2nd international conference on Self-adaptive software: applications, (24-38)
  55. ACM
    Emmerich W Software engineering and middleware Proceedings of the Conference on The Future of Software Engineering, (117-129)
  56. ACM
    Rausch A Software evolution in componentware using requirements/assurances contracts Proceedings of the 22nd international conference on Software engineering, (147-156)
  57. ACM
    Jackson D and Sullivan K COM revisited Proceedings of the 8th ACM SIGSOFT international symposium on Foundations of software engineering: twenty-first century applications, (149-158)
  58. ACM
    Jackson D and Sullivan K (2019). COM revisited, ACM SIGSOFT Software Engineering Notes, 25:6, (149-158), Online publication date: 1-Nov-2000.
  59. Jørgensen B, Truyen E, Matthijs F and Joosen W Customization of object request brokers by application specific policies IFIP/ACM International Conference on Distributed systems platforms, (144-163)
  60. Yoon I, Kim H, Bae D and Youn C Reliable Transaction Design Using MTS 24th International Computer Software and Applications Conference, (357-362)
  61. ACM
    Yakimovich D, Bieman J and Basili V Software architecture classification for estimating the cost of COTS integration Proceedings of the 21st international conference on Software engineering, (296-302)
  62. ACM
    Roodyn N and Emmerich W An architectural style for multiple real-time data feeds Proceedings of the 21st international conference on Software engineering, (564-572)
  63. ACM
    Emmerich W and Roodyn N Distributed objects Proceedings of the 21st international conference on Software engineering, (665-666)
  64. Schmidt D Middleware Techniques and Optimizations for Real-Time, Embedded Systems Proceedings of the 12th international symposium on System synthesis
  65. Wang Y and Chung P (1998). Customization of Distributed Systems Using COM, IEEE Concurrency, 6:3, (8-12), Online publication date: 1-Jul-1998.
Contributors
  • Microsoft Corporation
  • IBM Research

Recommendations