Objektorienteret Middleware (OOMI) CORBA Introduction.

26
Objektorienteret Middleware (OOMI) CORBA Introduction

Transcript of Objektorienteret Middleware (OOMI) CORBA Introduction.

Page 1: Objektorienteret Middleware (OOMI) CORBA Introduction.

Objektorienteret Middleware (OOMI)

CORBA Introduction

Page 2: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 2 of 25 © Ingeniørhøjskolen i Århus

Outline

• CORBA (part one)– Introduction & Background– Architecture– Session & Presentation layer

• GIOP / IIOP / CDR

– CORBA Interface Definition Language – IDL– Language mappings– CORBA development steps

Page 3: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 3 of 25 © Ingeniørhøjskolen i Århus

Who is the OMG?

• OMG: Object Management Group– http://www.omg.org

• Non-profit organization in the US, representatives in United Kingdom, Germany, Japan, India, and Australia

• Founded April 1989• More than 800 members• Dedicated to creating and popularizing object-

oriented industry standards for application integration, e.g.– CORBA 1.0 (1995) –> CORBA 3.0.3 (2006)– UML 1.1 nov. 97. -> 2.1 (2006)

Page 4: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 4 of 25 © Ingeniørhøjskolen i Århus

Goal of CORBA

• CORBA: Common Object Request Broker Architecture• Support distributed and heterogeneous object request

in a way transparent to users and application programmers

• Facilitate the integration of new components with legacy components

• Open standard that can be used free of charge• Based on wide industry consensus

– But not much Microsoft support

• Problem with CORBA– Considered too complex by many

Page 5: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 5 of 25 © Ingeniørhøjskolen i Århus

The specifications

• CORBA is a collection of specifications• http://www.omg.org/technology/documents/corba_spec_catalog.htm

– Common Object Request Broker Architecture (CORBA/IIOP) (3.0.3)– CORBA Component Model (3.0)– Light Weight CCM– CORBA/e (replaces Minimum CORBA)

• Minimum CORBA (1.0)– Real-Time CORBA (Dynamic Scheduling) (2.0)– Real-Time CORBA (Static Scheduling) (1.1)– Families of specifications:

• CORBAservices Specifications • CORBAfacilities Specifications • OMG Domain Specifications • IDL / Language Mapping Specifications

– Many others– Realted to UML

• UML Profile for CORBA (1.0)

Page 6: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 6 of 25 © Ingeniørhøjskolen i Århus

ApplicationObjects

CORBAFacilities

CORBA Services(mandatory)

DomainInterfaces

Object Management Architecture (OMA)

Object Request Broker

Page 7: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 7 of 25 © Ingeniørhøjskolen i Århus

CORBA Architecture1

• Many different vendors and ORB types• Many of which do not interoperate• Must check specification• OrbBacus from IONA produces both C++ and

Java• Sun J2SE SDK has only Java-based ORB• C++ ORB from IONA will work with SUN ORB

as specified• Many others

– MicoORB, Middcor, TAO, openORB, VisiBroker

Page 8: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 8 of 25 © Ingeniørhøjskolen i Århus

One standardised interface

One interface per object operation

ORB-dependent interfaceOne interface per object adapter

DynamicInvocation

ClientStubs

ORBInterface

Implementation Skeletons

Client Object Implementation

ORB Core

ObjectAdapter

CORBA Architecture 2

Page 9: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 9 of 25 © Ingeniørhøjskolen i Århus

CORBA 2.0

Applications

GIOP ESIOP

IIOP DOETalk ........ DCE-CIOP ........

Mandatory: provides "out of the box" interoperability

Interoperability Protocols

EnvironmentSpecific ..

IIOP: Internet Inter-ORB Protocol is the primary CORBA transport protocol

Page 10: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 10 of 25 © Ingeniørhøjskolen i Århus

General Inter-ORB Protocol (GIOP)

• Handles the session & presentation layer• Defines seven message primitives:

– Request, Reply, Locate Request, Locate Reply, Cancel request, Close Connection, Message Error

– More simple than JRMP for Java RMI

• Internet Inter-ORB Protocol (IIOP) – Maps GIOP to TCP/IP– Provides operations to open and close TCP/IP

connections– Is required from ORBs for CORBA compliance– But intra vendor ORB com is not restricted to this

More on the IIOP later in the course

Page 11: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 11 of 25 © Ingeniørhøjskolen i Århus

Common Data Representation (CDR)

• Defined as part of GIOP• Presentation layer implementation to

support heterogeneity• Mapping of IDL data types to transport

byte stream• Encodings of

– primitive types– constructed types– interoperable object references

Page 12: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 12 of 25 © Ingeniørhøjskolen i Århus

Recap - motivation for an IDL

• IDL: Interface Definition Language • Components of distributed systems are

written in different programming languages

• Programming languages may or may not have their own object model

• Object models largely vary• Differences need to be overcome in

order to facilitate integration

Page 13: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 13 of 25 © Ingeniørhøjskolen i Århus

Heterogeneous OO Network

CORBAC++

ClientApp.3

CORBAC#

ClientApp.2

CORBAJavaClientApp.1

TCP/IPNetwork

CORBACobol

DatabaseServer

DB

“Object Wrapping

of nonOO application”

