Developing Distributed Object Computing Applications with CORBA
Total Page:16
File Type:pdf, Size:1020Kb
Developing Distributed Object Computing Applications with CORBA Douglas C. Schmidt Professor Department of EECS [email protected] Vanderbilt University www.cs.wustl.edu/ schmidt/ (615) 343-8197 Sponsors NSF, DARPA, ATD, BBN, Boeing, Cisco, Comverse, GDIS, Experian, Global MT, Hughes, Kodak, Krones, Lockheed, Lucent, Microsoft, Mitre, Motorola, NASA, Nokia, Nortel, OCI, Oresis, OTI, Raytheon, SAIC, Siemens SCR, Siemens MED, Siemens ZT, Sprint, Telcordia, USENIX CORBA Tutorial Douglas C. Schmidt Motivation: the Distributed Software Crisis Symptoms Hardware gets smaller, faster, cheaper Software gets larger, slower, more expensive Culprits Inherent and accidental complexity Solution Approach Components, Frameworks, Patterns, & Architecture UC Irvine 1 CORBA Tutorial Douglas C. Schmidt Techniques for Improving Software APPLICATION- LOCAL MATH Proven solutions ! SPECIFIC INVOCATIONS CLASSES FUNCTIONALITY ADT CLASSES DATABASE Components CLASSES – Self-contained, “pluggable” GUI GLUE NETWORK EVENT CLASSES ADTs LOOP CODE IPC CLASSES Frameworks (A) CLASS LIBRARY ARCHITECTURE – Reusable, “semi-complete” applications NETWORKING EVENT LOOP ADT Patterns CLASSES GUI APPLICATION- – Problem/solution/context CALL INVOKES SPECIFIC BACKS Architecture FUNCTIONALITY EVENT MATH LOOP – Families of related patterns CLASSES and components EVENT DATABASE LOOP (B) FRAMEWORK ARCHITECTURE UC Irvine 2 CORBA Tutorial Douglas C. Schmidt Overview of CORBA Middleware Architecture INTERFACEINTERFACE IDLIDL IMPLEMENTATIONIMPLEMENTATION Goals of CORBA REPOSITORYREPOSITORY COMPILERCOMPILER REPOSITORYREPOSITORY Simplify in args OBJECT distribution by CLIENT OBJ operation() (SERVANT) automating REF out args + return value – Object location & IDL DSI activation IDL SKELETON – Parameter DII ORB OBJECT STUBS INTERFACE ADAPTER marshaling – Demultiplexing ORB CORE GIOP/IIOP/ESIOPS – Error handling STANDARD INTERFACE STANDARD LANGUAGE MAPPING Provide ORB-SPECIFIC INTERFACE STANDARD PROTOCOL foundation for higher-level www.cs.wustl.edu/ schmidt/corba.html services UC Irvine 3 CORBA Tutorial Douglas C. Schmidt Key CORBA Concepts Object reference: A strongly-typed Object: A CORBA opaque handle that identifies an programming entity with an object’s location identity, an interface, and an implementation Client: Makes requests on an object via one of its references Servant: A programming language entity that Server: Computational context (e.g., process) for objects/servants implements requests on one or more objects – Client and server are “roles” - a POA: A container for program can play both roles objects/servants in a server Stub: A proxy that converts method ORB Core: calls into messages Message-passing Skeleton: An adapter that converts infrastructure messages back into method calls UC Irvine 4 CORBA Tutorial Do CORBA Twoway Processing Steps IMPLEMENTATIONIMPLEMENTATION 1s REPOSITORYREPOSITORY in args 3s OBJECT CLIENT OBJ operation() (SERVANT) 4c 1c REF out args + return value IDL IDL SKELETON OBJECT STUBS 4s 2s ADAPTER 3c 2c ORB CORE Client processing steps Server processing steps 1c Locate target object 1s Activate server (if 2c Sent request message to necessary) server 2s Activate object’s servant 3c Wait for request to (if necessary) complete 3s Process request 4c Return control to client 4s Return result or exception UC Irvine CORBA Tutorial Douglas C. Schmidt Applying CORBA to Medical Imaging DX Domain Challenges BLOB STORE – Large volume of “Blob” data e.g.,10to40Mbps ATM LAN – “Lossy compression” isn’t DIAGNOSTIC STATIONS viable – Prioritization of requests ATM URLs MAN CLUSTER – schmidt/PDF/COOTS- ATM BLOB LAN STORE 96.pdf – schmidt/PDF/av chapter.pdf MODALITIES CENTRAL – schmidt/NMVC.html (CT, MR, CR) BLOB STORE UC Irvine 6 CORBA Tutorial Douglas C. Schmidt Applying CORBA to Real-time Avionics Domain Challenges Air WTS Frame HUD Nav – Real-time periodic 4: PULL(DATA) 3:PUSH (EVENTS) processing EVENT REPLICATION – Complex CHANNEL 3:PUSH (EVENTS) SERVICE dependencies – Very low latency 2: SENSOR PROXIES DEMARSHAL DATA & PASS TO EVENT CHANNEL URLs GPS IFF FLIR schmidt/PDF/JSAC- OBJECT REQUEST BROKER – 98.pdf 1: SENSORS GENERATE – schmidt/TAO- DATA boeing.html UC Irvine 7 CORBA Tutorial Douglas C. Schmidt Applying CORBA to Global PCS TRACKING Domain Challenges SATELLITES STATION PEERS – Long latency satellite links – High reliability STATUS INFO – Prioritization WIDE AREA NETWORK URL COMMANDS BULK DATA TRANSFER – schmidt/PDF/TAPOS- GATEWAY 00.pdf LOCAL AREA NETWORK GROUND STATION PEERS UC Irvine 8 CORBA Tutorial Douglas C. Schmidt Tutorial Outline Motivation Example CORBA Applications Using CORBA to Cope with Changing Requirements Detailed Overview of CORBA Architecture and Features Evaluations and Recommendations UC Irvine 9 CORBA Tutorial Douglas C. Schmidt Motivation for COTS Middleware It is hard to develop distributed applications whose components collaborate efficiently, reliably, transparently, and scalably To help address this challenge, the Object Management Group (OMG) is specifying the Common Object Request Broker Architecture (CORBA) OMG is a consortium of 800 companies – Sun, HP, DEC, IBM, IONA, Borland, Cisco, Motorola, Boeing, etc. The latest version of the CORBA spec is available online – www.omg.org/technology/documents/formal/ UC Irvine 10 CORBA Tutorial Douglas C. Schmidt Sources of Complexity for Distributed Applications PRINTER Inherent complexity COMPUTER – Latency FILE CD ROM SYSTEM – Reliability – Partitioning (1) STAND-ALONE APPLICATION ARCHITECTURE – Ordering TIME NAME – Security SERVICE CYCLE SERVICE SERVICE DISPLAY Accidental Complexity SERVICE FI LE – Low-level APIs NETWORK SERVICE – Poor debugging tools PRINT SERVICE – Algorithmic CD ROM decomposition PRINTER FILE SYSTEM – Continuous re-invention (2) DISTRIBUTED APPLICATION ARCHITECTURE UC Irvine 11 CORBA Tutorial Douglas C. Schmidt Sources of Inherent Complexity Inherent complexity results from fundamental challenges in the distributed application domain Key challenges of distributed computing include – Addressing the impact of latency – Detecting and recovering from partial failures of networks and hosts – Load balancing and service partitioning – Consistent ordering of distributed events UC Irvine 12 CORBA Tutorial Douglas C. Schmidt Sources of Accidental Complexity Accidental complexity results from limitations with tools and techniques used to develop distributed applications In practice, key limitations of distributed computing include – Lack of type-safe, portable, re-entrant, and extensible system call interfaces and component libraries – Inadequate debugging support – Widespread use of algorithmic decomposition – Continuous rediscovery and reinvention of core concepts and components UC Irvine 13 CORBA Tutorial Douglas C. Schmidt Motivation for CORBA Simplifies application interworking – Higher level integration than untyped TCP bytestreams Supports heterogeneity – e.g., middleware enables applications to be independent of transports, OS, hardware, language, location, and implementation details Benefits for distributed programming similar to OO languages – e.g., encapsulation, interface inheritance, polymorphism, and exception handling Provides a foundation for higher-level distributed object collaboration – e.g., CCM, J2EE, and CORBAServices UC Irvine 14 CORBA Tutorial Douglas C. Schmidt CORBA Quoter Example int main (void) Ideally, a distributed { service should look just // Use a factory to bind like a non-distributed // to a Quoter. service Quoter_var quoter = bind_quoter_service (); Unfortunately, life is harder when errors const char *name = occur... "ACME ORB Inc."; CORBA::Long value = quoter->get_quote (name); cout << name << " = " << value << endl; } UC Irvine 15 CORBA Tutorial Douglas C. Schmidt CORBA Quoter Interface // IDL interface is like a C++ WewriteanOMG // class or Java interface. IDL interface for interface Quoter our Quoter { exception Invalid_Stock {}; – Used by both clients and long get_quote servers (in string stock_name) raises (Invalid_Stock); }; Using OMG IDL promotes language/platform independence, location transparency, modularity, and robustness UC Irvine 16 CORBA Tutorial Douglas C. Schmidt Overview of OMG Interfaces OMG interfaces are similar to There are several differences, C++ abstract classes or Java however, since they interfaces – Cannot define data – They define object types members – Can be passed as (reference) – Cannot have private or parameters protected access control – Can raise exceptions and sections – Can be forward declared – Must designate their parameter directions Only CORBA objects defined with interfaces can be accessed remotely – However, locality constrained CORBA objects can’t be accessed remotely UC Irvine 17 CORBA Tutorial Douglas C. Schmidt Overview of OMG Operations Each operation in an OMG interface must have – A name – A return type (can be void) – Zero or more parameters An operation can optionally have – A raises clause, which indicates the exceptions(s) the operation can throw – A oneway qualifier, which indicates the caller doesn’t except any results – A context clause, which is deprecated and non-portable... Due to limitations with certain programming language mappings, operations cannot be overloaded in IDL interfaces UC Irvine 18 CORBA Tutorial Do Using an OMG IDL Compiler for C++ interface Quoter { IDL FILE long get_quote (in string name); }; IDL COMPILER CLIENT CLIENT SERVER SERVER STUB STUB SKELETON SKELETON BODY HEADER HEADER BODY