The Drawbacks of COM

Snoops

   

 
Migrating to .NET: A Pragmatic Path to Visual Basic .NET, Visual C++ .NET, and ASP.NET
By Dhananjay  Katre, Prashant  Halari, Narayana  Rao  Surapaneni, Manu  Gupta, Meghana  Deshpande

Table of Contents
Chapter 10.   Dealing with Legacy Components in .NET


COM is a major leap toward the code reusability. More than code reusability, COM promotes what we call functionality reuse. It's almost language neutral. The next phase of COM is COM+ Services. With Windows NT 4.0 we used to have the MTS to provide transactional support. We needed to specially program our applications for MTS. However, in Windows 2000 servers, this capability is built into the operating systems and hence provided by the COM environment, which Microsoft calls COM+ Services.

There are many companies that have relied extensively on this technology and gained huge profits and other benefits. In spite of its success story, COM has certain limitations, as follows :

  • No true code reusability . COM has limited support for true code reusability. Under the COM technology we are able to use code functionality but do not have true code reuse. This means that one can't inherit the code written for one DLL into another, override it, and extend the functionality. However, when required, one can use the functionality written in one DLL in another.

  • Global access . When we install COM on a machine, the same component can be used by all the applications running on that machine. When we register a COM component, the system makes an entry into the commonly shared location called Windows Registry and another entry anywhere on the disk. Making an entry at the common location has led to many technical problems such as versioning, maintenance, server restarts.

  • Complexity . COM relies extensively on different threading models. The efficiency of its working in most cases also is dependent on the threading model we use for designing a component. This leaves us with a big void; we have to know which operating system supports which threading models and how to ensure both backward and forward compatibility so that the component can be used across all platforms, without loss of efficiency.

  • Usage across different platforms . Theoretically, we can use any language to design a COM component. Practically, however, there are many problems in porting across different platforms. A component developed using Visual Basic for ASP applications works well on almost all Windows platforms. But a problem creeps in when we try to port the ASP applications to other platforms. In most cases, we need to rewrite the code using C++. This is exactly what happens when you try to use Chilli ASP to port ASP applications on Windows to other platforms.

  • Problems with different Microsoft languages . Microsoft has many proprietary languages such as Visual Basic, Visual C++, and VJ++ (Windows foundation classes). If you look at the APIs used by these different languages, they differ to a great extent. There is no common uniform library to develop the same sort of applications. This has put a burden on programmers to learn all these types of API and integrate the applications.

  • Versioning problems (DLL hell) . A problem with COM components is version maintenance. Many times, the newer versions of the same COM component overwrite its earlier version.

  • IIS server restarts . Whenever we register COM components to be used within ASP applications we need to restart the IIS server for the changes to take effect. This is one of the limitations because we need to bring down the site each time we want a change to take effect.


Snoops

   
Top


Migrating to. NET. A Pragmatic Path to Visual Basic. NET, Visual C++. NET, and ASP. NET
Migrating to. NET. A Pragmatic Path to Visual Basic. NET, Visual C++. NET, and ASP. NET
ISBN: 131009621
EAN: N/A
Year: 2001
Pages: 149

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net