Automated COBOL Refactoring

Automated COBOL Refactoring

Automated COBOL Refactoring Our automated COBOL refactoring philosophy is centered on producing functionally equivalent, human-maintainable, quality-driven code positioned on Cloud ready target frameworks and platforms. COBOL-to-Universal (CTU), our proprietary toolset, powers the automated refactoring process. Translating a procedural language such as flow normalization, code restructuring, data COBOL, to an object-oriented language such as layer extraction, data remodeling, and packaging Java, presents a myriad of challenges. Thus, CTU for reconstruction. Upon reconstruction, new was designed around these absolutes: object-oriented code structures are generated and deployed into the target environment and > The refactored application must behave enabled by CTU’s native Java framework. exactly the same as the original application and produce the same results CTU’s Native Java Framework > The refactored application must be human- CTU-refactored applications are underpinned maintainable and follow object-oriented by a Java framework containing a collection concepts and paradigms of libraries supporting common functions (application lifecycle, marshalling, data I/O, > The refactored application must perform as logging, MVS utility replacement, support well or better than the original application in functions, etc.) that exist in the legacy system the target modern environment but are not directly translatable to a modern Java > The resulting applications should be Cloud- environment. The framework effectively gathers ready and delivered through an automated all common functionality into a single place, code pipeline using a standard DevOps significantly reducing the amount of generated toolchain and best practices code while improving the separation of concepts. CTU deconstructs the legacy codebase to isolate CTU’s Java Framework is a collection of libraries source code and classify down to the field level. without native components, designed to work It then refactors the assets using customized with both standard Java Edition and Enterprise rules based on customer requirements and Edition platforms. It is retained by the customer, standards. This refactoring process includes in their modernized environment, and can be FACT SHEET Automated COBOL Refactoring used as a Maven repository or optionally functionality and exposed as a service (business licensed with the source code, allowing the client logic layer), which interacts with the data access to enhance and extend as necessary to meet layer through the CTU framework. All database ongoing modernization requirements. and file operations from the original COBOL code are externalized in data access object The Framework provides support for emulating (DAO) classes and Java Persistence Architecture key COBOL and JCL functionality such as the (JPA) mapping files (the data access layer). The translation of COBOL functions to equivalent presentation layer is generated by delivering the Java functions, support for sequential files, VSAM legacy screens as HTML pages in a web browser to relational modelling, and Online Transaction using Angular, and batch JCL is refactored to JSR- Processing (OLTP) support (e.g. CICS API, TD 352 XML, which interacts with a distributed job Queues, TS Queues, TP session, etc.). In addition, scheduler of the customer’s choice. the Framework handles configuration settings, data types not supported in Java, marshalling These layers can be implemented using a of read/writes for data types, EBDIC to ASCII variety of products to accommodate for specific encoding, and sessions to retain application customer architectural requirements while context on a per thread basis. providing the robustness necessary for high volume, high-uptime applications. The Framework also leverages the Spring Batch runtime, a light-weight open source framework The resulting refactored code is readable and used for supporting batch processing (symbolic maintainable, following Java standards and object- replacement, COND evaluation, return code oriented concepts. The COBOL business logic handling, GDG support, SYSOUT redirection, and comments are preserved, and individuals utilities, etc.). familiar with the original application can easily understand the refactored code. High-Level Architecture Human maintainability is a complex problem for Basic Mapping automation to solve, particularly when taking a CTU wields a strong mapping component that procedural codebase to an object-oriented one. produces an object-oriented model that best Java developers work in a universe of indirection, represents the procedural source. The code where applications reference databases without produced by this mapping component can be knowledge of the structure or contents therein. further refined after the modernization project Conversely, there is no layering or indirection with to optimize fit and function with the overall COBOL applications running on mainframes. To framework and architecture of the target accommodate for this architectural difference, environment. CTU refactors the source into a three-tier The table below illustrates the basic mapping application. from procedural COBOL to object-oriented Java. Put simply, each COBOL program (online and batch) is refactored to a Java class with equivalent Automated COBOL Refactoring The basic mapping from procedural COBOL to object-oriented Java Mapping decisions also extend to structural source. Thus, modifications can be made to the considerations around copybooks such as clone DAO implementation without altering decoupled detection and handling. Since CTU deconstructs modules of the application. the source, it effectively eliminates copybooks, Java Persistence Architecture (JPA) is used to aggregating cloned code (code that appears in facilitate multiple database engines, where repetition across the estate) into programs and database DTOs are created from SQL table methods as necessary. The result of automated definitions and all queries in a DAO are structural decisions such as clone detection and externalized to a yml mapping file, further handling is a smaller target codebase footprint simplifying the maintenance and extension of and more maintainable Java. queries. Ultimately, CTU is designed to optimize mapping Clone detection and handling applies to the data decisions to use the objects which best fit access layer in much the same way that it does the overall architecture of the system while in the program structure. If the COBOL code prioritizing performance and maintainability. contains more than one SQL statement of the same type (even across different programs), only Data Access Layer one Java method will be created inside the DAO. The logic used to handle files and databases In this instance, the DTOs contain all information is decoupled from the main COBOL structure related to a specific SQL table, and the DAOs using a Data Access Object (DAO) design represent a collation of different SQL statements pattern. By using a standard Java design pattern, related to the table. In sequential file access CTU ensures the refactored code is easier to scenarios, clones are detected and handled in understand, maintain, and extend. The DAO such a way that the DAOs use framework calls to assures communication with external data IFileOperations to emulate the original COBOL, sources (files and databases), while the Data and file DTOs are created from COBOL variables Transfer Objects (DTO) are used to transport associated with each descriptor. data between the program and external data Automated COBOL Refactoring Business Logic Layer Conditional names (88 level) are a bit more During the restructuring of code to create the complicated and are either refactored to Java business logic layer, CTU refactors each COBOL booleans or to classes. Conditional names with program to a Java class. This class encapsulates multiple values and 88 levels with only two all working storage fields and paragraphs, and values that do not contain boolean values (Y/N, exposed as a service to the main entry point in YES/NO, TRUE/FALSE) are refactored to a set of the run() method. named constants in an enum-like class. 88 levels with only two values that are represented with Each paragraph becomes a private method in boolean values are refactored to Java boolean the Java program class where program structure types. and comments are preserved to simplify maintenance. Program flow is normalized and Presentation Layer GOTOs, EXIT paragraphs, and dead code (flow The primary aim of the presentation layer and data) are removed. Normalization replaces transformation is to maintain functional GOTOs and fall through behavior with a statically equivalence. To achieve this, CTU essentially determined code, resulting in minimal change to refactors 3270 screens to HTML5 equivalents the program structure, while retaining the original that look and feel the same as their legacy conditional statements and constructs. counterparts. Screen layouts are maintained, Each copybook that contains only data will be PF and return keys are fully supported using translated to a single class which can be reused JavaScript event handling routines, and arrow across the entire application. key navigation between fields is retained as-is, removing the burden of re-training end users. COBOL data structures are analyzed and remodeled to maximize encapsulation, reuse, and CTU's automated refactoring process takes readability, while minimizing memory footprint for legacy screens to Angular using fixed-width fonts

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us