DCOM-CORBA Comparison Operating Systems II Reference: P. Chung et al., DCOM and CORBA: side by side, step by step,and layer by layer, C++ Report.

Slides:



Advertisements
Similar presentations
COM vs. CORBA.
Advertisements

RMI Varun SainiYing Chen. What is RMI? RMI is the action of invoking a method of a remote interface on a remote object. It is used to develop applications.
II. Middleware for Distributed Systems
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
15-May-15 RMI Remote Method Invocation. 2 “The network is the computer” Consider the following program organization: If the network is the computer, we.
Interoperability Kathleen Fisher. Why is interoperability important? Write each part of a complex system in a language well-suited to the task: –C for.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Intro to COM What is it and how do I use it?. Objectives Teach the fundamentals of COM. Understand the reason for using it. Learn to make a simple in-process.
CS514: Intermediate Course in Operating Systems Professor Ken Birman Ben Atkin: TA Lecture 16 Oct. 19.
AP 01/01 Asynchronous Calls Standard COM+ model is completely synchronous –Emulates standard procedure calls –Problematic in distributed scenarios with.
1 Advanced Programming Topics - II Objectives:  Background  Remoting  Types of remoting  Marshalling  Farmatters  Channels.
A brief look at CORBA. What is CORBA Common Object Request Broker Architecture developed by OMG Combine benefits of OO and distributed computing Distributed.
Hadar Vorenshtein & Meital Levy Instructor yavgeni Rivkin.
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
Communication in Distributed Systems –Part 2
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 4: RPCs vs. CORBA Dr. Michael R. Lyu Computer Science & Engineering.
DCOM Technology. What is DCOM? DCOM is just COM with a longer wire DCOM is just COM with a longer wire DCOM extends COM to support communication among.
DCOM Technology Şevket Duran Haşim Sak.
Common Object Request Broker Architecture (CORBA) CS-328.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
CSIS0402 System Architecture Distributed Computing - Middleware Technology (2) K.P. Chow University of Hong Kong.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
COM vs. CORBA Computer Science at Azusa Pacific University September 19, 2015 Azusa Pacific University, Azusa, CA 91702, Tel: (800) Department.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Microsoft’s Distributed Component Object Model (DCOM) Jim Ries Updated 10/5/1999 A semi-technical overview.
COM/DCOM Implementation Basics of: Object creation and access Object Reuse Interface referencing.
COM and DCOM CS 562 February 27, Motivation Data Analyzer Resource Monitor int compute (…) { } int compute (…) { } Data Analyzer int compute (…)
CS 603 DCOM April 5, DCOM – What is it? Start with COM – Component Object Model –Language-independent object interface Add interprocess communication.
Distributed Processing and Client/Server
COMCOM omponent bject odel After this presentation, you will: Be Able To: Conceptual understanding of COM How it works, What it’s used for Decode Acronyms.
1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. With Thanks to.
Information Management NTU Interprocess Communication and Middleware.
11 September 2008CIS 340 # 1 Topics To examine the variety of approaches to handle the middle- interaction (continued) 1.RPC-based systems 2.TP monitors.
1 of of 25 3 of 25 ORBs (Object Request Broker) – A distributed software bus for communication among middleware services and applications – To.
OOMI From COM to DCOM.
Silberschatz, Galvin, and Gagne  1999 Applied Operating System Concepts Chapter 15: Distributed Communication Sockets Remote Procedure Calls (RPCs) Remote.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
Distributed Objects and Middleware. Sockets and Ports Source: G. Coulouris et al., Distributed Systems: Concepts and Design.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
GAM666 – Introduction To Game Programming ● DirectX is implemented as a collection of COM objects ● To use a DirectX program, the user must have the correct.
Server-Side C++ Mapping Copyright © ZeroC, Inc. Ice Programming with C++ 6. Server-Side C++ Mapping.
CORBA (Common Object Request Broker Architechture) Aniket Prabhune Varun Saini Balaprasuna Chennupati Lally Singh.
Distributed Computing in Life Science Research -Presenter: Yijian Yang
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
CORBA Antonio Vasquez, John Shelton, Nidia, Ruben.
Java Distributed Computing
Putting the Distributed into COM
Apartments and COM Threading Models
Microsoft’s Distributed Component Object Model (DCOM)
Java Distributed Computing
Out-of-Process Components
COM: A Brief Introduction
Remote Method Invocation
COM: A Brief Introduction
Knowledge Byte In this section, you will learn about:
Programming Models for Distributed Application
Interpreter Style Examples
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
DCOM-CORBA Comparison
Chapter 40 Remote Method Invocation
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Remote method invocation (RMI)
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
Out-of-Process Components
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Lecture 7 ATL and Out-of-Process Components
Presentation transcript:

