DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Enterprise AI Trend Report: Gain insights on ethical AI, MLOps, generative AI, large language models, and much more.

2024 Cloud survey: Share your insights on microservices, containers, K8s, CI/CD, and DevOps (+ enter a $750 raffle!) for our Trend Reports.

PostgreSQL: Learn about the open-source RDBMS' advanced capabilities, core components, common commands and functions, and general DBA tasks.

AI Automation Essentials. Check out the latest Refcard on all things AI automation, including model training, data security, and more.

Related

  • Java 22 Brings Major Enhancements for Developers
  • The Power of LLMs in Java: Leveraging Quarkus and LangChain4j
  • How To Get Started With New Pattern Matching in Java 21
  • Getting Started With NCache Java Edition (Using Docker)

Trending

  • Role-Based Multi-Factor Authentication
  • Implementing CI/CD Pipelines With Jenkins and Docker
  • The Rise of the Platform Engineer: How to Deal With the Increasing Complexity of Software
  • Behavior-Driven Development (BDD) Framework for Terraform
  1. DZone
  2. Coding
  3. Languages
  4. COBOL to JOBOL? A Poor Choice for Modernization

COBOL to JOBOL? A Poor Choice for Modernization

This article digs into the common challenges of COBOL to Java conversion and some strategies to be employed to avoid the JOBOL pitfall.

By 
sampath amatam user avatar
sampath amatam
·
Mar. 11, 24 · Tutorial
Like (1)
Save
Tweet
Share
5.3K Views

Join the DZone community and get the full member experience.

Join For Free

The enduring prevalence of COBOL (Common Business-Oriented Language) in mission-critical applications poses a challenge for modernization efforts, particularly in the transition to Java. This paper explores the intricacies of converting COBOL to Java, emphasizing the avoidance of JOBOL—a term coined for Java code that retains procedural characteristics without embracing object-oriented principles. The discussion includes strategies for data-oriented conversion, dead code elimination, and the adoption of event-driven approaches to ensure a successful transition that leverages the full potential of Java.

Introduction

COBOL, an acronym for Common Business-Oriented Language, has been a stalwart in the programming world, particularly for business applications, since its inception in the late 1950s. Despite its age, COBOL remains a critical component in many organizations, with millions of lines of code still in use for core mission-critical applications. However, as technology advances, there is an increasing push towards modernization, with Java being a popular target language due to its object-oriented nature, robust ecosystem, and wide adoption in contemporary software development.

Challenges of COBOL to Java Conversion

Organizations have various motivations for transitioning from COBOL to Java, including cost savings, a dwindling pool of COBOL talent, and the desire to adopt contemporary development methodologies. The market offers numerous automation tools and AI solutions capable of automatically converting COBOL code to Java. 

However, the transition from COBOL to Java is not without its challenges. One significant hurdle is the potential creation of JOBOL, which refers to Java code that is written in a procedural style akin to COBOL, without leveraging Java's object-oriented capabilities. This can lead to code that is difficult to maintain, extend, or integrate with modern software practices and tools.

What Is JOBOL?

COBOL is a procedural language, while Java is a modern object-oriented language. During the conversion process from COBOL to Java, if the translation is done on a line-by-line basis without incorporating object-oriented principles, the resulting code can be classified as JOBOL. 

COBOL à JOBOL (Procedural Non-Object-Oriented Java Code)

Strategies for Effective Conversion

To mitigate the risk of falling into the pit of JOBOL, several strategies like below can be employed to evaluate the converted code by either Automation tools or AI.

Data-Oriented Conversion

Emphasize the creation of Plain Old Java Objects (POJOs) with appropriate getter and setter methods for data elements. This approach facilitates a more object-oriented design, enhancing maintainability and readability.

Elimination of Dead Code

COBOL applications, often decades old, may contain significant amounts of dead code. The conversion process presents an opportunity to identify and remove such code, streamlining the resulting Java application and improving performance.

Adoption of Event-Driven Architecture

Many COBOL applications are designed as batch processes. The conversion to Java offers a chance to reevaluate these designs and, where appropriate, transition to real-time, event-driven architectures. This can lead to more responsive and scalable systems.

Here is an illustration of how to circumvent the conversion from COBOL to JOBOL.

Step 1

I requested ChatGPT4 to generate a sample COBOL program based on the following specifications as below.

step 1

It generated a COBOL program that adheres to all specified requirements, including the addition of business logic to determine the account type based on age, categorizing it as either "Minor" or "Adult." Furthermore, the program includes five lines of unreachable code, fulfilling the request for dead code.

Link for entire ChatGPT Conversation.

Step 2

Then I prompted “Now convert this COBOL code to Java.” 

This Prompt has created the Java program with not much information on the file structures. Just a procedural code with not many Object-Oriented aspects taken into consideration. Also, the dead code is converted as well. A classic example of “JOBOL”.

Link for entire ChatGPT Conversation.

Step 3

Then I prompted as below:

The prompt generated the code, including corresponding POJO classes for the input and output file structures. These classes are referenced in the main class, which manages the business logic. This transformation results in a shift from procedural code to an object-oriented program. Additionally, any dead code has been eliminated during the code conversion process.

Link for entire ChatGPT Conversation.

Conclusion

The transition from COBOL to Java is a complex process that requires careful planning and execution. By adopting a data-oriented approach, eliminating dead code, and considering architectural shifts towards event-driven models, organizations can avoid the pitfalls of JOBOL and leverage the full potential of Java for their modernized applications.

COBOL Java (programming language)

Opinions expressed by DZone contributors are their own.

Related

  • Java 22 Brings Major Enhancements for Developers
  • The Power of LLMs in Java: Leveraging Quarkus and LangChain4j
  • How To Get Started With New Pattern Matching in Java 21
  • Getting Started With NCache Java Edition (Using Docker)

Partner Resources


Comments

ABOUT US

  • About DZone
  • Send feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: