1 / 19

Microsoft’s Distributed Component Object Model (DCOM)

Microsoft’s Distributed Component Object Model (DCOM). A semi-technical overview. Jim Ries JimR@acm.org 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)

una
Download Presentation

Microsoft’s Distributed Component Object Model (DCOM)

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microsoft’s Distributed Component Object Model (DCOM) A semi-technical overview Jim Ries JimR@acm.org Updated 10/5/1999

  2. 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

  3. 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/

  4. 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

  5. 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.

  6. 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”)

  7. 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.

  8. 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.

  9. 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.)

  10. Coding Tools • C - Raw • C++ - Raw • C++ - ATL • C++ - MFC • Visual Basic • J++ (pseudo Java) • Binary standard ==> any language COULD produce COM components.

  11. Platforms • Win32 • Windows 95 (DCOM as separate download; included in OSR2) • Windows NT 4.0 • Windows 98 • Windows 2000 • Unix platforms (with some help)

  12. Nuts and Bolts • CoInitialize() • CoCreateInstance() • IUnknown • QueryInterface() • AddRef() • Release() • CoUninitialize()

  13. Demonstration - IDL [ object, uuid(75D873CD-7B63-11D3-9D43-00C0F031CDDE), helpstring("IServer Interface"), pointer_default(unique) ] interface IServer : IUnknown { HRESULT Hello([in, string] char * pszMessage); };

  14. 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); }

  15. 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); }

  16. Distributed Scenario • From “DCOM Architecture” a Microsoft white paper.

  17. Demonstration • Run DCOM “Hello world” demo here.

  18. 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.

  19. 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

More Related