On Microsoft platforms COM is an excellent way to integrate components. For integration with systems not based on such platforms, see the communications section.
Carapace is designed to make COM easier to use so the design of a Carapace object closely follows that of a COM object.
This topic is intended to give you a basic understanding of COM. For a fuller understanding, see the references page.
This page answers the following questions about COM:
These are summarised here.
COM is all about objects and getting them to communicate with each other. Within COM, objects take on one or both of the following roles:
| client | the client asks the server to perform tasks |
|---|---|
| server | the server performs tasks requested by the client |
A server can itself be a client, since it might get another server to perform a task.
COM is a system which allows a client to create a server (if no such server currently exists) and then allows these to communicate together. The client and server can be on the same machine or even on different machines.
Every communication with a COM object is via an interface which is simply a grouping of methods and properties. A COM object can support one or more interfaces. Simple COM objects can be linked together via matching pairs of interfaces to form complex objects.
A COM object is like a building block -- some blocks offer more functionality than others, and new blocks can be created from joining other blocks together.
COM creates a server when a client requests one -- COM will re-use an existing server if possible.
Servers must be registered with COM so that COM knows how to start them up at a client's request.
COM uses GUIDs (short for Globally Unique IDentifiers) to identify almost everything! A GUID looks quite formidable e.g.
{C147DE31-8BA6-11d3-8180-0050048C7269}
but it is simply a label -- nothing more.
COM's view of an object is rather different from most computer languages since the idea of an interface is fundamental to COM.
A COM object is like a house which contains multiple rooms -- each room is for a different purpose and you can only do certain actions within each room (e.g. you can't have a shower in the kitchen). A COM object is like the house and a COM interface is like a room. You can move from one interface to another, but you can only do a given set of actions on any particular interface.
An interface is simply a suite of methods and properties owned by the object. An object can have multiple such interfaces.
Carapace gives you easy access to COM objects.
To use third party COM components, see the section on being a COM Client.
To write your own COM components, see the section on COM Servers.
This documentation also describes the built-in classes and functions within Carapace to support COM.
| Contents | Index | Current topic: COM | Related Links: COM helpers, objects |