Objektorienteret Middleware (OOMI) CORBA Introduction
Outline CORBA (part one) Introduction & Background Architecture Session & Presentation layer GIOP / IIOP / CDR CORBA Interface Definition Language – IDL Language mappings CORBA development steps
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)
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
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)
Object Management Architecture (OMA) Application Objects Domain Interfaces CORBA Facilities Object Request Broker CORBA Services (mandatory)
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
CORBA Architecture 2 Client Object Implementation ORB Core Dynamic Invocation Client Stubs ORB Interface Implementation Skeletons Object Adapter One standardised interface One interface per object operation ORB-dependent interface One interface per object adapter
Interoperability Protocols Applications Environment Specific .. CORBA 2.0 GIOP ESIOP IIOP DOETalk ........ DCE-CIOP ........ Mandatory: provides "out of the box" interoperability IIOP: Internet Inter-ORB Protocol is the primary CORBA transport protocol
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
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
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
Heterogeneous OO Network “Object Wrapping of non OO application” CORBA Java Client App.1 CORBA Cobol Database Server CORBA C# Client App.2 TCP/IP Network CORBA C++ Client App.3 DB Different ORB’s from different vendors, on different operating systems – and written in different languages = Heterogenity
Avoid multiple mappings CORBA IDL & Mappings PL 6 2 5 1 4 3 IDL PL PL 1 2 Avoid multiple mappings PL PL 6 3 PL PL 5 4
CORBA Programming Language Bindings Smalltalk C++ Ada-95 IDL Common Object Model C Java .NET Cobol Janeva / Middcor (C#)
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
Example UML to IDL mapping Organization #name:string uses +transfer(p:Player) Club -noOfMembers:int -location:Address has 1 * coaches 1..* Trainer -name:string 1 +train() works for Player Team -name:string +bookGoalies() plays in 1 11..16 -name:string -Number:int +book()
CORBA Object Model: Types typedef struct Address { string street; string postcode; string city; }; typedef sequence<Address> AddressList; interface Team { ... }; Constructed types Atomic types Object type
CORBA Object Model: Modules Soccer::Address module Soccer { typedef struct Address { string street; string postcode; string city; }; module People { string flat_number; string country; Modules = namespaces People::Address
CORBA Object Model: Attributes interface 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; ... }; Clients cannot change value changeable Attribute type Attribute name
CORBA Object Model: Operations Parameter kind interface Team { ... void bookGoalies(in Date d); string print(); }; Parameter list Return types Parameter type Parameter name Operation name used in requests
CORBA Object Model: Exceptions Generic Exceptions (e.g. network down, invalid object reference, out of memory) Type-specific Exceptions Exception name Exception data exception PlayerBooked{sequence<Date> free;}; interface Team { void bookGoalies(in Date d) raises(PlayerBooked); }; Operations declare exceptions they raise
CORBA Object Model: Subtypes Implicit supertype: Object Inherited by Club 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; Supertype This has only been a minimal presentation of the IDL
Legal Values in CORBA (Types)
Development Steps – CORBA vs RMI & SOAP AXIS SOAP Design J2SE JDK CORBA: IDL Java2WSDL Interface Definition SOAP: WSDL Start with Server Interface Coding: JAVA RMI: JAVA interface WSDL2JAVA Server Stub Generation Client Stub CORBA: IDL RMI: rmic RMI: JAVA C++, Java … Server Coding Client C++, Java … ORB rmiregistry Server Registration
CORBA Client and Server Implementation Team.idl included in generates reads IDL-Compiler Teamcl.hh Teamcl.cc Teamsv.cc Teamsv.hh Client.cc Server.cc C++ Compiler, Linker Server C++ Compiler, Linker Client Next we will look into a simple CORBA programming example