Apr 26, 2008

DCOM

DCOM

Using DCOM, two objects on two separate computers are able to call each other's methods. Applications are treated as objects by the operating system. The operating system supports DCOM with:

  • Holds the objects in memory.
  • Manages the objects by creating them or removing them in or from memory.
  • Marshaling is suppported by the operating system which allows data to be sent serially.

Other COM/DCOM object characteristics:

  • Objects are not linked to applications
  • Objects perform garbage collection on themselves.
  • The COM object can be queried by the application to determine provided functions by the object.
  • COM objects can be written in any language.

DCOM Support

  • Uses Object Remote Procedure Call (ORPC) which is based on RPC.
  • DCOM servers are used to serve objects.
  • More than one interface can be used to access a given object.

The IDispatch interface is implemented by all COM objects. The IDispatch interface is used to obtain the COM object's interface(s).

Interface Design Language (IDL) Interface

There is an Interface Design Language for COM objects. The IDL is required to specify a set of criteria which all COM objects must abide by in order to work within the COM environment. This is effectivel a type of protocol. Without the IDL, COM objects could not obtain an interface to another object nor invoke remote methods of those objects.

Some IDL Requirements:

  • The IDispatch interface is implemented by all COM objects.
  • The IDispatch interface is used to obtain the COM object's interface(s).
  • The I(Objectname) interface is associated with an object class.
  • A Universally Unique IDentifier (UUID) is assigned to each interface. This is the interface ID (IID).
  • Each class has a class ID (CLSID).

Operation

The DCOM client does the following to run a remote object's method.

Get a pointer to the server object using a statement similar to that which follows where Objectname is the name of the remote object:

IObjectname Objectname = (IObjectname)new simplestocks.Objectname();

Internally, the server will return the IUnknown pointer which is cast to the IObjectname interface

No comments:

Post a Comment

Popular Posts