140 likes | 322 Views
CORBA Object Browser. “Versatile DII lets you discover and use a CORBA object at runtime without compiling stubs”. Article by Poornachandra G. Sarang & Mohan Rajagopalan From Java Developer’s Journal (Vol. 4, Issue 6, June 1999) Presentation by Lara J. Bordick. Background.
E N D
CORBA Object Browser “Versatile DII lets you discover and use a CORBA object at runtime without compiling stubs” Article by Poornachandra G. Sarang & Mohan Rajagopalan From Java Developer’s Journal (Vol. 4, Issue 6, June 1999) Presentation by Lara J. Bordick
Background • CORBA provides platform, location and implementation neutral architecture. • Wanted to be able to use available CORBA services on the web. • You might not know the properties of the service ahead of time. • Dynamic Invocation allows you to learn the properties and use the services at runtime. (Like Reflection in Java)
Dynamic Invocation Interface (DII) • A CORBA object publishes its Interface Definition Language (IDL). • The CORBA architecture has an Interface Repository (IR) that allows the CORBA object to publish its IDL. • Client gets a reference to the server object and retrieves the IDL from the IR. • The DII allows the user to invoke the methods on the server object.
A Benefit • Client can learn about services • Sever/ Publisher can add new features to an object after deployment. • So, developers can modify previously published objects without the need to recompile and redistribute client-side stubs.
An Example • CORBA application that acts as an on-line store • Initial implementation allows customers to visit and make purchases but send payment via “regular mail” • New implementation allows credit card payment • Add a “credit card purchase” method to the server object • If you used DII, then the client can “discover” the new method instead of having to get a new compiled stub
Details: How the CORBA Object Browser Works. • Browser built with Java and JFC classes. • User specifies a reference to an existing CORBA server object. • Objects are known because they are registered with a CORBA Naming Service.
The Naming Services • An object is registered with the CORBA Naming Service using a bind or rebind to the ORB • Client calls resolve_initial_reference() method of the ORB or • An object is registered with the URL Naming Service • Client refers to a URL and clients can access objects on Orb's at different machines • Publisher must publish a special file on a web server so the client can find it
Interface Repository • Stores IDL definitions for CORBA objects • On-line database for storing the definition of the interfaces • An example: /* File : abcom.jr Date: Sat Jan 30 06:58:40 GMT+00:00 1999 User: Administrator Dir: C:\Objectbrowser*/module bank{ interface TermDeposit; interface TermDeposti { attribute float Interest; float Compute{ in float Principal; in short Period ); }; };
User Interface Description • User enters name of server object • User clicks Introspect Button • Object is located and the browser displays the IDL • User clicks the “Operation and Attribute Listing” tab • Various operations and attributes are displayed • Click on an attribute to see its properties • Click on a method to get a window where parameters can be set (no validation yet) • Click on “Invoke” button to invoke the server method
Browser Design Description • Composed of 7 public classes • ObjectBrowser (main user interface) • InputPanel, OutputPanel, StatusBar (interface components) • BackEnd (CORBA related activities) • AttributeDescription and OperationDescriptionTable (helper classes)
Running the browser • Browser is buit with JDK 1.1.5 and swing classes • Batch file compiles all the source code • Must start OSAgent, Naming Service, etc. • Run object browser: vbj -DORBservices=CosNaming -DSVnameroot=ABCOM -VBJclasspath “%SWINGPATH%” ObjectBrowser
Conclusion • DII is very complex • DII is very versatile • Article has complete implementation steps • Source code available at www.JavaDevelopersJournal.com • Good building block for real applications • Still needs polishing before marketable on a large scale