COM : Fundamentals
COM
- COM is a specification
- It specifies how to build components that can be dynamically interchanged.
- COM provides the standard that components and clients follow to ensure that they can operate together.
- The COM specification is a document that sets the standard for the component architecture.
What are COM Components?
- COM component consists of executable code distributed either as Win32 dynamic link libraries (DLLs) or as executables (EXEs).
- Components written to the COM standard meet all requirements for component architecture.
- COM components link dynamically using DLLs.
- COM components can be encapsulated easily because:
o COM components are fully language independent. They can be developed using almost any procedural language Ada to C to Java to Modula-3 to Oberon to Pascal.
o Any language can be modified to use COM components, including Smalltalk and Visual Basic.
o COM components can be shipped in binary form.
o COM components can be upgraded without breaking old clients. Because it provides a standard way to implement different versions of a component.
o COM components can be transparently relocated on a network. A component on a remote system is treated the same as a component on the local system.
- COM components announce their existence in a standard way. Using COM’s publication scheme, clients can dynamically find the components they need to use.
- COM components are a great way to provide object-oriented APIs or services to other applications.
- COM components are also great for building language-independent component libraries from which applications can be rapidly built.
COM is not…
- COM is not a computer language.
- COM does not compete with computer languages.
- COM tells how to write components.
- COM also does not compete with or replace DLLs.
- COM uses DLLs to provide components with the ability to dynamically link.
- COM is not primarily an API or a set of functions like the Win32 API.
- COM does not provide services such as MoveWindow or the like.
- COM is not a C++ class library like the Microsoft Foundation Classes (MFC).
- COM provides a way to develop language-independent component libraries, but COM does not provide any implementation.
The COM Library
- COM has an API, the COM library, which provides component management services that are useful for all clients and components.
- Most of the functions in the API are not too difficult to implement when developing COM-style components on a non-Windows system.
- The COM library was written to guarantee that the most important operations are done in the same way for all components.
- The COM library also saves developers time implementing their own components and clients.
- Most of the code in the COM library is support for distributed or networked components.
- The Distributed COM (DCOM) implementation on Windows System provides the code needed to communicate with components over a network.
- This reduces to write the networking code.