17
1 Distributed Programming w level: sending data among distributed computations r level: supporting invocations among distributed computations •network is visible (to the programmer •programmer must deal with many detail •network is invisible (to the programme •programmer focuses on application

1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

Embed Size (px)

DESCRIPTION

3 Remote Object Systems invoking object invoked object proxy objects network objects

Citation preview

Page 1: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

1

Distributed Programming

•low level: sending data among distributed computations

•higher level: supporting invocations among distributed computations

•network is visible (to the programmer)

•programmer must deal with many details

•network is invisible (to the programmer)

•programmer focuses on application

Page 2: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

2

Remote Procedure Call

CallingProcedure

CalledProcedure

args

results

argsCalling

ProcedureClientStub

RPCTransport

args

results

RPCTransport

CalledProcedure

ServerStub

requestreply reply

results

Page 3: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

3

Remote Object Systems

invokingobject

invokedobject

proxyobjects

networkobjects

Page 4: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

4

Remote Invocation Issues

• generating stubs/proxies

• serialization or arguments and return values

• heterogeneity of data representations

•locating servers in a distributed environment

•authentication of called and calling procedures

•semantics of invocation (at-most-once, at-least-once, best-effort)

Page 5: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

5

Interface Definition Language

CallingProcedure

ClientStub/Proxy

TransportLayer

args

results

TransportLayer

CalledProcedure

ServerStub/Proxy

requestreply reply

results

IDLdescription

translator translator

Language binding: how IDL is translated to a given programming language.

Page 6: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

6

IDL Elements

module modulename { exception exceptionName { [type pname]* }; typedef type newtype;

interface newInterface { oneway type fname(in type pname1); attribute newtype; };

interface newInterface2 : newInterface { type fname2 (out newInterface pname3) raises exceptionName; };};

From: Ole Arthur Bernsen

Page 7: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

7

Simple IDL Example

module Counter{ interface Count { attribute long sum; long increment(); };};

From: Ole Arthur Bernsen

Page 8: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

8

IDL Exampletypedef unsigned long AccountNumber;typedef unsigned long PersonalIdentificationNumber;

exception NoSuchAccount {};exception InvalidPin{};exception InsufficientFunds {};

interface Account { struct AccountRecord { string owner; float balance; string lastaccess; }; void Credit (in float Amount); void Debit(in float Amount) raises (InsufficientFunds); void List (out AccountRecord List_R1);};

interface Sbank { Account Access (in AccountNumber acct, in PersonalIdentificationNumber pin) raises (NoSuchAccount, InvalidPin);};

From: Nigel Edwards

Page 9: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

9

Serialization

x y z

b

c

a

x y z c

transforming a typed, highly structured object into a stream of bytes.

Issues: •how to represent base types (i.e. int)•how to represent structured types (arrays)•how to deal with references (pointers)•how to treat duplicated objects

Transfer syntax: the description of the encoded data stream.

Page 10: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

10

Corba

From: Object Mangagement Group

Corba: Common Object Request Broker ArchitectureORB: Object Request Broker

Goal: interoperability among application components •written in different programming languages •executing on heterogeneous architectures •communicating over different networks.

Page 11: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

11

Role of the Object Request Broker

From: Doug Schmidt

•Application interfaces: interfaces for a specific application •Domain interfaces: interfaces shared across applications in a given application domain (publishing)•Common Facilities: generic services that might be needed in several domains (document structure)•Object Services: commonly needed across all applications (e.g., lifetime, naming, trading)

Page 12: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

12

Elements of Corba

From:Kate Keahey ([email protected])

Page 13: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

13

Role of IDL in Corba

From: Object Mangagement Group

Page 14: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

14

Elements of Corba

From: Doug Schmidt

Page 15: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

15

Corba Process Structure

ORBInterface

ORB Core

DIIIDLStubs

IDLSkeletons

Object Adaptor

object

operatingsystem

ObjectAdaptor

ORB Daemon

ORBInterface

ORB Core

DIIIDLStubs

IDLSkeletons

Object Adaptor

client

operatingsystem

Page 16: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

16

Corba Services

•Naming - bind of names to objects•Events - asynchronous notification (*)•Lifecycle - object management•Relationship - maintaining relationships among objects•Transaction - structured, reliable, database operations (*)

(*) - see more about later in the course

Page 17: 1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network

17

Corba and Java

Corba is still needed to fill in the gaps between Java and system developed in other languages.