Wrapping procedure-oriented COBOL programs
A wrapper is a class that provides an interface between object-oriented code and procedure-oriented code. Factory methods provide a convenient means for writing wrappers for existing procedural COBOL code to make it accessible from Java™ programs.
About this task
To wrap COBOL code, do these steps:
Procedure
- Create a simple COBOL class that contains a
FACTORY
paragraph. - In the
FACTORY
paragraph, code a factory method that uses aCALL
statement to call the procedural program.
Results
A Java program can invoke the factory method by using a static method invocation expression, thus invoking the COBOL procedural program.