microsoft s distributed component object model dcom
Download
Skip this Video
Download Presentation
Microsoft’s Distributed Component Object Model (DCOM)

Loading in 2 Seconds...

play fullscreen
1 / 19

Microsoft s Distributed Component Object Model DCOM - PowerPoint PPT Presentation


  • 449 Views
  • Uploaded on

Microsoft’s Distributed Component Object Model (DCOM). A semi-technical overview. Jim Ries [email protected] Updated 10/5/1999. Genealogy. DCOM comes from COM and OSF (now Open Group ) DCE DCE Remote Procedure Calls (RPC) Interface Definition Language (IDL) Component Object Model (COM)

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Microsoft s Distributed Component Object Model DCOM' - una


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
microsoft s distributed component object model dcom

Microsoft’s Distributed Component Object Model (DCOM)

A semi-technical overview

Jim Ries

[email protected]

Updated 10/5/1999

genealogy
Genealogy
  • DCOM comes from COM and OSF (now Open Group) DCE
    • DCE
      • Remote Procedure Calls (RPC)
      • Interface Definition Language (IDL)
    • Component Object Model (COM)
    • ORPC
  • OMG CORBA - a parallel standard
    • Different RPC
    • Different IDL
    • COM proxy == CORBA stub
    • COM stub == CORBA skeleton
microsoft proprietary but
Microsoft proprietary, but . . .
  • Open Group’s COMSource: http://www.opengroup.org/comsource/
  • Software AG’s EntireX: http://www.softwareag.com/entirex/default.htm
  • The Active Group: http://www.activex.org/
com goals
COM Goals
  • Encapsulation (separate implementation from interface)
  • Versioning
  • Execution context independence
  • Language independence
  • Object Creation / Lifetime Control
  • Standard error code (HRESULT)
  • Solve object discovery problem
  • Scripting
  • The Holy Grail of Reuse
alphabet soup com ole activex
Alphabet soup:COM/OLE/ActiveX
  • COM is a binary standard and a style for creating objects.
  • OLE is (was) a set of COM interfaces for embedding documents (originally “Object Linking and Embedding”).
  • ActiveX is a marketing buzz-word meaning COM and/or OLE, but usually applied to Internet-oriented components.
later and later binding
Later and later binding
  • “Editor inheritance” binds at compile time.
  • Link libraries (.LIB) bind to “components” at link time.
  • Dynamic link libraries (.DLL) bind at run time, but need a header at compile time, and path at runtime.
  • COM components bind at runtime and may need neither a header, nor a path! (though typelib contains header-like “meta-data”)
interfaces
Interfaces
  • COM enforces the concept of interfaces being separate from implementation.
  • Interface == Abstract Base Class
  • Objects support multiple interfaces through multiple inheritance.
  • Interfaces NEVER change!
  • A “control” is just a COM component with the right interfaces.
guid s or uuid s
GUID’s (or UUID’s)
  • Globally Unique Identifiers (Universally Unique Identifiers)
  • Needed to avoid name collisions
  • A class is associated with a GUID (CLSID).
  • An interface is associated with a GUID (IID).
  • The Windows Registry: a hierarchical database.
execution context
Execution Context
  • In proc - DLL’s (no marshalling)
  • Out of proc - EXE’s (LRPC)
  • Remote - EXE’s using DCOM
    • RPC
    • DCE “compatible” (see “Interconnecting Personal Computers with the Distributed Computing Environment” by Jim Ries, UMC Thesis, 1998.)
coding tools
Coding Tools
  • C - Raw
  • C++ - Raw
  • C++ - ATL
  • C++ - MFC
  • Visual Basic
  • J++ (pseudo Java)
  • Binary standard ==> any language COULD produce COM components.
platforms
Platforms
  • Win32
    • Windows 95 (DCOM as separate download; included in OSR2)
    • Windows NT 4.0
    • Windows 98
    • Windows 2000
  • Unix platforms (with some help)
nuts and bolts
Nuts and Bolts
  • CoInitialize()
  • CoCreateInstance()
  • IUnknown
    • QueryInterface()
    • AddRef()
    • Release()
  • CoUninitialize()
demonstration idl
Demonstration - IDL

[

object,

uuid(75D873CD-7B63-11D3-9D43-00C0F031CDDE),

helpstring("IServer Interface"),

pointer_default(unique)

]

interface IServer : IUnknown

{

HRESULT Hello([in, string] char * pszMessage);

};

demonstration server code
Demonstration - Server Code

// Prototype

class CServer :

public IServer, public CComObjectRoot, public CComCoClass<CServer,&CLSID_Server>

{

// . . . Some code omitted for brevity

// IServer

public:

HRESULT STDMETHODCALLTYPE Hello(unsigned char * pszMessage);

};

// Code

HRESULT STDMETHODCALLTYPE CServer::Hello(unsigned char * pszMessage)

{

char szBuf[256];

wsprintf(szBuf,"%s",pszMessage);

::MessageBox(0,szBuf,"Server",MB_OK);

return(S_OK);

}

demonstration client code
Demonstration - Client Code

if (SUCCEEDED(

hr=CoCreateInstance(CLSID_Server,NULL,

CLSCTX_LOCAL_SERVER,

IID_IServer,(void **)&pServer)))

{

if (SUCCEEDED(hr=pServer->Hello((unsigned char *)"Hello from the client")))

MessageBox("Client: Server printed the message");

else

{

wsprintf(szBuffer,"Hello() method failed: 0x%lX.\n",hr);

MessageBox(szBuffer);

}

pServer->Release();

}

else

{

wsprintf(szBuffer,"Unable to create a server: 0x%lX.\n",hr);

MessageBox(szBuffer);

}

distributed scenario
Distributed Scenario
  • From “DCOM Architecture” a Microsoft white paper.
demonstration
Demonstration
  • Run DCOM “Hello world” demo here.
additional technologies
Additional Technologies
  • COM+
    • MTS - Microsoft Transaction Server
    • MSMQ - Microsoft Message Queue
    • Compiler supported IUnknown, etc.
  • ADS - Active Directory Service
    • As “distributed registry”
    • As namespace abstraction
  • All Microsoft products are COM based:
    • IIS - Internet Information Server
    • Exchange
    • Internet Explorer
    • Word, Excel, etc.
references
References
  • Microsoft DCOM page
  • IETF DCOM Standard Proposal
  • Inside OLE by Kraig Brockschmidt, Microsoft Press, 1995.
  • Essential COM by Don Box, Addison Wesley, 1998.
  • Inside COM by Dale Rogerson, Microsoft Press, 1997.
  • Don Box homepage
  • ActiveX COM Control Programming by Sing Li and Panos Economopoulos, Wrox Press, 1997.
  • COM-CORBA Interoperability by Geraghty, et. al., Prentice Hall, 1999.
  • Microsoft Developer Network
ad