>Hi, While working on the earlier problems I had, I ran into the concepts=20 >of COBOL Methods and Classes, and understand they can be used for Java=20 >in addition to regular COBOL programs. The documentation does not=20 >explain the "why" behind these or the "how" and "what", so I wonder if=20 >anyone has any business case explanations of what these are or samples=20 >of some COBOL-only implementations so I can see why I might want to use=20 >them and how to do it? > >I like to keep my COBOL current and if there is a way to use COBOL more=20 >effectively, I hope you can help me understand this!
OO COBOL was added to COBOL to provide a way to communicate with Java, which does not have programs that can be called. Java has to run in the JVM, and you INVOKE methods in CLASSes with Java, you do not CALL programs. So, in order to support this we created OO COBOL (the 2nd generation, 1st gen OO COBOL was based on SOM if anyone remenber that in the late 1990s). OO COBOL is only for communicatiing for Java, unless you REALLY prefer OO programming. The real worl is not object oriented...we do no instantiate a customer object and then invoke a 'send_a_bill' method on that object. We procedurally decide that it is time to send a cusotmer a bill and do it! Haivng said that, we now have an easier way to allow COBOL to use Java code, actually using the COBOL CALL statement, this new feature is available in COBOL 6.4. If you do not need to communicate with Java, I would not recommend OO COBOL. The promise of Object Oriented Programing in the 1990s has not materialized. Re-usable tested mehods that could be re-used to build applications it just not really happening! One of my fellow IBMers left IBM for a start up and was slinging Java all day, and found it much easier to code new methods than to search through class libraries for pre-tested parts. Having said all that, it was pointed out earlier that we have seample in the COBOL Programing Guide for comunicating woith Java using OO COBOL. OO COBOL was not designed to be used in a pure COBOL application, so no examples of that. Cheers, TomR >> COBOL is the Language of the Future! << ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
