CORBA meets Java
Learn to build a distributed Java applet that accesses server objects using CORBA
By Bryan Morgan, JavaWorld.com, 10/01/97
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
We've all accessed Web sites that allow us to interact with a server script via the use of HTML forms and the Common Gateway
Interface (CGI). Sites often use this technique to prompt a person to enter a username and password to log in to a site. The
Username and Password variables are passed to a server script that verifies that a given user indeed can access certain portions
of a site. This process is done via HTTP, which (as you may or may not know) is a
stateless protocol. Each time a new page is loaded, you are effectively disconnected from the server and it has no knowledge of who
you are and what you are currently doing. Thus, even after logging into such a site, each page accessed from that point on
must pass the username and password back to the server to verify the user's right to access the page. In other words, your
client application (the Web browser) and the server application (the Web server) have no concept of local variables, local
method calls, or objects.
Just after the software development community's decades-long struggle to encapsulate code as objects appeared to finally be
succeeding, we found ourselves tumbling backward in time to a stateless, "batch"-mode of computing.
However, it's not all bad. The Web has provided us with the revolutionary advantages of standards-based, open protocols and platform independence.
While tens of thousands of sites use HTTP and CGI to retrieve user information, run a script on the server, and possibly return
additional information to the user, these sites cannot be thought of as actual "applications," in the traditional sense of
the word. In addition, all code for these sites had to be written from scratch because of the new technologies used (HTTP
and CGI). To retrofit existing software applications to the Web, or to build truly powerful new applications using the Internet/intranet
as a communications backbone, a technology must be used that possesses the following "Holy Grail" of attributes:
- Support for legacy code currently existing in C, C++, and COBOL (among other languages)
- Java support in order to allow mobile, platform-independent, object-oriented applications to be built
- Vendor-neutrality, so that applications can be maintained and can flourish over time
- Scalability to handle large numbers of users
- Wide platform support to avoid platform "lock-in"
- An object-oriented development paradigm (because of the many advantages inherent in OOP)
- End-to-end security
- Broad industry support
Enter CORBA.
Through the course of this article you will see that only one technology, CORBA, truly fulfills our wish list (and then some).
In addition, you will see that because Java and CORBA are very complementary technologies, you can quickly and cost-effectively
begin CORBA development in Java.
A brief introduction to CORBA
CORBA is a specification that defines how distributed objects can interoperate. Until the explosion in popularity of the World
Wide Web, and in particular, the Java programming language, CORBA was basically a high-end, distributed-object solution primarily
used by C++ developers.
The actual CORBA specification is controlled by the Object Management Group (OMG), an open consortium of more than 700 companies
(including my employer) that work together to define open standards for object computing. CORBA objects can be written in
any programming language supported by a CORBA software manufacturer such as C, C++, Java, Ada, or Smalltalk. These objects
can also exist on any platform that is supported by a CORBA software manufacturer such as Solaris, Windows 95/NT, OpenVMS,
Digital Unix, HP-UX, and AIX, among others. This means that we could have a Java application running under Windows 95 that
dynamically loads and uses C++ objects stored across the Internet on a Unix Web server.
- Digg
- Reddit
- SlashDot
- Stumble
- del.icio.us
- Technorati
- dzone
Resources
- The Object Management Group provides comprehensive information on CORBA and IDL http://www.omg.org
- For another detailed look at CORBA, read Jon Siegel's CORBA Fundamentals and Programming (Wiley Computer Publishing Group, ISBN0-471-12148-7)
- Another excellent reference on CORBA and Java is Client/Server Programming With Java and CORBA by Robert Orfali and Dan Harkey (Wiley Computer Publishing Group, ISBN 0-471-16351-1)
- Visigenic VisiBroker for Java http://www.visigenic.com/
- IONA Technologies OrbixWeb http://www.iona.com/
- Sun Microsystems Neo http://www.sun.com/
- Expersoft PowerBroker http://www.expersoft.com
- IBM ComponentBroker http://www.software.ibm.com/ad/cb
- Regular JavaWorld columnist Michael Shoffner provides an in-depth look at how RMI is used for cross-network communications http://www.javaworld.com/javaworld/jw-10-1997/jw-10-step.html
- Download this article and the complete source code as a gzipped tar file http://www.javaworld.com/javaworld/jw-10-1997/corbajava/jw-10-corbajava.tar.gz
- Download this article and the complete source code as a zip file http://www.javaworld.com/javaworld/jw-10-1997/corbajava/jw-10-corbajava.zip