1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong....

17
1 Distributed Systems Distributed Objects & Remote Distributed Objects & Remote Invocation II Invocation II (CORBA VS DCOM) (CORBA VS DCOM) Dr. Sunny Jeong. [email protected] With Thanks to Prof. G. Coulouris, Prof. A.S. Tanenbaum and Prof. S.C Joo

Transcript of 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong....

Page 1: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

1

Distributed Systems

Distributed Objects & Remote Distributed Objects & Remote Invocation IIInvocation II

(CORBA VS DCOM)(CORBA VS DCOM)Dr. Sunny Jeong. [email protected]

With Thanks to Prof. G. Coulouris, Prof. A.S. Tanenbaum and Prof. S.C Joo

Page 2: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

2

Distributed Object & Remote invocation

% rmic 클래스명Laptop

PDA

desktop

Local Data Format

Global Data Format(ex, XDR, CDR, Java object serialization )

Local Data FormatMarshalling Unmarshalling

MarshallingUnmarshallingNetwork

RequestReply

Page 3: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

3

Overviews

Distributed applications programming distributed objects model(object-oriented model) RMI invocation semantics(object-based model) RPC(conventional procedure call model) events and notifications(event-based programming model)

Products Java RMI, CORBA, DCOM Sun RPC Jini( distributed event notification specification by Arnold K. – JVM)

Page 4: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

About DCOM

DCOM is the distributed extension to COM (Component Object Model) that builds an object RPC layer to support remote objects.

A COM server can create object instances of multiple classes and also supports multiple interfaces allowing client-server communication.

A COM client interacts with a COM object by acquiring a pointer to the object’s interface and invoking methods through that pointer.

It is the product of Microsoft people.

Page 5: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

About CORBA

CORBA (Common Object Request Broker Architecture), is a distributed object framework proposed by a consortium of nearly 800 companies called the Object Management Group (OMG) but developed by Sun people.

The core of CORBA is the Object Request Broker (OB) that acts as the object bus over which objects transparently interact with other objects located locally or remotely.

A CORBA object is represented by an interface with a set of methods and the instances are identified bye object reference

Object implementation interacts with the ORB through either an Object Adaptor or thru ORB interface.

Page 6: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

FEATURES

Both DCOM and CORBA provide client-server type of communication.A client invokes a method implemented by a remote object (i.e., server).

The service provided by the server is encapsulated as an object and the interface of an object is described in an Interface Definition Language (IDL).

Page 7: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

Features Cont’d

These interfaces serve as a contract between a server and its clients.

Some OOP features such as data encapsulation,polymorphism and single inheritance are present at the IDL level.

CORBA also support multiple inheritance but DCOM does not support. But DCOM can have multiple interfaces

Page 8: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

Interaction Between Server & Client

The interaction between a client process and an object server are implemented as OO RPC style communications.

Page 9: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

DCOM ARCHITECTURE

Page 10: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

CORBA ARCHITECTURE

Page 11: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

CORBA

Communication infrastructure for distributed objects

Allows a heterogeneous, distributed collection of objects to collaborate transparently

Page 12: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

Basic CORBA Architecture

Client Server

ORB ORB

request response

“Object Bus”

Page 13: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

Interface Definition Language IDL

Interface Definition Language Defines protocol to access objects Like a contract Well-specified Language-independent

Page 14: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

IDL Example

module Calc {

interface Adder {

long add(in long x, in long y);

}

}

Defines an object called Adder with a method called add

Page 15: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

Stubs and Skeletons

Stub lives on clientpretends to be remote object

Skeleton lives on server receives requests from stub talks to true remote objectdelivers response to stub

Page 16: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

Stubs and Skeletons (Fig.)

IIOPORB

Client Host Machine

Client Object

ORB

Server Host Machine

Stub

Remote Object

Skeleton

Page 17: 1 Distributed Systems Distributed Objects & Remote Invocation II (CORBA VS DCOM) Dr. Sunny Jeong. spjeong@uic.edu.hkspjeong@uic.edu.hk With Thanks to.

Execution Order

Compile IDL interface with idlj (-fall) Compile files in the module folder Compile server and client program Run ORB demon (>start orbd –ORBInitialPort xxxx) Execute application (java servername-ORBInitialPort xxxx-ORBInitialHost localhost) (java clientname-ORBInitialPort xxxx-ORBInitialHost localhost)