By Keith Mante

Many enterprises have generated COBOL applications involving huge investments in both money and resources over the last 20 years. The last thing they want to do is throw this investment away and rewrite it all in Java.

They may also have newer systems already written in Java or have a desire to take advantage of Java for less business-oriented, new application development.

A typical example of how this situation materializes for the IT manager is delivering Web access to legacy applications and data. Organizations need to deliver their existing COBOL business logic and extend it to the Web.

But how can you integrate new Web development technologies with existing legacy code and reuse, rather than rewrite, existing business logic? Take advantage of Enterprise JavaBeans (EJB).

In the past, the interfaces and capabilities of Web application servers differed considerably. A common attribute was that they typically targeted Java or C++, making it difficult for COBOL applications to use them. In recent years, with the growing prominence of the EJB model, application servers have begun to support EJB. The EJB model can deliver existing COBOL business logic and use Java classes from COBOL to establish interoperability between Java and COBOL.

Although Java and COBOL interoperability has long been possible, it hasn’t been easy. A mechanism called the Java Native Interface (JNI) is built into the Java platform that allows Java methods to call non-Java (or native) methods. JNI is powerful, but it’s not intuitive, especially for COBOL programmers. JNI lets COBOL and Java mix easily, and COBOL applications can be wrapped as EJB. This creates an infrastructure that provides a strategic platform for extension and maintenance of legacy applications.

Calling legacy COBOL programs from Java and EJB provides a fast way of making COBOL business logic available to Java programs. Using toolsets and wizards, developers can easily create COBOL-wrapped EJB and COBOL classes for use as an EJB. By calling on an organization’s business logic within COBOL-wrapped EJB, the benefits of an application server environment are combined with the performance gain of compiled COBOL code.

The ability to integrate new Web development technologies with existing legacy code and to reuse, rather than rewrite, existing business logic, lies in unleashing the power of EJB to preserve the investment you have in your existing COBOL applications.

Your take

What do you think of EJB and COBOL interoperability? Post a comment in the discussion below or send us an e-mail.