DCOM-CORBA Comparison Operating Systems II Reference: P. Chung et al., DCOM and CORBA: side by side, step by step,and layer by layer, C++ Report. S.html

DCOM vs CORBA2 zA COM object can have multiple interfaces each representing a different view of the object yA COM client interacts with a COM object by obtaining a pointer to one of the object's interfaces xand invoking methods through that pointer xas if the object is in the client's address space

DCOM vs CORBA3 zThe core of CORBA is the Object Request Broker (ORB) that acts as the software bus over which objects interact with each other transparently zThe client of a CORBA object acquires an object-reference and yuses it as a handle to make calls yas if it is in the client's local address space. yThe ORB is responsible for facilitating the call

DCOM vs CORBA4 zBoth DCOM and CORBA provides client- server relations between objects zThe interface to a server is described using an IDL in both cases zCORBA supports multiple inheritance at IDL level, DCOM does not yDCOM however allows multiple interfaces to an object

DCOM vs CORBA5 Communication zCORBA and DCOM uses RPC style of communication yThe client makes a call to the client stub (called proxy in DCOM) xThe stub marshals the parameters and sends it to the server yAt the server end, a server skeleton (called stub in DCOM) demarshals the message and makes the call

DCOM vs CORBA6 Sample application zA Grid server maintains a two-dimensional grid of integers zTwo views to the grid: yView One: xTwo methods: get and set to get and set grid point yView Two: xOne method: reset to reset all grid points to a given value

DCOM vs CORBA7 zThe DCOM implementation uses two interfaces, one for each view yInterfaces IGrid1 and IGrid2 zThe CORBA implementation uses multiple inheritance yInterface grid1 supports get and set yInterface grid2 supports reset yInterface grid inherits from grid1 and grid2

DCOM vs CORBA8 // uuid and definition of IGrid1 [ object, uuid(3CFDB283-CCC5-11D0-BA0B-00A0C90DF8BC), helpstring("IGrid1 Interface"), pointer_default(unique) ] interface IGrid1 : IUnknown { import "unknwn.idl"; HRESULT get([in] SHORT n, [in] SHORT m, [out] LONG *value); HRESULT set([in] SHORT n, [in] SHORT m, [in] LONG value); }; // uuid and definition of IGrid2 [ object, uuid(3CFDB284-CCC5-11D0-BA0B-00A0C90DF8BC), helpstring("IGrid2 Interface"), pointer_default(unique) ] interface IGrid2 : IUnknown { import "unknwn.idl"; HRESULT reset([in] LONG value); }; DCOM IDL Each interface and class has GUIDs

DCOM vs CORBA9 // uuid and definition of type library [ uuid(3CFDB281-CCC5-11D0-BA0B-00A0C90DF8BC), version(1.0), helpstring("grid 1.0 Type Library) ] library GRIDLib { importlib("stdole32.tlb"); // uuid and definition of class [ uuid(3CFDB287-CCC5-11D0-BA0B-00A0C90DF8BC), helpstring("Grid Class") ] // multiple interfaces coclass CGrid { [default] interface IGrid1; interface IGrid2; }; DCOM IDL (continued) multiple views for Grid

DCOM vs CORBA10 interface grid1 { long get(in short n, in short m); void set(in short n, in short m, in long value); }; interface grid2 { void reset(in long value); }; // multiple inheritance of interfaces interface grid: grid1, grid2 { }; CORBA IDL

DCOM vs CORBA11 DCOM server class definition (cgrid.h) #include "grid.h" // IDL-generated interface header file class CGrid : public IGrid1, public IGrid2 { public: // IUnknown STDMETHODIMP QueryInterface(REFIID riid, void** ppv); STDMETHODIMP_(ULONG) AddRef(void) { return InterlockedIncrement(&m_cRef); } STDMETHODIMP_(ULONG) Release(void) { if (InterlockedDecrement(&m_cRef) == 0) { delete this; return 0; } return 1; } // IGrid1 STDMETHODIMP get(IN SHORT n, IN SHORT m, OUT LONG *value); STDMETHODIMP set(IN SHORT n, IN SHORT m, IN LONG value); // IGrid2 STDMETHODIMP reset(IN LONG value); // create and destroy methods, and private declarations are not shown }

DCOM vs CORBA12 CORBA server class definition (grid_i.h) #include "grid.hh" // IDL-generated interface header file class grid_i : public gridBOAImpl { public: virtual CORBA::Long get(CORBA::Short n, CORBA::Short m, CORBA::Environment &env); virtual void set(CORBA::Short n, CORBA::Short m, CORBA::Long value, CORBA::Environment &env); virtual void reset(CORBA::Long value, CORBA::Environment &env); grid_i(CORBA::Short h, CORBA::Short w); virtual ~grid_i(); private: CORBA::Long **m_a; CORBA::Short m_height, m_width; };

