• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Untangling Legacy Spaghetti Code To Cook Up Microservices

    August 12, 2024 Michel Mouchon

    At this point in the history of programming, everyone pretty much knows what microservices are and everybody is more than acquainted with the legacy code – and often monolithic code – that has been created over decades by countless programmers who have evolved corporate applications to fit new conditions and new demands.

    It is often called spaghetti code, and for good reason. The code is often a tangled mess of business logic and data – presumably the data is the meatballs and the user interface is the sauce in this metaphor. (It is important to not take a metaphor too literally, of course.) While ARCAD Observer can help IBM i developers figure out the architecture of these applications and ARCAD Transformer RPG can help convert older RPG applications to modern free form RPG – in this metaphor, these help you figure out what you are going to eat of the spaghetti code. But a new tool called ARCAD Transformer Microservices, ARCAD is now helping developers figure out where to bite first as they try to eat that plate of spaghetti code to change it into modern, modular microservices, one piece of spaghetti at a time without risk of splashing tomato sauce or meatballs on users’ white shirts.

    ARCAD Transformer Microservices was introduced in early July, and it has some customers that are early adopters who have driven its creation but it is important to note that it is still in active development and ARCAD is still enthusiastically taking in feedback from customers to make the process of changing monolithic code into microservices easier and more efficient.

    The tool can be used on RPG IV and later releases of the preferred programming language for OS/400 and IBM i platform, and RPG III programs originally written for IBM 38 systems can be mechanically ported to RPG IV and then have Transformer Microservices help developers change the business logic in the resulting RPG IV programs into modular chunks of code that can be individually maintained and reused in new applications. ARCAD Transformer Microservices generates free form RPG code. At the moment, Transformer Microservices is a plug in for the Rational Developer for IBM i (RDi) integrated development environment, but over time it will also be a VS Code extension, which is becoming more and more popular among the IBM i base.

    The creation of ARCAD Transformer Microservices is a testament to the difficulty of trying to identify the correct level of granularity and encapsulation for business rules to create a Web service. If you make the encapsulation to coarse, you end up with smaller blocks of monolithic code, but it is still fairly big chunks that have to maintained and enhanced as a whole. At too small of a granularity, there will be too many microservices that comprise the application and this could create a different kind of complexity that is time consuming and costly to maintain.

    The trick with converting legacy monolithic RPG code into microservices is to get the balance just right, and that is what Transformer Microservices is all about. It includes:

    • Module selection guidance: RPG code highlighting for module extraction, aiding developer in selecting web service candidates
    • Verification of coupling: Automatic identification of ”entangled code” to ensure the consistency of the extracted modules
    • Creation of parameters: “Interface” Variables are transformed into parameters to simplify tightly coupled code
    • Code audit: The developer is notified of any anomalies and assisted in adding any additional code that needs to be included
    • Simulation and Code explain: the developer retains control over the transformation, without locking the code during audit and analysis activities
    • Automated module extraction: A new procedure is automatically generated based on selected lines
    • Code replacement automation: Replacement of the previous block of code with a call to the new procedure
    • Duplicate logic detection: Any duplicate functionality is automatically identified and refactored into a single reusable procedure, improving code quality and avoiding repeat maintenance.

    The goal of Transformer Microservices is to isolate business rules and business logic embedded in RPG applications and extract them from the legacy code to create a service program that could be used as a Web service. But it is more than that. Because RPG applications are maintained by the ARCAD software change management system, Transformer Microservices can reach into the existing code and replace that chunk of legacy code with a call of this service program. It sounds easier than it is, and in many cases, doing such an analysis to figure out where to extract the business logic to create the service program and resolving dependencies and redundancies in the application code is quite complex. Figuring out where to start chewing on the monolithic legacy code and working out all of the variables and dependencies is one chunk might take the better part of a day, but with Transformer Microservices, which has a broad and deep view of the application and its data structures and databases, this might only take minutes. And so, Transformer Microservices can radically speed up the time it might take to refactor applications to be more modern and more maintainable.

    Transformer Microservices does not employ any kind of generative AI to make its recommendations or to make changes to spaghetti code – it is a strictly deterministic set of algorithms that has repeatable and auditable results, which should be a great comfort to the managers and developers at the IBM i shops that deploy it. That is not to say that ARCAD may not at some future point weave in some generative AI capabilities into ARCAD Transformer Microservices (as for some other products in the range, such as the application discovery module, ARCAD Discover, which is already AI-powered).  So far in ARCAD Transformer Microservices, generative AI has not been necessary, as this part of the modernization process requires a result with 100% predictability.

    In some cases, legacy code is so intertwined and complex that refactoring it and modularizing it is very difficult, with interdependencies being so numerous that a human programmer cannot keep track of them all. (There are reasons why applications become spaghetti code and there are other reasons – inertia, cost, time, and so on – why they persist). This is true of companies that have hundreds of thousands of lines of code as well as those who have tens of millions of lines of code. For those who are only managing tens of thousands of lines of code, their applications are relatively small and are very likely already more modular.

    But for everyone else, Transformer Microservices provides many things as companies refactor their code: Speed and agility, but as well, the security and quality of the result.

    The solution bets on the value of the existing code assets to provide modern and secured digital applications.

    Michel Mouchon is chief technology officer at ARCAD Software.

    This content is sponsored by ARCAD Software.

    RELATED STORIES

    DevOps Means Using The Tools You Already Have Better

    Hybrid Release Management Means Creating An Application Schema

    Take A Progressive Approach To DevOps

    The First Step In DevOps Is Not Tools, But Culture Change

    VS Code Is The Full Stack IDE For IBM i

    Realizing The Promise Of Cross Platform Development With VS Code

    If You Aren’t Automating Testing, You Aren’t Doing DevSecOps

    The Lucky Seven Tips Of IBM i DevSecOps

    Git Is A Whole Lot More Than A Code Repository

    Learning To Drive Fast On The DevOps Roadmap

    Expanding Fields Is A Bigger Pain In The Neck Than You Think

    Value Stream Management: Bringing Lean Manufacturing Techniques To IBM i Development

    Unit Testing Automation Hits Shift Left Instead of Ctrl-Alt-Delete Cash

    It’s Time For An Application Healthcheck

    The New Economy Presents New Opportunities For IBM i

    Creating Web Services APIs Can Be Easy On IBM i

    Jenkins Gets Closer IBM i Hooks, Courtesy Of ARCAD

    DevOps Transformation: Engage Your IBM i Team

    The All-Knowing, Benevolent Dictator Of Code

    Software Change Management Has To Change With The DevOps Times

    Attention Synon Users: You Can Automate Your Move To RPG Free Form And DevOps

    Git Started With GitHub And ARCAD On IBM i

    One Repository To Rule The Source – And Object – Code

    Data Needs To Be Anonymized For Dev And Test

    Getting Progressive About Regression Testing

    Transforming The Art Of Code And The Face Of IBM i

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: AI, ARCAD Software, ARCAD Transformer Microservices, IBM i, OS/400, Rational Developer for IBM i, RDi, RPG, RPG IV, VS Code

    Sponsored by
    ARCAD Software

    Datasheet: ARCAD Transformer Microservices

    ARCAD Transformer Microservices is a tool for modernizing RPG code. It modularizes code automatically by refactoring RPG and creating web services.

    Open your IBM i to the future of digital:

    • Modular transformation: Convert monolithic or redundant code within your IBM i applications into a modular set of functions for easy use as web services.
    • Secure access: Use existing DB2 database logic via web and mobile applications.
    • Enhanced connectivity: Connect existing web applications to proven IBM i application functionality.

    The Business Issue

    IBM i applications often contain valuable business rules crucial to organizational competitiveness. Transforming these applications to an n-tier architecture, which combines existing business logic with modern web or mobile interfaces, requires a robust web services layer. However, the monolithic and complex nature of RPG code necessitates careful refactoring to prevent reliability issues and maintenance challenges.

    The Solution

    ARCAD Transformer Microservices automates the extraction of business rules from legacy IBM i applications, transforming them into RESTful web services. Key capabilities include:

    • Selection of RPG Code Blocks: Helps developers choose the most important candidates for web services.
    • Verification of Code Coupling: Identifies and ensures the consistency of entangled code.
    • Transformation of Variables into Parameters: Converts variables used outside the code into parameters.
    • Code Audit: Notifies developers of anomalies and assists in adding necessary code.
    • Module Extraction: Generates new procedures from selected lines of code.
    • Code Replacement: Replaces old code blocks with calls to new procedures.
    • Upcoming Feature: Identifies and refactors similar code to avoid duplication.

    Once refactored, business rules can be exposed as web services using RDi, making them ready for web or mobile application use.

    Strengths

    • Unique tool for transforming complex code into reusable modules and web services.
    • Compatible with all RPG variants.
    • No specific application knowledge required.
    • User-friendly interface for developers.
    • Can be integrated with other ARCAD tools and RDi (soon VS Code).

    Benefits

    • Opens IBM i technology to modern web/mobile technologies.
    • Connects web applications to IBM i functionality.
    • Maintains security, reliability, and performance of IBM i back-end.
    • Improves code robustness.
    • Eliminates migration/reengineering risks.
    • Reduces technical debt through automated refactoring.
    • Cuts project costs with significant productivity gains (70% compared to manual efforts).

    Get the Datasheet

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Guru: Creating A Web Service With Basic Authentication Some Thoughts On Big Blue’s GenAI Strategy For IBM i

    One thought on “Untangling Legacy Spaghetti Code To Cook Up Microservices”

    • ema tissani says:
      August 26, 2024 at 9:50 am

      spaghetti is in the software architecture.
      you can still “spaghetti” microservices, in the way you create the graph of dependency between them to produce a complex emergent behaviour. And if done, it’s not pretty, especially if distributed ; )

      Reply

    Leave a Reply Cancel reply

TFH Volume: 34 Issue: 39

This Issue Sponsored By

  • Fresche Solutions
  • ARCAD Software
  • New Generation Software
  • Raz-Lee Security
  • WorksRight Software

Table of Contents

  • Some Thoughts On Big Blue’s GenAI Strategy For IBM i
  • Untangling Legacy Spaghetti Code To Cook Up Microservices
  • Guru: Creating A Web Service With Basic Authentication
  • IBM Bolsters Run SQL Scripts In ACS 1.1.9.6
  • IBM i PTF Guide, Volume 26, Number 31

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23
  • SEU’s Fate, An IBM i V8, And The Odds Of A Power13
  • Tandberg Bankruptcy Leaves A Hole In IBM Power Storage
  • RPG Code Generation And The Agentic Future Of IBM i
  • A Bunch Of IBM i-Power Systems Things To Be Aware Of
  • IBM i PTF Guide, Volume 27, Numbers 21 And 22

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle