Presentation 4 principles of object oriented middleware
This presentation is the property of its rightful owner.
Sponsored Links
1 / 34

Presentation 4: Principles of Object-Oriented Middleware PowerPoint PPT Presentation


  • 97 Views
  • Uploaded on
  • Presentation posted in: General

Presentation 4: Principles of Object-Oriented Middleware. Outline. Students are assumed to be knowledgeable about Computer Networks – including the OSI model and the TCP , UDP protocols. If not … please read ; ) Types of Middleware Transaction-Oriented Middleware

Download Presentation

Presentation 4: Principles of Object-Oriented Middleware

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Presentation 4 principles of object oriented middleware

Presentation 4:Principles ofObject-Oriented Middleware


Outline

Outline

  • Students are assumed to be knowledgeable about Computer Networks – including the OSI model and the TCP, UDP protocols. If not … please read ; )

  • Types of Middleware

    • Transaction-Oriented Middleware

    • Message-Oriented Middleware

    • Remote Procedure Calls

  • Object-Oriented Middleware

  • Developing with Object-Oriented Middleware


Computer networks an ultra short introduction

Computer Networks- an ultra short introduction


Iso osi reference model

ISO/OSI Reference Model

Application

Presentation

Middleware

Specific

Session

Transport

Network

Data link

Physical


Transport layer

Transport Layer

  • Level 4 of ISO/OSI reference model.

  • Concerned with the transport of information through a network.

  • Two facets in UNIX/Windows networks:

    • TCP and

    • UDP.

Application

Presentation

Session

Transport

Network

Data link

Physical


Transmission control protocol tcp

Transmission Control Protocol (TCP)

  • Provides bi-directional stream of bytes between two distributed components.

  • Reliable but slow protocol.

  • Buffering at both sides de-couples computation speeds.

  • Best at fairly unreliable Networks (as the Internet)

  • Very pratical

    • As the WWW uses the TCP/IP protocol family

    • And most Networking Operating Systems as well


Tcp for request implementation

TCP for Request Implementation

Client

Server

Application

Application

Presentation

Presentation

Session

Session

Requests

Transport

Input Stream

Transport

Output Stream

Results


User datagram protocol udp

User Datagram Protocol (UDP)

  • Enables a component to pass a message containing a sequence of bytes to another component.

  • Other component is identified within message.

  • Unreliable but very fast protocol.

  • Restricted message length.

  • Queuing at receiver

  • Best at highly reliable networks (as a LAN)


Udp for request implementation

UDP for Request Implementation

Client

Server

Application

Application

Presentation

Presentation

Session

Session

Request Datagrams

Transport

Transport

Result Datagrams


Types of middleware and why to use

Types of Middleware- and why to use …


Direct use of network protocols implies

Direct Use of Network Protocols implies

  • Manual mapping of complex request parameters to byte streams – is complex & error prone

  • Manual resolution of data heterogeneity

    • encoding differs on NT & UNIX (what is the format of an Integer?)

  • Manual identification of components

    • References must be established manually (host add., port nr. etc.)

  • Manual implementation of component activation

  • No guarantees for type safety

  • Manual synchronization of interaction between distributed components

    • Developers need to handle TCP/UDP output stream/responses

  • No quality of service guarantees (transactions demand)


Middleware

Middleware

  • Layered between Application and OS/Network

  • Makes distribution transparent

  • Resolves heterogeneity of

    • Hardware

    • Operating Systems

    • Networks

    • Programming Languages

  • Provides development and run-time environment for distributed systems.


Forms of middleware

Transaction-Oriented

Suited for Database Applications

IBM CICS

BEA Tuxedo

Encina

Message-Oriented

Suited for Asynchronous (EDI,Batch)

IBM MQSeries

DEC Message Queue

NCR TopEnd

(SOAP)

RPC Systems

Suited for Access transparency etc

ANSA

Sun ONC

OSF/DCE

(SOAP)

Object-Oriented

OMG/CORBA

DCOM

Java/RMI

(SOAP)

First look at RPCs to understand origin of object-oriented middleware

Forms of Middleware


Remote procedure calls

Remote Procedure Calls

  • Enable procedure calls across host boundaries

  • Call interfaces are defined using an Interface Definition Language (IDL)

  • RPC compiler generatespresentation and session layer implementation from IDL


Idl example unix rpcs

IDL Example (Unix RPCs)

const NL=64;

struct Player {

struct DoB {int day; int month; int year;}

string name<NL>;

};

program PLAYERPROG {

version PLAYERVERSION {

void PRINT(Player)=0;

int STORE(Player)=1;

Player LOAD(int)=2;

}= 0;

} = 105040;


Rpc marshalling and unmarshalling

Marshalling: Disassemble data structures into transmittable form

Unmarshalling: Reassemble the complex data structure

RPC Marshalling and Unmarshalling

char * marshal() {

char * msg;

msg=new char[4*(sizeof(int)+1) +

strlen(name)+1];

sprintf(msg,"%d %d %d %d %s",

dob.day,dob.month,dob.year,

strlen(name),name);

return(msg);

};

void unmarshal(char * msg) {

int name_len;

sscanf(msg,"%d %d %d %d ",

&dob.day,&dob.month,

&dob.year,&name_len);

name = new char[name_len+1];

sscanf(msg,"%d %d %d %d %s",

&dob.day,&dob.month,

&dob.year,&name_len,name);

};


Method call vs object request

Called

Caller

Caller

Called

Stub

Method Call vs. Object Request

Caller

Stub

Transport Layer (e.g. TCP or UDP)


Rpc stubs

RPC Stubs

  • Creating code for marshalling and unmarshalling is tedious and error-prone.

  • Code can be generated fully automatically from interface definition.

  • Code is embedded (hidden away – de-coupled) in stubs for client and server.

  • Client stub represents server for client, Server stub represents client for server.

  • Stubs achieve type safety.

  • Stubs also perform synchronization.


Synchronization

Goal: achieve similar synchronization to local method invocation

Achieved by stubs:

Client stub sends request and waits until server finishes

Server stub waits for requests and calls server when request arrives

Synchronization


Type safety

Type Safety

  • How can we make sure that

    • servers are able to perform operations requested by clients?

    • actual parameters provided by clients match the expected parameters of the server?

    • results provided by the server match the expectations of client?

  • Middleware acts as mediator between client and server to ensure type safety.

  • Achieved by interface definition in an agreed language.


Facilitating type safety

Facilitating Type Safety

Client & Server

has a contract

Interface

Definition

Server

Request

Client

Reply


Session layer

Session Layer

  • Implements

    • identification of RPC servers

    • activation of RPC servers

    • dispatch of operations

Application

Presentation

Session

Transport

Network

Data link

Physical


Object oriented middleware

Object-Oriented Middleware


Interface definition language

Interface Definition Language

  • Every object-oriented middleware has an interface definition language (IDL)

  • Beyond RPCs, object-oriented IDLs supportobject types as parameters, failurehandling and inheritance

  • Object-oriented middleware provide IDLcompilers that create client and server stubs to implement session and presentation layer


Idl example

IDL Example

interface Player : Object {

typedef struct _Date {

short day; short month; short year;

} Date;

attribute string name;

readonly attribute Date DoB;

};

interface PlayerStore : Object {

exception IDNotFound{};

short save (in Player p);

Player load(in short id) raises(IDNotFound);

void print(in Player p);

};


Presentation layer implementation

Presentation Layer Implementation

  • Ensuring compatible encoding across platforms

  • In addition to RPC presentation layer implementation, object-oriented middlewareneeds to

    • define a transport representation for object references

    • deal with exceptions

    • need to marshal inherited attributes


Session layer implementation

Session Layer Implementation

  • - Mapping of Object references to hosts

  • Activation & deactivion of objects

  • Invoctation of requested operation

  • Synchronization of client & server (state)

Object

References

Hosts

Processes

Objects


Developing with object oriented middleware

Developing with Object-Oriented Middleware


Development steps

Server Stub

Generation

Client Stub

Generation

Server

Coding

Client

Coding

Development Steps

AXISSOAP

Design

Java2WSDL

SOAP: WSDL

Interface

Definition

WSDL2JAVA

Server

Registration


Facilitating access transparency

Clientstubs have the same operations as server objects

If implemented …

Hence, clients can

make local call to client stub

or local call to server object

without changing the call.

Middleware can accelerate communication if objects are local by not using the stub

Some Middleware products does this implicitly

Facilitating Access Transparency


Facilitating location transparency

Based on Object identity

… and this is Object references

Client requests operation from server object identified by object reference

No information about physical location of server necessary

How to obtain object references?

Need of a registry – an object adapter

Adminstrator uses Middleware tool for registrering

COM uses Windows Registry

Java RMI daemon

CORBA object Adapter

SOAP UDDI

RPC’s – daemon “portmap”

Client contacts one portmap daemon or broadcasts

Middleware resolves this (in some cases)

SOAP UDDI

Facilitating Location Transparency


Stub generation

Team.idl

IDL-Compiler

Teamcl.hh

Teamsv.hh

Teamcl.cc

Teamsv.cc

included in

generates

reads

Stub Generation


Client and server implementation

Team.idl

Client.cc

Server.cc

IDL-Compiler

Teamcl.hh

Teamsv.hh

Teamcl.cc

Teamsv.cc

C++ Compiler, Linker

C++ Compiler, Linker

included in

generates

reads

Client

Server

Client and Server Implementation


Key points

Key Points

  • Middleware builds on the transport layer

  • There are several forms of middleware

  • Object-oriented middleware provide IDLs

  • Object-oriented middleware implements session and presentationlayer

  • Presentation layer implementation in client/server stubs is derived from IDL

  • Session layer is implemented in object adapters


  • Login