DCOM vs CORBA13 #include "cgrid.h" STDMETHODIMP CGrid::QueryInterface(REFIID riid, void** ppv) { if (riid == IID_IUnknown || riid == IID_IGrid1) *ppv = (IGrid1*) this; else if (riid == IID_IGrid2) *ppv = (IGrid2*) this; else { *ppv = NULL; return E_NOINTERFACE; } AddRef(); return S_OK; } STDMETHODIMP CGrid::get(IN SHORT n, IN SHORT m, OUT LONG* value) { *value = m_a[n][m]; return S_OK; } extern HANDLE hevtDone; CGrid::~CGrid () { for (int i=0; i < m_height; i++) delete[] m_a[i]; delete[] m_a; SetEvent(hevtDone); } DCOM Server Implementation create, set, reset method implementations are not shown

DCOM vs CORBA14 #include "grid_i.h" CORBA::Long grid_i::get(CORBA::Short n, CORBA::Short m, CORBA::Environment &) { return m_a[n][m]; } void grid_i::set(CORBA::Short n, CORBA::Short m, CORBA::Long value, CORBA::Environment &) { m_a[n][m] = value; } void grid_i::reset(CORBA::Long value, CORBA::Environment &) { short n, m; for (n = 0; n < m_height; n++) for (m = 0; m < m_width; m++) m_a[n][m]=value; return; } // create and delete not shown CORBA Server Implementation

DCOM vs CORBA15 HANDLE hevtDone; void main() { // Event used to signal this main thread hevtDone = CreateEvent(NULL, FALSE, FALSE, NULL); hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); CClassFactory* pcf = new CClassFactory; hr = CoRegisterClassObject(CLSID_CGrid, pcf, CLSCTX_SERVER, REGCLS_MULTIPLEUSE, &dwRegister); // Wait until the event is set by CGrid::~CGrid() WaitForSingleObject(hevtDone, INFINITE); CloseHandle(hevtDone); CoUninitialize(); } DCOM Server main program

DCOM vs CORBA16 int main() { // create a grid object using the implementation class grid_i grid_i ourGrid(100,100); try { // tell Orbix that we have completed the server's initialization: CORBA::Orbix.impl_is_ready("grid"); } catch (...) { cout << "Unexpected exception" << endl; exit(1); } CORBA Server main program

DCOM vs CORBA17 #include "grid.h" void main(int argc, char**argv) { IGrid1 *pIGrid1; IGrid2 *pIGrid2; LONG value; CoInitialize(NULL); // initialize COM CoCreateInstance(CLSID_CGrid, NULL, CLSCTX_SERVER, IID_IGrid1, (void**) &pIGrid1); pIGrid1->get(0, 0, &value); pIGrid1->QueryInterface(IID_IGrid2, (void**) &pIGrid2); pIGrid1->Release(); pIGrid2->reset(value+1); pIGrid2->Release(); CoUninitialize(); } DCOM client program

DCOM vs CORBA18 CORBA client program #include "grid.hh" void main (int argc, char **argv) { grid_var gridVar; CORBA::Long value; // bind to "grid" object; Orbix-specific gridVar = grid::_bind(":grid"); value = gridVar->get(0, 0); gridVar->reset(value+1); }

DCOM vs CORBA19 Registration zIn both CORBA and DCOM the servers need to be registered zThis establishes the mapping between the interface name and the path name (in CORBA), and the CLSID and the path name in DCOM yDCOM uses registry (which is supported by the Window o/s) yCORBA uses implementation repository

DCOM vs CORBA20 Observations zDCOM: Client calls COM library's CoCreateInstance() with CLSID_Grid and IID_IGrid1 zCORBA: Client calls client stub's bind zDCOM: The client can get another interface (IID_IGrid2) of the same object using QueryInterface

DCOM vs CORBA21 DCOM Middle layer zUpon receiving CoCreateInstance() call, COM library delegates the task to Service Control Manager (SCM) ySCM tries to map CLSID_Grid to its server path name by consulting the registry yIf an instance does not exist, SCM creates an instance yWhen the instance is created, COM creates an interface stub for IID_Grid1 interface yThen SCM ferries the marshalled pointer back to the client side; COM on the client side creates a proxy for the interface and associates it the with the RPC channel to the stub yCOM library returns to the client an IID_IGrid1 pointer to the interface proxy pIGrid1

DCOM vs CORBA22 CORBA middle layer zUpon receiving bind() call, the client stub delegates the task to ORB zORB consults the implementation repository and activates the server zServer instantiates all supported objects and creates an instance of the skeleton zWhen the ORB ferries the object reference back to the client side, it creastes an instance of the proxy class and registers it in a proxy object table with its corresponding object reference zClient stub returns to the client an object reference as gridVar