Introduction to CORBATopics for DiscussionWhat is CORBA?What is CORBA? (contd.)Object Request Broker (ORB)Clients, severs and objectsCORBA Objects and IDLClient and IDLIDL facilitates internetworkingSeparation of Interface and ImplementationORB : Conceptual ViewImplementation DetailsCORBA Application DevelopmentCORBA Application Development (contd.)Example 1: Two-dimensional GridDefining the IDL InterfaceOverview of Compilation ProcessSummary01/14/19 B.R amamurthy 1Introduction to CORBACopyright 1999 B.Ramamurthy01/14/19 B.R amamurthy 2Topics for DiscussionWhat is CORBA?Object Request Broker (ORB)Structure of a CORBA ApplicationInteroperability between ORBsOMA (needed?)OrbixWebExample1: Java Application (grid)Example 2: Java Applet (grid)Summary01/14/19 B.R amamurthy 3What is CORBA?Common Object Request Broker Architecture (CORBA) specification (/standard) defines a framework for object-oriented distributed applications.It is defined by a consortium of vendors under the direction of Object Management Group (OMG).01/14/19 B.R amamurthy 4What is CORBA? (contd.)Allows distributed programs in different languages and different platforms to interact as though they were in a single programming language on one computer.Brings advantages of OO to distributed systems.Allows you design a distributed application as a set of cooperating objects and to reuse existing objects.01/14/19 B.R amamurthy 5Object Request Broker (ORB)A software component that mediates transfer of messages from a program to an object located on a remote host.Hides underlying network communications from a programmer.ORB allows you to create software objects whose member functions can be invoked by client programs located anywhere. A server program contains instances of CORBA objects.01/14/19 B.R amamurthy 6Clients, severs and objectsClientServer0Server1CORBA Objectinvocation01/14/19 B.R amamurthy 7CORBA Objects and IDLThese are standard software objects implemented in any supported language including Java, C++ and Smalltalk.Each CORBA object has a clearly defined interface specified in CORBA interface definition language (IDL). The interface definition specifies the member functions available to the client without any assumption about the implementation of the object.01/14/19 B.R amamurthy 8Client and IDLTo call a member function on a CORBA object the client needs only the object’s IDL.Client need not know the object’s implementation, location or operating system on which the object runs.01/14/19 B.R amamurthy 9IDL facilitates internetworkingC++JavasmalltalkOLE(VB, PB,Delphi)Ada, Cobol etc.target object-- Specify in IDL-- Use IDL-language compiler-- Client sees only IDL interface01/14/19 B.R amamurthy 10Separation of Interface and ImplementationInterface and implementation can be in two different languages.Interface abstracts and protects details (trade secrets) from clientInterface offers a means of expressing design without worrying about implementation.01/14/19 B.R amamurthy 11ORB : Conceptual ViewWhen a client invokes a member function on a CORBA object, the ORB intercepts the function call.ORB directs the function call across the network to the target object.The ORB then collects the results from the function call returns these to the function call.01/14/19 B.R amamurthy 12Implementation DetailsAccess to the services provided by an ObjectORB : (Object-oriented middleware) Object Request BrokerORB mediates transfer between client program and server object.ClientORBObjectObjectStubClientStub01/14/19 B.R amamurthy 13CORBA Application Development1. 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.01/14/19 B.R amamurthy 14CORBA 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: OrbixWeb) daemon, the server (if needed) and the client.(java)01/14/19 B.R amamurthy 15Example 1: Two-dimensional GridA grid is an abstract view of a number of commonly used components such as spreadsheets or relational (database) tables.01/14/19 B.R amamurthy 16Defining the IDL Interface//IDL// In file grid.idlinterface 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);};01/14/19 B.R amamurthy 17Overview of Compilation ProcessClasses & interfacesGrid.idlIDL Compiler_GridStub_GridSkeletonJava compilerGrid clientapplicationGrid serverapplicationClient byte codeServer byte code01/14/19 B.R amamurthy 18SummaryWe introduced general operation of CORBA.Also details of specifying a client, server application, compiling them and registering and running.In the next class we will look at actual implementation of CORBA client-server
View Full Document