The Future of COM

The Future of COM

by Dan Dudovitz December 16, 2009 08:47

I was standing in line at the registration desk for the 2005 PDC in Los Angeles behind two developers deeply engrossed in conversation about the future of Microsoft technology. One of the developers was adamant that COM was dead and that all technology moving forward would be in .NET. I chuckled to myself realizing that these two developers had no real understanding of the role COM played (and continues to play) in .NET. In fact, COM is so deeply embedded in the .NET core and the Windows O/S that you can’t really talk about .NET without talking about COM.

Fast forward to the PDC 2009 where the future is full of buzzwords like Azure, cloud computing, WPS, DirectX 3D, XAML, Windows 7 UI and so forth. In the world painted by these two programmers one would believe that any last vestiges of COM are a long distant memory.

Nothing could be further from the truth!

In fact, not only is COM still a major technology on which the future of .NET is laid upon, but the .NET interfaces are little more than COM InterOp wrappers. Moreover, C++ is still considered an important method for writing and deploying the new functionality.

What does this mean to developers?

We cannot architect and design new systems without taking into account the impact of unmanaged code. Issues such as object lifetime, concurrency, remoting, marshaling and other plumbing and glue affect how systems are designed and even optimized. What should have been a straightforward task is now complicated by having to support the managed and unmanaged world.

It gets worse…

The other subliminal message that was imparted to developers was that there would be no new support for managed C++ development. The impact of this is huge, but may not be fully grasped until you realize that the only avenue for porting and supporting C++ code is COM! More than one speaker at the PDC said that no effort was put into supporting managed C++ in this current release (VS 2010 and .NET 4.0).

Developers can of course opt out of C++ development by implementing new COM object s in C# as CCW objects. That approach, however, does not address consuming COM objects (or their .NET wrapped counterparts) exposed by the operating system. All new DirectX (on which WPF sits on top of), Windows 7 UI enhancement, motion and input libraries are deployed as COM objects.

What should developers do?

1.       Review the basics of the tao of COM. Understanding how reference counted objects behave in a managed environment is key to developing robust systems.

2.       Review the fundamentals of COM InterOp and how the managed world interacts with the unmanaged world.

3.       Review P/Invoke mechanisms and how objects are marshaled between the managed and unmanaged world.

4.       When developing system avoid brittle dependencies and assumptions how objects are created, maintained and destroyed.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , , , ,

Dan's Blog

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen | Modified by Mooglegiant

Featured Contributors

RSS Feeds

Month List

Links

automation.com: Product announcements, newsletters, case studies and other useful resources for those in the industrial automation industry.