开发者

Porting from Cobol to Java [closed]

开发者 https://www.devze.com 2022-12-16 06:23 出处:网络
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing
Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 8 years ago.

Improve this question

What differences are there between the top level architectures of Cobol and Java?

What are the styles and cultures that programmers adopt in these two languages?

How can one 开发者_如何学Cbest port from Cobol to Java?


I was the project leader for the project NACA mentionned above (automatic transcoding from cobol to java for 4 millions lines of Cobol).

If you have any specific question, please feel free to get in touch with me via a comment at the bottom of my article mentioned above.

We've had lots of projects around the world reusing our tools with good success. We still improve them on a regular basis (check out http://code.google.com/p/naca) to fulfill the needs of those projects based on NACA tech.


Theres an interesting book available for a $1 (paperback) that may help in such an endeavour, 'Java for Cobol Programmers' by John C. Byrne http://amzn.to/bKqc5j


Both are invocation stack based languages and both support object oriented and procedural styles of programming. However you will find very little benefit of porting to Java if you just rewrite procedural code in a giant main() method with static subroutines. You will likewise find very little Cobol code that takes advantage of the object oriented features of the language.

As Cobol is primarily used for applications involving money, Cobol shops and programmers tend to focus more on the business side of things, less on the write-elegant-and-beautiful-code side of things. The Cobol to Java ports I have seen tend to have one class, all variables are declared at the top as static and the main() method calls a bunch of static methods much in the same way it was performed paragraphs or call subprograms.

The Java to Cobol ports I have seen tend to be the exact opposite -- they use the OO extensions that most Cobol programmers never use, at all.

If you are in an IBM Enterprise Cobol shop, there really isn't a need to port. The two languages inter-operate nicely and you can replace new parts with Java and still interact well.

But the best way to truly port from Cobol to Java is to learn both languages and paradigms well; document the existing functionality of the Cobol system in great detail; then design and write a new OO style Java system that will also have that functionality.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号