Chapter 5 Distributed Objects and Remote Invocation - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Chapter 5 Distributed Objects and Remote Invocation

Description:

Adopt the C/S architecture(C/S invoke methods) ... Objects in other processes can only invoke the methods that belong to its remote ... – PowerPoint PPT presentation

Number of Views:1127
Avg rating:3.0/5.0
Slides: 16
Provided by: choehy
Category:

less

Transcript and Presenter's Notes

Title: Chapter 5 Distributed Objects and Remote Invocation


1
Chapter 5Distributed Objects and Remote
Invocation
  • Choe, Hyun Jong
  • Dept. of Computer Education
  • Korea National Univ. Of Education

2
Chapter Overview
  • Middleware
  • Interface definition
  • Communication between distributed objects
  • Java RMI case study

3
Middleware
  • A software layer on top of the OS that hides
    heterogeneity from the application programmer
  • Location transparency(local vs. remote
    invocation location of server)
  • Multiple languages(CORBA)

4
Interfaces (1)
  • An interface specifies the procedures and the
    variables that can be accessed from other modules
    of an application
  • An implementation may change without effecting
    the module of the others.
  • Interfaces in distributed systems
  • No direct access to variables(RPC and RMI) but
    CORBAs IDL breaks this rule with attributess
  • Call by value and call by reference are not
    suitable
  • Describes the parameters as input or output or
    sometimes both

5
Interfaces (2)
  • RMIs Java Interfaces (Java)
  • Public interface PersonList
  • Void addPerson(string name)
  • CORBAs IDL (Java)
  • struct Person
  • string name
  • long year
  • interface PersonList
  • void addPerson(in Person p)

6
Communication between distributed objects
  • OO model
  • Distributed objects
  • Distributed object model
  • Implementation
  • Distributed garbage collection

7
Object model
  • An OO app is a collection of interacting objects
  • Object references
  • Objects are accessed via object references
  • Interfaces
  • Definition of the signatures of a set of methods
  • Exceptions
  • A clean way to deal with error conditions without
    complication the code
  • Garbage collection
  • Freeing the space occupied by objects when they
    are no longer needed(automatically)
  • Java supports garbage collection but C doesnt

8
Distributed objects
  • Physical distribution of objects into different
    processes or computers is a natural extension of
    the OO model.
  • Adopt the C/S architecture(C/S invoke methods)
  • Encapsulation objects in different processes
    and therefore the state can be accessed my
    methods
  • No unauthorized access to the state
  • Concurrent access is synchronized

9
Distributed object model (1)
  • How to extend the OO model to make it applicable
    to distributed objects
  • Two fundamental concepts
  • Remote object reference
  • Remote interfaces

10
Distributed object model (2)
  • First fundamental concepts Remote object
    reference
  • A remote object reference is a unique identifier
    for a particular unique remote object
  • Remote object references are analogous to local
    ones in that
  • The remote object to receive a method invocation
    is specified as a remote object reference.
  • Remote object references may be passed as
    arguments and results of remote method
    invocations

11
Distributed object model (3)
  • Second fundamental concepts Remote interfaces
  • The class of a remote object implements the
    methods of its remote interface.
  • Objects in other processes can only invoke the
    methods that belong to its remote interface
  • Local objects can invoke methods in the remote
    interfaces as well as other methods implemented
    by a local object

12
Distributed object model (4)
  • Exceptions
  • Unlike local invocations, remote invocations may
    fail more often because objects are being in
    different processes or computers
  • Also, exceptions may be raised during the
    execution of a remote invocation(for examples,
    reading beyond the end of a file)

13
Implementation (1)
  • Several objects and modules involved in achieving
    a remote method invocation

14
Implementation (2)
  • Communication module
  • Carries out the request/reply protocol

15
Distributed garbage collection
  • Garbage?
  • When a client receives a remote reference to a
    particular remote object, it makes an addRef
    invocation to the server and then creates a proxy
  • When a clients garbage collector notices that a
    proxy for remote object is no longer reachable,
    it makes a removeRef invocation to the
    corresponding server and then deletes the proxy.
    The server removes client skeleton from it.
Write a Comment
User Comments (0)
About PowerShow.com