900 likes | 1.05k Views
CORBA: achtergrond, architectuur en implementaties. Met dank aan Aart van Halteren, KPN Research. Heterogeneity. Programming languages 3 million programmers write COBOL for a living 1.6 million use Visual Basic, 1.1 mln C and C++ Operating systems
E N D
CORBA:achtergrond, architectuur en implementaties Met dank aan Aart van Halteren, KPN Research
Heterogeneity • Programming languages • 3 million programmers write COBOL for a living • 1.6 million use Visual Basic, 1.1 mln C and C++ • Operating systems • Unix, MVS, MacOS, NT, Windows 2000, Windows CE, PalmOS,... • What about the pager, mobile phone, set-top box? • Networks • ATM, IP, Ethernet, SS7, Appletalk, USB, .... • Proprietary: networks in cars.
There must be consensus on interoperability Focus on Interoperability • There will not be consensus on hardware platforms; • There will not be consensus on operating systems; • There will not be consensus on network protocols; • There will not be consensus on application formats.
Creating consensus... • Object Management Group • mission • organisation • process • Object Management Architecture ObjectRequest Broker
Focus on easy usable (“off the shelf”) standard components OMG’s Mission • Co-operative creation and promulgation of object-oriented standards based on commercially available software, guaranteeing: • reusability of components; • interoperability & portability.
Platform Technology Committee Domain Technology Committee Architecture Board OMG’s Organisation Board of Directors • Policies & Procedures • End-User Requirements • Metrics • Security SIG • Finance • Business Objects • Healthcare • Manufacturing • Multimedia/Commerce • Telecommunications • ORB & Object Services • Real-Time • ...
OMG’s process outline • Write Request for Proposal (RFP) • 3 week rule • Issue RFP • Receive Letter of Intent (LOI) • 60 days • Receive Initial Submission • 12 weeks • Review submission + feedback • Receive Final submission • Fax/Email Vote • 10-14 weeks • 2/3 majority • Product availability check (BoD) • New OMG standard! module Pricing { interface UsageCalc { ... };
Object Management Architecture DomainInterfaces CORBAfacilities Application Interfaces Object Request Broker CORBAservices
Object Request Broker CORBA services • Formerly: Common Object Services Specificication (COSS) • Generic object services: • Event Service • Naming Service • Object Transaction Service • Lifecycle Service • .... • Specifications implemented by several vendors
Object Request Broker CORBA facilities • Formerly: Common Facilities • Object framework • Mobile Agent Facility • Calendar Facility • ... • Specifications implemented by several vendors
Object Request Broker Domain interfaces • Similar to CORBA facilities • Domain specific • Telecom • Healthcare • Manufacturing • Finance • ... • Examples • “Control and Management of A/V Streams” (telecom) • General Ledger Facility (finance) • Negotiation Facility (ec)
Object Request Broker Application objects • No standardisation, but canditates • Enterprise and application specific • “In-house” development
Object Management Architecture Non-standardizedapplication-specific interfaces Verticaldomain-specific interfaces Horizontalfacility interfaces DomainInterfaces CORBAfacilities Application Interfaces Object Request Broker CORBAservices General service interfaces
CORBA 2.x CORBA: The middleware that is everywhere http://www.omg.org/.. ../library/c2indx.html ../corba/corbaiiop.htm ../cgi-bin/doclist.pl http://www.cs.wustl.edu/~schmidt/
Status Object Request Broker • Initial revision adopted in October 1991 • Revisions • 2.0, July 1995 • 2.1, August 1997 • 2.2, February 1998 • 2.3, June 1999
Status (continued) • Main areas of CORBA 2.2: • Object model • ORB architecture • OMG IDL • Interoperability (DCE, OLE/COM) • Language mappings(C, C++, Smalltalk, Cobol, Ada, Java) • Major additions of CORBA 2.3 • value types • portable object adapter • interoperability with DCOM • GIOP 1.2
Distributed Computing • distribution of resources and work • a task is performed by co-operating computers • resources are shared among tasks • two categories • distribution by nature • distribution by design
Distributed Object-Oriented Systems Object-Orientation DistributedObjects + DistributedComputing
Distributed objects • objects distributed over the nework • location not important • objects interact through interfaces • invoke an action • obtain a result from the object • interface hides object implementation ‘Object X’ ‘Object Y’ ‘Object Z’ ORB
OMG Interface Definition Language (IDL) C C++ Small talk Ada Cobol Java C C++ Small talk Ada Cobol Java IDL IDL IDL IDL IDL IDL IDL IDL IDL IDL IDL IDL Client Server ORB
IDL types Type Complex declarator Basic type Constructed type Template type array struct union sequence string short long boolean ..... char any
Example IDL module bank { interface account { readonlyattributefloat balance; void makeLodgement (in float f); void makeWithdrawal (in float f); }; interface accountManagement { exception reject {string reason;}; account newAccount (in string name) raises (reject); void deleteAccount (in account a); }; };
Object Implementation CORBA 2.x object interaction Server side Client side Client
CORBA 2.x object interaction Server side Client side Object Implementation Client Dynamic Invocation Client IDL Stubs ORB Interface Static Skeletons Dynamic Skeleton Object Adapter Object Request Broker Core
Object Adapter CORBA 2.x static invocation Server side Client side Object Implementation Client Dynamic Invocation Client IDL Stubs ORB Interface Static Skeletons Dynamic Skeleton Object Request Broker Core
CORBA 2.x dynamic client invocation Server side Client side Object Implementation Client Dynamic Invocation Client IDL Stubs ORB Interface Static Skeletons Dynamic Skeleton Object Adapter Object Request Broker Core Interface Repository
Object Adapter CORBA 2.x dynamic server invocation Server side Client side Object Implementation Client Dynamic Invocation Client IDL Stubs ORB Interface Static Skeletons Dynamic Skeleton Implemen- tation Repository Object Request Broker Core Interface Repository
CORBA 2.x ORB interface Server side Client side Object Implementation Client Dynamic Invocation Client IDL Stubs ORB Interface Static Skeletons Dynamic Skeleton Object Adapter Implemen- tation Repository Object Request Broker Core Interface Repository
CORBA 2.x architecture Server side Client side Object Implementation Client Dynamic Invocation Client IDL Stubs ORB Interface Static Skeletons Dynamic Skeleton Object Adapter Implemen- tation Repository Object Request Broker Core Interface Repository Identical for all ORBs Per object type (IDL compiler)
Involved objects ‘Server’ Broadcaster Receiver ‘Client 1’ ‘Client n’ ‘Client 1’
Interactions between objects ‘Server’ Broadcaster say print print Receiver print ‘Client 1’ ‘Client n’ ‘Client 1’
Receiver registers with Broadcaster sends text messages to Broadcaster receives text messages from Broadcaster and print these messages Broadcaster accepts Receivers throws exception if Receiver is already registered allows Receivers to deregister allows Receivers to set an alias (nickname) receives text messages distributes text messages to all registered receivers Requirements Interface Receiver{ ... } Interface Broadcaster{ ... }
Interface receiver Interface Receiver { void print(in string message); } Interface Broadcaster{ exception AlreadyRegistered {}; exception UnknownReceiver{}; void register(in Receiver theReceiver, in string nickName) throws AlreadyRegistered; void deregister(in Receiver theReceiver) void setAlias(in string nickname, in Receiver theReceiver) void say(in string someMessage); }
IDL for Receiver object interface Receiver { /** * * Print a text. * * This message is called by the chat * server on each client for * every new message. * * @param text The text to print. * **/ onewayvoid print(instring text); };
IDL for Broadcaster (1) interface Broadcaster { /** * * Register a receiver (chat client). * * Chat clients must use this function to register * with the chat server (broadcaster) in order to * receive messages from the chat server. * **/ void register(inReceiver receiver, in string id, in string host, in string nick) raises(AlreadyRegistered, NickExists);
IDL for Broadcaster (2) /** * * Unregister a receiver (chat client). * * Chat clients must use this function to unregister * with the chat server (broadcaster) before * they disconnect. * **/ void unregister(inReceiver receiver) raises(UnknownReceiver);
IDL for Broadcaster (3) /** * * Set a receiver's nick name. * **/ void setNickName(inReceiver receiver, instring nick) raises(UnknownReceiver, NickExists); /** * * Say something to all registered chat clients. * **/ void say(instring text);
Client IDL stub • Generated from IDL • Responsible for marshalling/demarshalling of parameters • Generated for a specific language mapping (e.g. C++, Java, Smalltalk, COBOL) • Known as Static Invocation interface (SII)
Acting as a client (C++) // // Create ORB // CORBA_ORB_var orb = CORBA_ORB_init(argc, argv); // // Get "server" object // CORBA_Object_var obj = <obtain object reference> Broadcaster_var server = Broadcaster::_narrow(obj); // // Call Broadcaster // server->say(“Hello there!”);
Acting as a client (Java) public static void main(String args[]) { try { // // Create ORB // ORB orb = ORB.init(args, props); // Create “server” object // org.omg.CORBA.Object obj = orb.string_to_object(url); Broadcaster server = BroadcasterHelper.narrow(obj); try { server.say(message); } }
Static skeleton • Generated from IDL • Responsible for marshalling/demarshalling of parameters • Generated for a specific language mapping (e.g. C++, Java, Smalltalk, COBOL) • Upcall to object implementation
Acting as a server (Java) import org.omg.CORBA.*; import chat.BroadcasterPackage.*; final public class Broadcaster_impl extends _BroadcasterImplBase { // // Say something to all Receivers // public void say(String text) { for(int i = 0 ; i < receiverDescSeq_.length ; i++) { try { receiverDescSeq_[i].receiver.print(text); } } }
Object adapter • Registers object implementations • Generates object references • Maps object references to implementations • (De)Activation of implementations • Interacts with Implementation Repository (IR) • Several flavours • Basic Object Adapter • Object Database Adapter • Portable Object Adapter
Working with the BOA import org.omg.CORBA.*; import java.io.*; import java.util.*; final public class Server { public static void main(String args[]) { try{ // Create ORB and BOA // ORB orb = ORB.init(args, props); BOA boa = ((com.ooc.CORBA.ORB)orb).BOA_init(args, props); //<... Do other init stuff here> // Run implementation // boa.impl_is_ready(null); }
Implementation Repository (IR) • Stores information on object implementations • how to activate • activation policies • admission control • ...
Dynamic Invocation Interface • No compilation of IDL • For building requests run-time • Uses the Interface Repository for discovering IDL definitions run-time • Slower then SII
Interface Repository (IFR) • Stores IDL specifications • IDL constructs representedas objects (typeCode)
ORB interface • Direct access to ORB core • Standard for every ORB • Available for both clients and implementations • Creates stringified object references
Working with the ORB interface (Java) String ref = orb.object_to_string(p); System.out.println(“The IOR is: “ + ref);