A Tutorial On CORBA: Mark Plesko J. Stefan Institute, Ljubljana, Slovenia
A Tutorial On CORBA: Mark Plesko J. Stefan Institute, Ljubljana, Slovenia
Mark Plesko
J. Stefan Institute, Ljubljana, Slovenia
Summary
• Introduction
– Justification and History (=blah, blah)
– What is CORBA (Executive summary)
– How does CORBA work (Programmer summary)
– CORBA Features
• Concepts of CORBA
– What are Objects in CORBA
– Data Flow in CORBA
– Definitions
• CORBA details
– Request Invocation
– Object References
– The Portable Object Adapter (POA)
• More About CORBA
ESO, December, 16-th, 1999 2
M. Plesko, CORBA Tutorial
Interface PS {
attribute double current;
readonly attribute Ulong status;
octet on(in octet value);
void test(out long result) ;
}
CORBA Features
• Don’t worry about unique terminology - these are just words!
– CORBA object
– request, target object, object reference
– client, server, servant
• Features
– Interface Definition Language (IDL)
– language mapping
• official: C, C++, Samlltalk, COBOL, Ada, Java
• also: Eiffel, Modula 3, Perl, Tcl, Objective-C, Python
– Operation invocation and dispatch facilities
• static (known at compile-time)
• dynamic (determined at run-time)
– Object adapters
• Design pattern: adapt CORBA object interface to servant
– Inter-ORB Protocol
ESO, December, 16-th, 1999 6
M. Plesko, CORBA Tutorial
IIOP
Some Definitions
• ORB:
– find the object implementation for the request, prepare the object
implementation to receive the request and communicate the data
making up the request.
– ORB throws exceptions
– ORB implementation is not defined in CORBA
• Object Adapter (POA, BOA, …)
– provides ORB services to particular groups of object implementations
– generation and interpretation of object references, method invocation,
security of interactions, object and implementation activation and
deactivation, mapping object references to implementations, and
registration of implementations.
• IIOP: Internet Inter-ORB Protocol
– ORB’s of different vendors can talk
– TCP/IP implementation of GIOP
ESO, December, 16-th, 1999 9
M. Plesko, CORBA Tutorial
More Definitions
• IDL: Interface Definition Language
– IDL is the means by which a particular object implementation tells its
potential clients what operations are available and how they should be
invoked.
• Language mapping: recipe how to generate stubs&skeletons from
IDL
– Clients see objects and ORB interfaces through the perspective of a
language mapping, bringing the object right up to the programmer’s
level.
• Interface Repository: where all interfaces are stored network-wide
– provides information on interfaces at run-time
• DII: Dynamic Invocation Interface
– construct a remote method call at run-time without the use of stubs
Request Invocation
This is transparently handled by the ORB
• Locate target object
• activate server application if not yet running
• transmit any arguments
• activate a servant if necessary
• wait for request to complete
• return any out/inout parameters and return value
• return exception if call fails
Object References
• Several references to one object
• Can point to nowhere (death undetected)
• Are strongly typed (at compile&run time)
• Support late binding
• Implemented by proxies
CORBA Services
• Some 20+ defined services
• check vendor for implementation and limitations !
• Some interesting services
– Naming Service
• “directory-based”
• single or federated
– Event Service
• decouples suppliers from consumers
• push or pull models
• uses Any for event data
• Notification Service ?
• Messaging Service ?
#device PowerSupply{
#actions{on, off, reset, start_ramp(in CBRamp cb, in RampData data)};
#methods{double sync_method_test(in double input, out double output);};
#parameters{current|RW<double>, readback|RO<double>, status|ROpattern};
#static{model|PowerSupplyModel};
};
• monitoring
• events
interface CB<event_set_name> : CB {
oneway void <event_1_name>(..., in CBDescOut desc);
oneway void <event_2_name>(..., in CBDescOut desc);
...
}
...
void subscribe_<event_set_name>(in CB<event_set_name> cb, in CBDescIn desc);
void unsubscribe_<event_set_name>(in CB<event_set_name> cb);
CoCoS Development
DB
ODBC LIB
CLIENT STUB
DB ACCESS
CORBA WRAPPER
DB Gen
IDL2CPP DB Pop
CS LIB
CW Gen
IDL2CPP COB SERVER SKELETONS
IDL
(MACI) COSCO
IDL2CPP
ACTIVATOR
CWM
CSM LIB
CoCoS Runtime
DB Servant B
LINK
DB Servant A
COB SERVER
DB
(OD
BC,
LINK
OR K
(C LIN
)
BA
LINK
M
...)
COB
DB
M LINK COB
ADMIN. MANAGER
(CORBA) COB
COB
COB
BA K
OR IN COB type B
OR K
(C T L
(C LIN
COB
)
)
BA
C
M
JE
type A
OB
CLIENT