• No results found

Distributed objects and object-based middleware

N/A
N/A
Protected

Academic year: 2021

Share "Distributed objects and object-based middleware"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

INF5040 Frank Eliassen 1

Distributed objects and

object-based middleware

INF 5040 autumn 2007

lecturer: Frank Eliassen

Why

objekt-based

distribution

middleware?

Encapsulation

natural unit of development of distributed applications

Data abstraction

separation between implementation (class) and specification (interface)

Incremental development

an object can be replaced by an alternative implementation

Extensibility

can add new classes and objects

Inheritance of implementations and interfaces

supports reuse of code and interface

Subtyping

(2)

INF5040 Frank Eliassen 3

Distributed objects - I

Objects in a distributed program executes in

different processes.

each object has a remote interface for controlling

access to its methods and attributes that can be accessed from other objects in other processes located on the same or other machines

– declared via an “Interface Definition Language” (IDL)

remote object

– object that implements a remote interface

Remote Method Invocation (RMI)

– method call from an object in one process to a remote object in another process

Distributed objects - II

Remote objects have a unique identity: Remote Object Reference (ROR)

Other objects that want to invoke methods of a remote object needs access to its ROR

RORs are “first class values”

can occur as arguments and results in RMI

can be assigned to variables

Remote objects are encapsulated by an interface

Remote objects have a set of named attributes that can be assigned values

Remote objects can raise “exceptions” as a result of method invocations

(3)

INF5040 Frank Eliassen 5

The type of a distributed

object

Attributes, methods and exceptions are

properties objects can export to other objects

These properties determine the type of an

object

Several objects can export the same properties

(same type of objects)

The type is defined once

The object type is defined by the interface

specification of the object

Exceptions

Remote method invocations in a distributed

systems can fail

Exceptions are used to explain the cause of the

failure to the method caller

Failure of remote method invocations can be

generic

specific (application specific)

Specific failure can be declared in object type

specific exceptions

(4)

INF5040 Frank Eliassen 7

Declaration of remote methods

A remote method is declared by its signature

that consists of

a name

a list of in, out, and inout parameters

a return value type

a list of exceptions that the metod can raise

Example: CORBA/IDL

typedef enum {

Goalkeeper, Defender, Midfielder, Attacker } Position

interface Player {

readonly string Firstname; readonly string Surname; readonly short Age; Position Role;

Exception AlreadySelected{ };

void select (in Date d) raises (AlreadySelected); };

(5)

INF5040 Frank Eliassen 9

Remote method invocations

A client object can request the execution of a

method at a remote object

Remote methods are invoked by sending a

message (incl method name and arguments) to

the remote object

The remote object is identified by an object

reference (Remote Object Reference - ROR)

Clients must be able to handle exceptions that

the method can raise

data impl. of methods

Fjernobjekt med

fjerngrensesnitt

m4 m5 m6 local interface remote interface m1 m2 m3

(6)

INF5040 Frank Eliassen 11

Subtyping of distributed

objects

object types are organised into a type hierarchy

subtypes inherit attributes, exceptions, and methods from their supertypes

interface Club {

readonly string name; readonly string streetaddr; . . .

};

interface FootballClub : Club { . . .

};

interface HandballClub : Club { . . .

};

Language heterogeneity

Some object-based middlewares allow

interacting objects to be implemented in

different programming languages

Based on a common object model

provided by the middleware

Need for advanced mappings between

different object implementation languages

and the common object model

(7)

INF5040 Frank Eliassen 13

Purpose of

common object model

Metalevel model for the type system of the middleware

Defines the meaning of e.g.,

object identity

object type (interface)

operation (method)

attribute

method invocation

exception

subtyping/inhertance

Must be defined generally enough to be mappable to most programming languages

Interface Definition

Language (IDL)

Language for expressing all concepts in the object model of the middleware platform

Requirement

must be independent of a specific programming language

need not be computationally complete

Need for bindings (or language mappings) to different programming languages

Example:

CORBA object model and different language bindings for CORBA/IDL

(8)

INF5040 Frank Eliassen 15

Common object model

Common object model IDL C++ C Cobol Java Ada-95 Smalltalk

Summary

Distributed objects executes in different processes.

remote interfaces allow an object in one process to invoke methods of objects in other processes located on the same or on other machines

Object-based distribution middleware:

midleware that models a distributed application as a collection of interacting distributed objects (e.g., CORBA, Java RMI)

some middlewares (as CORBA) allow objects in the same application to be implemented in different programming languages

References

Related documents

Section 3 includes our analysis of the rate of failure and repair for both inter-domain Internet paths and intra-domain routes from a case study of a regional network.. We

The Oregon Retirement Information Online Network (ORION) is an integrated set of technology tools used to manage data and processes for more than 350,000 member accounts and is

> Reduces long lists of ideas > Reduces long lists of ideas > Identifies important items > Identifies important items •• Nominal Group Technique Nominal Group Technique

The modified JiTT tools created for this teaching experiment affected student achievement in Calculus-I on the topics of limits and chain rule by significantly increasing the number

• Long-term visitors to polio-exporting and polio-infected countries are subject to the same WHO Temporary Recommendations as local residents: i.e., you should ensure you will

Since the result of fantasy game depends on skill of participant and not sheer chance, and winning or losing of virtual team created by the participant is also independent of outcome

The updated study builds on the previous analysis and examines whether listed real estate indices in a broader sample of 13 economies are predominantly driven by the

In fact, students who engage with technology-mediated instruction in service of higher-order thinking skills performed better on the National Assessment of Educational Progress