Different ORB’s from different vendors, on different operating systems – and written in different languages = Heterogenity

Page 14: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 14 of 25 © Ingeniørhøjskolen i Århus

PL6

PL2

PL5

PL1

PL4

PL3 PL6

PL2

PL5

PL1

PL4

PL3IDL

CORBA IDL & Mappings

Avoid multiple mappings

Page 15: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 15 of 25 © Ingeniørhøjskolen i Århus

IDLCommon

ObjectModel

SmalltalkSmalltalk

CobolCobol

JavaJava

Ada-95Ada-95C++C++

CC

CORBA Programming Language Bindings

.NET.NETJaneva / Middcor (C#)Janeva / Middcor (C#)

Page 16: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 16 of 25 © Ingeniørhøjskolen i Århus

Interface Definition Language (IDL)

• Language for expressing all concepts of the middleware’s object model

• Should be– programming-language independent– not computationally complete

• Bindings to different programming languages are needed – language bindings are specified by CORBA

The IDL is very comprehensive – please read and experiment with it

Page 17: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 17 of 25 © Ingeniørhøjskolen i Århus

Example UML to IDL mapping

Player

-name:string-Number:int

+book()

Team

-name:string

+bookGoalies()

plays in

1 11..16

+transfer(p:Player)

Club

-noOfMembers:int-location:Address

has1

*

uses

Organization

#name:string

coaches 1..*

1..*

Trainer

-name:string1 1..*

+train()works for

Page 18: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 18 of 25 © Ingeniørhøjskolen i Århus

Constructed types

CORBA Object Model: Types

typedef struct Address {

string street;

string postcode;

string city;

};

typedef sequence<Address> AddressList;

interface Team { ... };

Atomic types

Object type

Page 19: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 19 of 25 © Ingeniørhøjskolen i Århus

CORBA Object Model: Modulesmodule Soccer { typedef struct Address { string street; string postcode; string city; };};module People { typedef struct Address { string flat_number; string street; string postcode; string city; string country; };};

Modules =namespaces

Soccer::Address

People::Address

Page 20: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 20 of 25 © Ingeniørhøjskolen i Århus

CORBA Object Model: Attributesinterface Player;

typedef sequence<Player> PlayerList;

interface Trainer;

typedef sequence<Trainer> TrainerList;

interface Team {

readonly attribute string name;

attribute TrainerList coached_by;

attribute Club belongs_to;

attribute PlayerList players;

...

};

Attribute type Attribute name

changeable

Clients cannotchange value

Page 21: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 21 of 25 © Ingeniørhøjskolen i Århus

CORBA Object Model: Operations

interface Team {

...

void bookGoalies(in Date d);

string print();

};

Parameter list

Parameter kind

Parameter typeParameter nameOperation name

used in requests

Return types

Page 22: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 22 of 25 © Ingeniørhøjskolen i Århus

CORBA Object Model: Exceptions

• Generic Exceptions (e.g. network down, invalid object reference, out of memory)

• Type-specific Exceptions

exception PlayerBooked{sequence<Date> free;}; interface Team { void bookGoalies(in Date d) raises(PlayerBooked); };

Exception data

Operations declareexceptions they raise

Exception name

Page 23: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 23 of 25 © Ingeniørhøjskolen i Århus

CORBA Object Model: Subtypes

interface Organization { readonly attribute string name; };interface Club : Organization { exception NotInClub{}; readonly attribute short noOfMembers; readonly attribute Address location; attribute TeamList teams; attribute TrainerList trainers; void transfer(in Player p) raises NotInClub; };

Inherited by Club

Supertype

Implicit supertype: Object

This has only been a minimal presentation of the IDL

Page 24: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 24 of 25 © Ingeniørhøjskolen i Århus

Legal Values in CORBA (Types)

Page 25: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 25 of 25 © Ingeniørhøjskolen i Århus

InterfaceDefinition

Design

Server StubGeneration

Client StubGeneration

ServerCoding

ClientCoding

ServerRegistration

Development Steps – CORBA vs RMI & SOAP

SOAP: WSDLSOAP: WSDLJava2WSDLJava2WSDL

WSDL2JAVAWSDL2JAVA

AXISSOAPAXISSOAP

RMI: rmicRMI: rmic

RMI: JAVARMI: JAVA

J2SE JDKJ2SE JDK

Start with Server Interface Coding: JAVA

Start with Server Interface Coding: JAVA

rmiregistryrmiregistry

CORBACORBA

CORBA: IDLCORBA: IDL

CORBA: IDLCORBA: IDL

ORBORB

RMI: JAVA interfaceRMI: JAVA interface

C++, Java …C++, Java …

C++, Java …C++, Java …

Page 26: Objektorienteret Middleware (OOMI) CORBA Introduction.

Slide 26 of 25 © Ingeniørhøjskolen i Århus

C++ Compiler, Linker

Server

Client.ccClient.cc Server.ccServer.cc

C++ Compiler, LinkerC++ Compiler, Linker

Client

Team.idlTeam.idl

included ingeneratesreads

IDL-Compiler

Teamcl.hh

Teamcl.cc Teamsv.cc

Teamsv.hh

CORBA Client and Server Implementation

Next we will look into a simple CORBA programming example