You are on page 1of 44

01 Middleware

• Distributed Programming
• Middleware
• Introduction to CORBA
• What is the purpose / goals of CORBA?
• Generic Architecture
Distributed Programming

Middleware (CORBA)

Network programming (Socket)

Web Programming (CGI)

2
12
Middleware

Layer of software to mask heterogeneity and provide


a unified distributed programming interface to application
programmers.

Provide services, infrastructure services, for use by


application programs.

It provides an API that isolates the application code from


the underlying network communication formats and
protocols (FAPs).

3
12
Middleware

Object Management Group’s


CORBA Common Object Request Broker
Architecture

RMI Java Remote Method Invocation

Microsoft’s Distributed Common


DCOM Object Model
4
12
Middleware
There are three kinds of middleware systems:

Transaction- supports distributed computing


oriented involving database applications
middleware

Message- supports reliable, asynchronous


oriented communications among distributed
middleware components

Object- based on object-oriented paradigm


, and primarily supports
Oriented synchronous communications
5 middleware among distributed components
12
Middleware

The most popular object-oriented middleware paradigms


include CORBA, DCOM, DotNET, and EJB.

All these middleware systems, also referred to as Object-


Oriented middleware, are based on the Remote
Procedure Call (RPC) framework foundation.

They extend RPC framework by introducing object-


oriented mechanisms.

6
12
Introduction to CORBA

Acronym: Common Object Request Broker;

A middleware

Vendor-independent architecture;

Set of protocol definitions;

Standard architecture;

7
12
Introduction to CORBA

CORBA enables:

distributed objects to interoperate


in a heterogeneous environment

programming language independence

deployment on different platforms


8
12
Introduction to CORBA
The Object Management Group (OMG) was
formed in 1989. Its aims were:

to make better use of distributed


systems

to use object-oriented programming

to allow objects in different


programming languages to
9 communicate with one another
12
Introduction to CORBA

The object request broker (ORB) enables clients to invoke


methods in a remote object

CORBA is a specification of an architecture supporting


this.

10
12
What is the purpose / goals of CORBA?

Enable the building of plug and play component software


environment

Enable the development of portable, object oriented,


interoperable code that is hardware, operating system,
network, and programming language independent

11
12
Generic Architecture

Client Server

Object Object

Middleware

12
12
02 CORBA architecture
• CORBA Architecture
• CORBA Framework Elements
• CORBA Implementation
• Interface Definition Language (IDL)
• Internet Inter-ORB Protocol (IIOP)
CORBA Architecture

Interface Definition Language (IDL)

Object Request Broker (ORB)


2
19
CORBA Framework Elements

Object Request Broker (ORB):

This is the object manager in CORBA.

3
19
CORBA Framework Elements

Mechanisms for specifying interfaces:

Interface
Definition
for static interface definitions
Language
(IDL)

Dynamic lets clients access interfaces as


Invocation first-class objects at run-time
Interface (DII) from an Interface Repository

4
19
CORBA Framework Elements

Internet Inter-ORB Protocol (IIOP):

A binary protocol for communication


between ORBs.

5
19
CORBA Implementation

CORBA implementation includes:

An Object Request
ORB Broker (ORB)
implementation

An Interface Definition
IDL Language compiler

CORBA Implementations of Common


Services Object Services (COS)
6
19
CORBA Implementation

CORBA
Common Frameworks
facilities

An Internet Inter ORB


IIOP
Protocol implementation

7
19
Interface Definition Language (IDL)

Interface Definition Language: An interfacing


programming language that allow communication
across a heterogeneous distributed system.

Language Independence

Defines Object Interfaces

8
19
Interface Definition Language (IDL)

Hides underlying object implementation

Object defined in a CORBA IDL file can be


implemented in a large number of diverse
programming languages, including C, C++, Java,
Python, and IDLScript.

9
19
IDL Compiler

IDL Definitions

IDL Compiler

Stubs Skeletons

10
19
IDL Compiler

Define objects using IDL

Run IDL file through IDL compiler

Compiler uses language mappings to generate


programming language specific stubs and skeletons

