Title: CORBA Overview
1CORBA Overview
- CIS 6611
- Joe Hoff
- April 5 1999
2CORBA Overview
- Introduction to CORBA
- Presentation of Open Research Issues in Object
Services Architectures (OSAs)
3Introduction to CORBA
- The inter-operability problem
- Motivation for COTS Middle-ware
- Available Solutions
- CORBA architecture
- CORBA Services
- CORBA Facilities
- Examples
4The Inter-operability Problem
5The Inter-operability Problem
- Proven solutions
- Components
- Self-contained, pluggable ADTs
- Frameworks
- Reusable, semi-complete applications
- Patterns
- Problem/Solution/Context
- Architecture
- Families of Related Patterns (Models, ADLs etc.)
6Motivation for COTS Middle-ware
- It is hard to develop distributed applications
whose components collaborate - efficiently
- reliably
- transparently
- scalably
7Available Solutions
- Domain Specific Examples
- SQL, ODBC, Oracle Glue
- Groupware Middleware
- Microsoft Exchange,Lotus notes
- Internet Middleware
- HTTP, SSL
- Object Middleware
- Java RMI,JavaBeans,Enterprise Java Beans
(EJB),DCOM, CORBA
8Comparison of Object Middleware
- Outside the scope of this paper.
- http//www.execpc.com/gopalan/misc/compare.html
9What is CORBA?
- Common Object Request Broker Architecture
- Object Management Group Reference architecture
for distributed applications middleware. - What is CORBA -- http//www.omg.org/corba/whatisc
orba.html
10Motivation for CORBA
- Simplifies application interworking
- CORBA provides higher level integration than
traditional untyped TCP bytestreams - Provides a foundation for higher-level
distributed object collaboration - e.g. Windows OLE and the OMG Common Object
Service Specification (COSS) - OO-like benefits
11CORBA Architecture
IDL - Interface Definition Language DII - Dynamic
Invokation Interface DSI - Dynamic Skeleton
Interface
Interface Repository
IDL Compiler
Implementation Repository
Client
Server
control
control
DSI
IDL skeleton
IDL stubs
DII
ORB Interface
ORB Interface
Basic Object Adapter
Object Request Broker
Object Request Broker
Server Node
Network
Client Node
12CORBA Architecture
Object Request Broker
13CORBAServices
- Naming Service
- Event Service
- Security Service
- Trading Service
14CORBAServices
- Concurrency
- Property
- Transaction
- Relationship
- Query Service
15CORBAServices
- Persistent Object
- Externalization
16CORBAServices
- Life-cycle
- Licensing
- Time
17CORBA Architecture
Object Request Broker
18Communication Features of CORBA
- Supports reliable uni-cast communication
- oneway, twoway, deferred synchronous and
(shortly) asynchronous - CORBA objects can also collaborate in a
client/server, peer-to-peer, or publish/subscribe
manner
19Fundamental CORBA Design Principles
- Separation of interface and implementation
- Clients depend on interfaces, not implementations
- Location transparency
- Service use is orthogonal to service location
- Access transparency
- Invoke operations on objects
- Typed interfaces
- Support of multiple inheritance of interfaces
20CORBA Example
- PROBLEM
- A client/server application where the server
represents a ticket agency handling ticket
reservations and pricing for various stage
productions at a particular theatre facility.
client
client
client
client
client
21CORBA Example
- PROBLEM
- A client/server application where the server
represents a ticket agency handling ticket
reservations and pricing for various stage
productions at a particular facility
22CORBA Example -- Programming Steps
- Define the IDL interfaces
- Implement these interfaces with target language
classes (I.e. C or Java) - Write a server main function, which creates
instances of the classes and then informs the ORB
which initialization has been done and the server
is ready to accept requests - Register the server
- Write a client main function to find an use the
servers objects.
23CORBA Example -- Define the IDL interface
- typedef float Price
- struct Place
- char row
- unsigned long seat
-
- typedef sequenceltPlacegt Places
- typedef string Date // in DD.MM.YYYY format
- struct CreditCard
- string id
- Date expiry
24CORBA Example -- Define the IDL interface
- interface Booking
- readonly attribute Date when
- readonly attribute Places seats
- void cancel()
-
- interface GroupBooking Booking
- readonly attribute string organizer
- readonly attribute string groupName
-
- interface FrontOffice
- exception NoSuchPlace Place where
- exception PlaceAlreadyBooked Place whereDate
when - exception InvalidCreditCard CreditCard
invalidCard - exception InvalidDate Date when
- exception GroupTooSmall unsigned long
chosenSizeunsigned long minimumSize
25CORBA Example -- Define the IDL interface
- // from interface FrontOffice
- // Name of the cinema
- readonly attribute string name
- // The next 2 attrs give the size of the cinema
- readonly attribute char lastRow
- readonly attribute unsigned long seatsPerRow
- boolean checkIfOpen (in Date when,out Date
nextAvailable) raises (InvalidDate) - Places listAvailablePlaces (in Date when) raises
(InvalidDate) - Booking makeBooking(in Places chosenPlaces,in
Date when,in CreditCard payment) - raises (NoSuchPlace,PlaceAlreadyBooked,InvalidCre
ditCard,InvalidDate) - GroupBooking makeGroupBooking(in Places
chosenPlaces, in Date when, - in CreditCard payment, in string organizer,
- in string groupName)
- raises(NoSuchPlace,PlaceAlreadyBooked,InvalidCred
itCard,InvalidDate, - GroupTooSmall)
-
26CORBA Example -- Compile IDL
front.hh
IDL Compiler
front.idl
frontC.hh
frontH.hh
idl -B front.idl
27CORBA Example -- Generated Code
// front.hh include ltCORBA.hgt class Booking
public virtual CORBAObject public //
Various details for Orbix. // IDL
attributes virtual Date when () throw
(CORBASystemException) virtual Places
seats() throw (CORBASystemException) virtual
void cancel() throw (CORBASystemException)
28CORBA Example -- Generated Code
Class FrontOffice public virtual CORBAObject
public // Various details for Orbix // IDL
attributes virtual char name() throw
(CORBASystemException) virtual CORBAChar
lastRow() throw (CORBASystemException) virtual
CORBAUlong seatsPerRow() throw
(CORBASystemException) virtual
CORBABoolean checkIfOpen(const char when,
Date nextAvailableDate) throw(CORBASystemExce
ption, FrontOfficeInvalidDate) virtual
Places listAvailablePlaces (const char when)
throw (CORBASystemException,FrontOfficeInva
lidDate) //etc.
29CORBA Example -- Implement Client
include ltNaming.hhgt main(int argc,char
argv) CosNamingNamingContext_var
initContext CosNamingName_var
name FrontOffice_var cinemaVar CORBAObject_v
ar objVar try objVar CORBAOrbix.resolve_
initial_references(NameService) initContext
CosNamingNamingContext_narrow(objVar) na
me new CosNamingName(3) name-gtlength(2)
name0.id CORBAstring_dup(tourism) name
0.kind CORBAstring_dup() name1.id
CORBAstring_dup(cinemas) name1.kind
CORBAstring_dup()
30CORBA Example -- Name Services
tourism
Savoy
Royal
Screen
31CORBA Example -- Implement Client
objVar initContext-gtresolve(name) if
(!CORBAis_nil(cinema_var)) cinema_var
FrontOffice._narrow(objVar) CORBAString_var
cinemaName hotelVar-gtname() coutltltcinemaNamelt
lt is name of cinema.ltltendl // else deal
with failure to _narrow // other catch clauses
32Dynamic Invocation Interface
- Obtain object reference
- Construct request object
- Populate request with object reference, the name
of the operation/attribute and parameters - Invoke the request
- Obtain the results.
33CORBA Example -- DII Version
objVar initContext-gtresolve(name) if
(!CORBAis_nil(cinema_var)) cinema_var
FrontOffice._narrow(objVar) CORBAString_var
cinemaName hotelVar-gtname() coutltltcinemaNamelt
lt is name of cinema.ltltendl // else deal
with failure to _narrow // other catch
clauses CORBARequest_var
request cinema_var-gtrequest(name) request-gt
add_in_arg() ltlt some arg request-gtset_return_
type (CORBA_tc_string) request-gtinvoke() COR
BAString value if (request-gtreturn_value()
gtgt value) coutltltvalueltlt is name of
cinema.ltltendl
34CORBA Example -- Writing the Server
- Two Approaches
- Base Object Adapter
- TIE
Booking C class Used by Clients
IDL Compiler
BookingBOAImpl C class Used as a
base class by the implementer of the interface
oldBooking Existing C Class
Booking_i C class Used as a
base class by the implementer of the interface
35CORBA Example -- Writing the Server
// BOAImpl approach main() int try
FrontOffice_var foVar new
FrontOffice_I(Savoy,H,12,5,E,3,5,10) //W
ait for incoming requests. CORBAimpl_is_ready(
) // initialization of the ORB catch
(CORBASystemException se)
36CORBA Example -- Writing the Server
// TIE approach main() int try
FrontOffice_i p new FrontOffice_i
(Savoy,H,12,5,E,3,5,10) FrontOffice_var
foVar new TIE_FrontOffice(FrontOffice_i)
(p) //Wait for incoming requests. CORBAimp
l_is_ready() // initialization of the
ORB catch (CORBASystemException se)
37Register the Server
putit ltserverNamegt ltfullPathNamegt
command-line-args for server putit
FrontOfficeSrv /usr/users/joe/FrontOfficeExec
38Activation Modes
- Shared
- Unshared
- Per-method-call
39Shared Activation Mode
40Shared Activation Mode (II)
41Shared Activation Mode (III)
42Unshared Activation Mode (I)
43Unshared Activation Mode (II)
44Unshared Activation Mode (III)
45Per-method-call Activation
Will execute getPrice()
Savoy
Client 1
a-gtgetPrice() a-gtmakeBooking()
Will execute makeBooking()
Savoy
Client 2
a-gtgetPrice()
Will execute getPrice()
Savoy