Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Distributed Information Systems Lecture 6 - Distributed Objects and RMI - V2, Lecture notes of Computers and Information technologies

Detailed informtion about Distributed Objects

Typology: Lecture notes

2010/2011

Uploaded on 09/08/2011

rossi46
rossi46 🇬🇧

4.5

(10)

313 documents

1 / 89

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Distributed Objects &
RMI
Dr Simon Blake
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59

Partial preview of the text

Download Distributed Information Systems Lecture 6 - Distributed Objects and RMI - V2 and more Lecture notes Computers and Information technologies in PDF only on Docsity!

Distributed Objects &

RMI Dr Simon Blake

Topics for this lecture

•Middleware•Interfaces (IDL)•The Distributed Object Model•RMI: Remote Method Invocation^ –An extension to local method invocation that allowsremote method invocation also •Middleware^ –CORBA–COM and DCOM •SOAP

Introduction

•Sockets API used for sending & receiving calls (simple IO)•Remote Procedure Calls (RPC)^ –Was designed to provide a procedural interface for distributed(i.e., remote) services–The aim was to make the distributed nature of service transparentto the programmer–However, it is no longer considered particularly good •Remote Method Invocation (RMI)^ –Essentially combines RPC with Object Orientation–Allows objects living in one process to invoke methods of anobject living in another process

Middleware

•Middleware abstracts much of the detail andheterogeneity in systems•Middleware provides, location transparency,independence from the communicationprotocols, operating systems, hardware etc.

Interfaces

•What is an interface^ –Not a GUI–Interface in this unit refers to the means of connection for twodifferent systems •In software^ –Units of code are modularized – that is organized into modules–Modules may use other modules via either calling their methodsor through direct access to their data–They do this using interfaces

Interfaces

private void^ myCalc(){System.out.println(sumNumbers(10,10));System.out.println(sumNumbers(5,7));} public int^ sumNumbers(

int^ a,^ int^ b){ return^ a+b;}

Here we have a method thatsums two integers together And here we have anothermethod that references andcalls the above

Interfaces

•Interfaces in a DIS^ –Pass by reference is not appropriate^ •As a local memory address has no meaning to another computer^ –Arguments are either

Input^ or^ Output

arguments

  • Input^ arguments contains values that will be used by the server • Output^ arguments are used for the server returning values to theclient –No direct attribute access is generally permit •Everything occurs through messages

Interfaces

•Interfaces in a DIS^ –IDL: Interface Definition Language^ •Provides an agreed convention for describing the interfaces betweenmethods•This includes distinguishing between

Input^ and^ Output

arguments

Interfaces

•An example CORBA IDL^ struct Person {string name;string place;long year;}; Interface PersonList{readonly attribute string listname;void addPerson(in Person p);void getPerson(in string name, out Person p);long number();};

And also remotemethod interfaces

Distributed ObjectCommunication

•The Object model concerns single computers^ –The object model embodies many desirable design concepts,such as openness, scalability, etc. •The Distributed Object model concerns multiple distributedcomputers^ –How the object model is extended for use in a DIS •And… what are the key differences between thedistributed object model and the object model?

The Object Model

•The object model^ –Object references^ •All objects are actually references to objects•Methods are accessed via the object references^ –Interfaces^ •A definition of a method or a set of methods•Does not refer to the implementation of the method but•Contains types of arguments, return types of the method, etc.^ –Actions^ •Actions occur from method invocations•Invocations might supply arguments (data) in making an invocation

–i.e.^ result = sumNumbers(10,2); •Once received the receiver executes the method and returns any results that are required•The receiver state might change as a result•Requests to other methods might also be made

The Object Model

–Exceptions^ •Things can go wrong^ –Data might be inconsistent–Hardware might not be available^ •Exceptions catch errors that occur so that the software does notcrash in an uncontrolled manner•When an error occurs control jumps to the handler for the error^ –Example,

try{some code}catch (some error){some other code} –Garbage collection^ •Objects are instantiated and either de-instantiated or cease beingreferenced anywhere in the program•The memory allocated to these objects must be made available•Thus, a system for collecting dead objects and data is required•This is referred to as garbage collection

Distributed Objects^ RIA RI = Remote Invocation^ = an objectLI = Local Invocation= a message

client

RI RI LI^ LIE FBLI C

G D server

  • A client server example

The Distributed Object Model •Objects may be defined to receive local or non-local requests•Local invocations are requests made from local processes to otherlocal processes – i.e. B to G, B to E, etc. •Remote invocations are requests to non-local (remote) processes – i.e. A to B, F to G etc. •In order to make a remote request invokers

must^ have a Remote

Object Reference^ –i.e. A must have Remote Object Reference for B, etc. •Remote objects

must^ have a remote interface that specifics methods that can be invoked remotely^ – i.e. B, D and G