11
19
Object Request Broker (ORB)

The interface the client sees is completely


independent of where the object is located, what
programming language it is implemented in, or any
other aspect that is not reflected in the object’s
interface.

12
19
Object Request Broker (ORB)

The ORB is responsible for:

finding the object implementation for the request,

preparing the object implementation to receive the


request,

communicating the data making up the request

13
19
Object Request Broker (ORB)

Communication infrastructure:

sending messages between objects

Communication type:

GIOP (General Inter-ORB Protocol)

IIOP (Internet Inter-ORB Protocol)

14
19
Object Request Broker (ORB)

On client side the ORB is responsible for

accepting requests for a remote object

finding implementation of the object

accepting client-side reference to the remote


object(converted to a language specific form)

routing client method calls through the object


reference to the object implementation

15
19
Object Request Broker (ORB)

On server side the ORB

lets object servers register new objects

receives requests from the client ORB

uses object’s skeleton interface to invoke object’s


activation method
creates reference for new object and sends it back to
client

16
19
Internet Inter-ORB Protocol (IIOP)

CORBA specification is neutral with respect to


network protocols

General Inter-ORB Protocol (GIOP)

GIOP is a high-level standard protocol for


communication between ORBs

not used directly; instead, it is specialized by


a particular protocol that would then be used
directly
17
19
Internet Inter-ORB Protocol (IIOP)

Internet Inter-ORB Protocol (IIOP)

IIOP is the GIOP-based protocol for TCP/IP


networks
As of the 2.0 version of the CORBA specification,
vendors are required to implement the IIOP protocol

18
19
Internet Inter-ORB Protocol (IIOP)

CORBA Networking Model

CORBA applications are built on top of GIOP-


derived protocols such as IIOP
these protocols rest on top of TCP/IP, DCE, or other
underlying transport protocol the network uses

an application architecture can be designed to use a


bridge that would interconnect, DCE-based
application components with IIOP-based ones.
19
19
03 CORBA Components
• CORBA Components
• Stub
• Skeleton
• When to use CORBA
• Standard CORBA services
• IDL and its Python mapping
CORBA Components

Client stub
• Each stub represents an object operation
which a client invokes in a language-
dependent manner.
• A client may dynamically construct and
invoke objects which can represent any
object operation.

2
13
CORBA Components

Implementation Skeleton

Each skeleton provides the interface through


which a method receives a request (dynamic
and static skeletons)

3
13
CORBA Components

Object Adapter
Purpose is to interface an object's implementation with its
ORB.
Each object adapter provides access to those services of an
ORB used by a particular type of object implementation.

activation deactivation

Object creation

Object reference management


4
13
CORBA Components

ORB Interface

The interface to the small set of ORB operations


common to all objects,
eg: the operation which returns an object's interface type.

5
13
Stub
Provides interface between client object and ORB

Marshalling: client invocation

Unmarshalling: server response

6
13
Skeleton
Provides interface between server object and ORB

Unmarshaling: client invocation

Marshaling: server response

7
13
CORBA Application

1 Define interface using IDL

2 Compile interface

3 Implement interface

4 Instantiate server:
 Register object as a CORBA object

5 Instantiate client:
8  Invoke CORBA object
13
When to use CORBA

Use CORBA if

object orientation and complex types are important.

interoperability is important.

Performance is important.

CORBA’s services solve many of your problems.

9
13
Standard CORBA services

Naming

Tree-based hierarchy of named objects.

Supports federation.

Notification

Asynchronous event filtering, notification.

10
13
Standard CORBA services

Interface repository

Run-time type discovery.

Trading

Object discovery by properties.

Security, Transaction, Concurrency, Persistence,


Time, …

11
13
IDL and its Python mapping

IDL files must end with .idl

Identifiers must be ASCII

Files are run through the C++ pre-processor

#include #define //

/ /* */

Processed with an IDL compiler


 Resulting in
omniidl, fnidl
12 stubs and skeletons
13
IDL and its Python mapping

Case sensitive, but different capitalizations collide.

attribute string String is invalid

Scoping rules similar (but not identical) to C++.

13
13

You might also like