COM Objects

COM Interfaces

COM objects expose their functionality through an interface mechanism. A COM object's interface provides a pointer, or memory location, to functions that clients call to access the functionality provided by the COM object. This interaction between a user of an object's services (the client) and the implementor of that object and its services (the server) is known as a contract . The services are known as methods or member functions.

The contract between software components defines:

  • A unique identifier to distinguish each interface.
  • The location of the functions in the interface.
  • The purpose of the function.
  • The arguments and return values to each function.

The contract is not intended to define:

  • How to implement the function.
  • The code behind the function.
  • The language used to create the object.
  • The platform that the object runs on.

An interface is not an object, nor is it an object class (a definition of an object). Interfaces are abstract classes that you should design so that they can be reused in a variety of contexts. For example, a simple interface for generically reading and writing streams of data can be reused by many different types of objects and clients.



Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

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