Introduction to CORBA Copyright 1999 B Ramamurthy 192022
Introduction to CORBA Copyright 1999 B. Ramamurthy 1/9/2022 B. Ramamurthy 1
Topics for Discussion z What is CORBA? z Object Request Broker (ORB) z Structure of a CORBA Application z Interoperability between ORBs z OMA (needed? ) z Orbix. Web z Example 1: Java Application (grid) z Example 2: Java Applet (grid) z Summary 1/9/2022 B. Ramamurthy 2
What is CORBA? z. Common Object Request Broker Architecture (CORBA) specification (/standard) defines a framework for object-oriented distributed applications. z. It is defined by a consortium of vendors under the direction of Object Management Group (OMG). 1/9/2022 B. Ramamurthy 3
What is CORBA? (contd. ) z Allows distributed programs in different languages and different platforms to interact as though they were in a single programming language on one computer. z Brings advantages of OO to distributed systems. z Allows you design a distributed application as a set of cooperating objects and to reuse existing objects. 1/9/2022 B. Ramamurthy 4
Object Request Broker (ORB) z A software component that mediates transfer of messages from a program to an object located on a remote host. z Hides underlying network communications from a programmer. z ORB allows you to create software objects whose member functions can be invoked by client programs located anywhere. z A server program contains instances of CORBA objects. 1/9/2022 B. Ramamurthy 5
Clients, severs and objects Server 0 Client CORBA Object invocation Server 1 1/9/2022 B. Ramamurthy 6
CORBA Objects and IDL z These are standard software objects implemented in any supported language including Java, C++ and Smalltalk. z Each CORBA object has a clearly defined interface specified in CORBA interface definition language (IDL). z The interface definition specifies the member functions available to the client without any assumption about the implementation of the object. 1/9/2022 B. Ramamurthy 7
Client and IDL z. To call a member function on a CORBA object the client needs only the object’s IDL. z. Client need not know the object’s implementation, location or operating system on which the object runs. 1/9/2022 B. Ramamurthy 8
IDL facilitates internetworking C++ -- Specify in IDL -- Use IDL-language compiler -- Client sees only IDL interface Java smalltalk target object OLE (VB, PB, Delphi) Ada, Cobol etc. 1/9/2022 B. Ramamurthy 9
Separation of Interface and Implementation z. Interface and implementation can be in two different languages. z. Interface abstracts and protects details (trade secrets) from client z. Interface offers a means of expressing design without worrying about implementation. 1/9/2022 B. Ramamurthy 10
ORB : Conceptual View z. When a client invokes a member function on a CORBA object, the ORB intercepts the function call. z. ORB directs the function call across the network to the target object. z. The ORB then collects the results from the function call returns these to the function call. 1/9/2022 B. Ramamurthy 11
Implementation Details Client Object Stub Client Stub ORB Access to the services provided by an Object ORB : (Object-oriented middleware) Object Request Broker ORB mediates transfer between client program and server object. 1/9/2022 B. Ramamurthy 12
CORBA Application Development 1. Define interfaces to the objects in your system using CORBA IDL. 2. Compile these using IDL compiler : this compiler is language specific. IDL - Java compiler generates Java code from IDL definitions. This Java code contains client stub code which allows client code development and A skeleton code which allows implementation of server object code. 1/9/2022 B. Ramamurthy 13
CORBA Application Development (contd. ) 3. Implement client, server code in Java (or what ever language). 4. Compile client. java, server. java and all the other source files generated by IDL compiler. (javac) 5. Register the server (object) with the ORB Implementation Repository. 6. Run CORBA (Ex: Orbix. Web) daemon, the server (if needed) and the client. (java) 1/9/2022 B. Ramamurthy 14
Example 1: Twodimensional Grid z. A grid is an abstract view of a number of commonly used components such as spreadsheets or relational (database) tables. 1/9/2022 B. Ramamurthy 15
Defining the IDL Interface //IDL // In file grid. idl interface Grid { readonly attribute short height; readonly aatribute short width; void set (in short row, in short col, in long value); long get (in short row, in short col); }; 1/9/2022 B. Ramamurthy 16
Overview of Compilation Process Grid. idl IDL Compiler _Grid. Stub _Grid. Skeleton Classes & interfaces Grid client application Java compiler Server byte code Client byte code 1/9/2022 Grid server application B. Ramamurthy 17
Summary z. We introduced general operation of CORBA. z. Also details of specifying a client, server application, compiling them and registering and running. z. In the next class we will look at actual implementation of CORBA client-server application. 1/9/2022 B. Ramamurthy 18
- Slides: 18