Designing applications can be a daunting task. Even the simplest of utilities can present obstacles and issues unforeseen. Enterprise-level, distributed applications present problems on a greater scale: security (authentication and authorization), distributed transactional support, object pooling, JIT, just to name a few. Trying to roll your own infrastructure to support these features reliably is extrememly difficult - go ahead and try. I think every developer has tried to implement some of these features at least to some degree. But trying to harness all of these capabilities, especially when they already exist, is asinine and a fool's quest.
Over the past several months, I have been asked repetitively by various individuals (both coworkers as well as friends and associates) whether COM+ is a thing of the past. I've been told that Microsoft is no longer investing in COM+ services and that it's been deprecated; that Enterprise Services (aka COM+ in the .NET world) is just a COM-interop layer over the actual COM+ implementation provided by the OS. These statements couldn't be further from the truth. Enterprise Services is alive and kicking.
As Brian Noyes points out in his blog post, there are a lot of misconceptions about the positioning of Enterprise Services with respect to developing solutions with .NET. It is frequently viewed as a thing of the past and therefore legacy software that doesn't really have a place in modern software development. When Microsoft developed COM+ (which, in its inception was Microsoft Transation Server (MTS) and part of the Windows NT 4.0 Option Pack) they were very forward-looking and to their credit succeeded admirably. If you take the time to read Microsoft's Prescriptive Architecture Guidance (PAG), you'll see that even today in the building of distributed, n-tier applications we are encouraged to use Enterprise Services.
One of the reasons I've heard that discourages its use is the whole COM-interop thing. There are really two ways in which a COM+ application can run: as a Library application or a Server application.
When a component is a Library application, it runs in-process with the caller. If you've developed your COM+ component in .NET there is no interop at all. All calls to your COM+ component are direct, managed C++ calls to the subsystem - this will be very fast, just involving a context switch.
When a component is a Server application, then yes, COM-interop enters the picture. A Runtime Callable Wrapper (RCW) is created. It is through this proxy that calls to the object occur. All in all, this overhead is minimal especially when compared to what the actual function will probably be doing.
With respect to the future, however, is COM+ going away? Is Microsoft abandoning their flagship component server? I think not. When you look at what is up and coming such as Indigo it might appear that COM+ is going by the wayside, in preference to this newer technology. In fact, COM+ is being enhanced to support calls to an from Indigo for a seamless interoperation in the Longhorn timeframe.
Basically, when it comes down to it, we are still being encouraged to use Enterprise Services in the back-end as the service provider for our applications, inside the service boundaries. Usually, the recommendation is that the service boundary be actually implemented via another mechanism such as Web Services (eg: ASMX, WSE).
Enterprise Services offer many other benefits that I haven't mentioned here, but I believe that many developers are afraid to embrace the technology for fear of the complexity and breadth of its coverage. Sure, COM+ can be a bit daunting. It isn't simple, but as developers it is our responsibility to learn about the various technologies and apply them where they best fit. I'm convinced that by using COM+ properly our applications will be better prepared for the today as well as for the future.
A few months ago I had the privilege of presenting a talk to our local .NET User Group regarding component development in COM+. Check out the presentation.
---
Update 06/17/2004:
Some helpful COM+/Enterprise Services links:
GotDotNet COM+ FAQ
DCOM deserves our respect
.NET Enterprise Services Performance
Enterprise Architecturing II