530 likes | 906 Views
Introduction to CORBA. G. Michael Youngblood Artificial Intelligence Laboratory The University of Texas at Arlington. Objectives. CORBA technology introduction CORBA terminology introduction CORBA references introduction CORBA IDL CORBA Applications CORBA Services CORBA demonstration
E N D
Introduction to CORBA G. Michael Youngblood Artificial Intelligence Laboratory The University of Texas at Arlington ©2002-2003 G. Michael Youngblood
Objectives • CORBA technology introduction • CORBA terminology introduction • CORBA references introduction • CORBA IDL • CORBA Applications • CORBA Services • CORBA demonstration • Additional information ©2002-2003 G. Michael Youngblood
CORBATechnology Overview ©2002-2003 G. Michael Youngblood
CORBA • Common Object Request Broker Architecture • Specification written and maintained by the Object Management Group (OMG) http://www.omg.org • First Specification: OMAObject Management Architecture ©2002-2003 G. Michael Youngblood
Object Management Architecture • Object: an encapsulated entity with an immutable distinct identity whose services are accessed only through well-defined interfaces. • Interface Categories: general groupings for object interfaces. Conceptually linked by an ORB. ©2002-2003 G. Michael Youngblood
OMA: Interface Categories • Object Services: domain-independent, or horizontally oriented, interfaces used by many distributed object applications.Ex: Naming Service, Trading Service • Domain Interfaces: domain-specific, or vertically oriented, interfaces usu. Industry specific.Ex: Person Identification Service • Application Interfaces: developed specifically for a given application.Ex: your own CORBA applications ©2002-2003 G. Michael Youngblood
OMA interface categories DomainInterfaces DomainInterfaces ApplicationInterfaces DomainInterfaces DomainInterfaces DomainInterfaces Object Request Broker ObjectServices ©2002-2003 G. Michael Youngblood
CORBATerminology Side step.. ©2002-2003 G. Michael Youngblood
CORBA Terminology • CORBA Object: a “virtual” entity capable of being located by an ORB and having client requests invoked on it. • Target Object: within the context of a CORBA request invocation, it is the CORBA object that is the target of that request. • Client: an entity that invokes a request on a CORBA object, • Server: an application in which one or more CORBA objects exist. • Request: an operation invocation on a CORBA object by a client. • Object Reference: a handle used to identify, locate, and address a CORBA object. • Servant: a programming language entity that implements one or more CORBA objects. ©2002-2003 G. Michael Youngblood
CORBATechnology Overview Returning… ©2002-2003 G. Michael Youngblood
OMA realized through CORBA CORBA provides platform-independent programming interfaces and models for portable distributed object-oriented computing applications. ©2002-2003 G. Michael Youngblood
CORBA major features • OMG Interface Definition Language • Language Mappings • Operation invocation and dispatch facilities (static and dynamic) • Object adapters • Inter-ORB Protocol ©2002-2003 G. Michael Youngblood
CORBA Architecture ©2002-2003 G. Michael Youngblood
IDL • Interface Definition Language • Sole purpose is to allow object interfaces to be defined in a manner that is independent of any particular programming language. ©2002-2003 G. Michael Youngblood
Language Mappings • IDL-to-Programming Language mappings are defined. • C, C++, Java, Ada, LISP, XML, COBOL, FORTRAN, Smalltalk, Eiffel, Perl, Python, Tcl, etc. ©2002-2003 G. Michael Youngblood
Operation Invocation and Dispatch Facilities • Static invocation and dispatch • IDL translated into language-specific stubs and skeletons that are compiled into applications. • Dynamic invocation and dispatch • Construction and dispatch of CORBA requests at run time. • Interface and types determined by outside means (e.g., Interface Repository) ©2002-2003 G. Michael Youngblood
Object Adapters • Serve as glue between servants and the ORB • Fulfill 3 requirements • Create object references, which allow clients to address objects • Ensure each target object is incarnated by a servant • Takes requests dispatched by a server-side ORB and further directs them to servants incarnating each of the target objects • POA! ©2002-2003 G. Michael Youngblood
Inter-ORB Protocols • ORB-to-ORB communication (even between different implementations) • GIOP (“gee-op”): General Inter-ORB Protocol • An abstract protocol that specifies transfer syntax and a standard set of message formats to allow independently developed ORBs to communicate over any connection-oriented transport. • IIOP (“eye-op”): Internet Inter-ORB Protocol • GIOP over TCP/IP ©2002-2003 G. Michael Youngblood
IOR • ORB interoperability also requires standardized object reference formats. • Interoperable Object References (IOR) • Standard object reference format ©2002-2003 G. Michael Youngblood
How does it work? • Request Invocation • Object Reference Semantics • Reference Acquisition • Contents of an Object Reference • References and Proxies ©2002-2003 G. Michael Youngblood
Request Invocation • When a client invokes an operation via an object reference, the ORB does the following: • Locates the target object • Activates the server application if the server is not already running • Transmits any arguments for the call to the object • Activates a servant for the object if necessary • Waits for the request to complete • Returns any out and inout parameters and the return value to the client when the call completes successfully • Returns an exception (including any data contained in the exception) to the client when the call fails ©2002-2003 G. Michael Youngblood
Request Invocation Characteristics • The entire request invocation mechanism is completely transparent to the client, to whom it looks like an ordinary method invocation on a local object. • Request characteristics: • Location transparency • Server transparency • Language independence • Implementation independence • Architecture independence • OS independence • Protocol independence • Transport independence ©2002-2003 G. Michael Youngblood
Object Reference Semantics • Every object reference identifies exactly one object instance • Several different references can denote the same object • References can be nil • References can dangle • Reference are opaque (the client is not allowed to look at their contents) • References are strongly typed • References support late binding • References can be persistent • References can be interoperable ©2002-2003 G. Michael Youngblood
Reference Acquisition • Object references are the only way for a client to reach target objects. • How does a client get a server’s object reference? • Bootstrapping • Naming or Trading Service • Command-line or reading a file • Out-of-band method ©2002-2003 G. Michael Youngblood
Repository ID(standardized) Endpoint Info(standardized) Object Key(proprietary) Contents of an Object Reference • Repository ID • Endpoint Info • Object Key ©2002-2003 G. Michael Youngblood
References and Proxies • When a reference is received by a client, the client-side run time instantiates a proxy object in the client’s address space • This proxy is an instance that supplies an interface to the target object to the client. Client Server Proxy SkeletonInstance foo() foo() foo() ObjectReference foo() Servant ©2002-2003 G. Michael Youngblood
Questions? • CORBA Technology Overview • CORBA Terminology ©2002-2003 G. Michael Youngblood
CORBAReferences ©2002-2003 G. Michael Youngblood
OMG’s Document Access Page • OMG Specificationshttp://www.omg.org/technology/documents/index.htm • Key Specifications • Architecture and Specification (CORBA/IIOP) • IDL • Language Mappings • Services ©2002-2003 G. Michael Youngblood
Good Books • The C++ Standard…Advanced CORBA Programming with C++ by Michi Henning and Steve Vinoski\ • Many examples…PURE CORBA by Fintan Bolton ©2002-2003 G. Michael Youngblood
Implementations • Orbacus • OmniORB • MICO • TAO (The ACE ORB) • ORBit • etc. ©2002-2003 G. Michael Youngblood
Questions? • CORBA References ©2002-2003 G. Michael Youngblood
CORBAInterface Definition Language (IDL) ©2002-2003 G. Michael Youngblood
Interface Definiton Languge • Simple language • Mappings to most modern popular programming languages • Compiled into stub and skeleton code by an IDL compiler ©2002-2003 G. Michael Youngblood
IDL Compilation ©2002-2003 G. Michael Youngblood
IDL Simple Example // description of the module AddressBook module AddressBook { interface Person { attribute string name; string sendEMail(in string fromWhom); }; } ; ©2002-2003 G. Michael Youngblood
IDL Data Types ©2002-2003 G. Michael Youngblood
IDL Supports • Constants • Custom types • Attributes • Methods • Structures • Exceptions • Interfaces • Modules ©2002-2003 G. Michael Youngblood
Questions • CORBA IDL ©2002-2003 G. Michael Youngblood
CORBAApplications ©2002-2003 G. Michael Youngblood
General CORBA Application Development • Determine your application's objects and define their interfaces in IDL • Compile your IDL definitions into C++ stubs and skeletons • Declare and implement C++ servant classes that can incarnate your CORBA objects • Write a server main program • Compile and link your server implementation files with the generated stubs and skeletons to create your server executable • Write, compile, and link your code together with generated stubs ©2002-2003 G. Michael Youngblood
Examples • Coming soon… • Please hold questions until demonstration ©2002-2003 G. Michael Youngblood
CORBAServices ©2002-2003 G. Michael Youngblood
CORBA Services • OMG Naming Service • Basically, DNS for IORs • OMG Trading Service • Service discovery • OMG Event Service • Broadcast events • Interface Repository • Time Service • etc. ©2002-2003 G. Michael Youngblood
Questions? • CORBA Services ©2002-2003 G. Michael Youngblood
CORBADemonstration ©2002-2003 G. Michael Youngblood
CORBA Examples • Simple Client-Server • Advanced Client-Server • Advanced Client-Server using NameService • Advanced Client-Server using NameService invoking a Callback ©2002-2003 G. Michael Youngblood
Questions? • CORBA Applications • CORBA demonstrations ©2002-2003 G. Michael Youngblood
AdditionalInformation Are there any questions? ©2002-2003 G. Michael Youngblood
Questions Any other questions? ©2002-2003 G. Michael Youngblood