Click here to Skip to main content
Click here to Skip to main content

.NET and COM: The Complete Interoperability Guide

, 24 May 2003
Rate this:
Please Sign up or sign in to vote.
Book Review of .NET and COM: The Complete Interoperability Guide

Editorial Note

This article is in the Book Review chapter. Reviews are intended to provide you with information on books - both paid and free - that others consider useful and of value to developers. Read a good programming book? Write a review!

<STYLE type=text/css> .grade {font-size:7pt} </STYLE>
Title .NET and COM: The Complete Interoperability Guide
Author Adam Nathan
Publisher Sams Publishing
Published January 2002
ISBN 067232170x
Price USD 59.99
Pages 1578

The .NET Framework SDK and Visual Studio .NET make it easy to use legacy COM components from .NET-based code (also referred to as managed code). The Framework does a lot of work for you by abstracting the differences between the unmanaged world of COM and the managed world of .NET through interception. Interception occurs in a piece of code referred to as the Runtime-Callable Wrapper (RCW) whose role is to seamlessly integrate the .NET and COM worlds so that they can peacefully coexist. For example, COM components report an error using a special return value that is an HRESULT data type. Your managed (.NET-based) application errors to be reported as exceptions and is unaware of the HRESULT data type. The RCW converts failure-related HRESULTs codes (codes other than the S_OK success code and user-defined HRESULTs) into equivalent .NET exceptions providing a programming model that's consistent with the rest of the .NET programming environment. When a COM component returns a user-defined HRESULT, the RCW maps it into a System.Runtime.InteropServices.COMException and stores the HRESULT value in the exception's ErrorCode property - again providing .NET applications with a consistent programming model that makes it easy to detect and respond to error conditions.

That's only a very small part of the .NET and COM interoperability story - this book covers the rest of it in great detail in an engaging way that brings some kick to a perhaps seemingly boring topic. Among the engaging aspects of this book are the "Digging Deeper", "Tip", and other notes that sprinkled throughout which provide valuable insights to the discussion at hand.

.NET and COM weighs in at 1578 pages with about 1245 pages of content, 250 pages of appendices, and 81 pages taking up the comprehensive index (all page counts are approximate since the book includes separator pages between sections and chapters). The book's content is packed with practical information in the form of guidance and detailed information right from the first page. However, the sheer density of the information makes it easy to miss important points such as the author's recommendations on how to version .NET components (assemblies) to make it easy for COM-based clients to use them in the unmanaged world.

The book is divided into nine sections:

  • Background
  • Using COM Components in .NET Applications
  • Using .NET components in COM Applications
  • Designing Great .NET Components for COM Clients
  • Designing Great COM Components for .NET Clients
  • Platform Invocation Services
  • Advanced Topics
  • Comprehensive Examples
  • Appendices

Each section builds on it predecessors' but not all readers may agree with the organization. I personally would have preferred the Designing sections to appear before the Using sections since good design is essential to easy use. Although most readers will likely read the book in the order it's presented in, the book is organized to make it easy to hop around from section to section of interest without getting lost.

Although this is a great book, there are a couple of drawbacks:

Serviced components, also known as COM+ components, are given less than 10 pages of coverage throughout the book. Granted that COM+ sounds like it provides services only to COM components, it does play an important role in the managed world of .NET applications. In fact, COM+ is so important to .NET that there are an entire set of classes and attributes available in a dedicated namespace called System.EnterpriseServices. COM+ provides services that extend .NET applications' abilities over those provided by basic .NET.

The second drawback relates to how some important information gets disbursed throughout the entire book rather than just one place. For example, when you create a .NET component that will be used by COM clients, you have the option of using one of three attributes to expose the .NET component's interface to COM. The fist time this feature is mentioned is in chapter three on page 397 where, if you read to the end of the "FAQ" box, you'll see a reference to chapter 12 where more information on the topic appears on page 556. What's interesting is that one of the most critical points appears in one of two "Caution" notes making it difficult to see that there's something really important on the page. In addition, some more information appears, along with some of the text from chapter 12, much later in appendix A (on page 1257) with a reference back to chapter 12. All of these references and presentation styles work to dilute the importance of the information and effectively hide it from novice readers (those that are new to .NET, COM, or both).

Despite these few drawbacks, this is a great book for intermediate .NET developers that have some experience with COM can benefit from. The book's scope makes this book useful for developers that work on both COM-centric and .NET-centric environments.

Grades:

Overall Value 5
Accuracy 5
Depth 5
Readability 4
Organization 4
Grade A-

Calculate the Grade as follows: Add all numeric grade values, divide by 25, multiply by 100, then assign the letter grade based on the following ranges:

A+:100 A :95 A-:90 B+:85 B:75 B-:70 C+:65 C :60 C-:50 D+:40 D :30 D-:25 F Blush | :O

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Erik Westermann
Software Developer (Senior)
Canada Canada
Erik is a senior developer-writer with more than 14 years professional programming experience designing and developing large scale database and Internet-centric applications for organizations including MSN.ca, ADP, Nortel, lemontonic.com, EDS, Merrill Lynch, ePost, CIBC, TD Securities, IBC, CIHI, InnovaPost, etc.
 
Erik has been specializing in BizTalk Server-based solutions for five contiguous years to date. His experience includes many SOA and ESB-style applications using technologies like Commerce Server, SharePoint, ASP.NET and advanced .NET Framework.
 

Erik's interests include systems architecture, writing, reading and his kids. Erik's affiliations include ACM (acm.org), and the IASA.

Comments and Discussions

 
QuestionCOM & .NET Pinmembersangram3609-Mar-12 21:55 
QuestionStarting COM programming PinmemberTheEagle17-May-06 4:51 
GeneralPages PinmemberMaximilian Hänel26-May-03 5:05 
GeneralRe: Pages PinmemberErik Westermann26-May-03 17:23 
GeneralRe: Pages PinmemberMaximilian Hänel27-May-03 13:58 
GeneralRe: Pages PinmemberErik Westermann28-May-03 0:48 
GeneralIncorrect Author PinmemberRichard Birkby26-May-03 3:06 
GeneralRe: Incorrect Author PinmemberRoger J26-May-03 3:56 
GeneralRe: Incorrect Author PinmemberErik Westermann26-May-03 3:58 
Woops Blush | :O I have corrected the author's name.
 
Erik Westermann

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 25 May 2003
Article Copyright 2003 by Erik Westermann
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid