briteskies-knowledge-base

The Benefits of Modular ILE RPG

Bill Onion
06/2023

There’s an old saying that nothing happens in a vacuum and the IBM i infrastructure is no different.

Modifying one program, one file, one line of code can have a ripple effect. If not done correctly, one small change can cause hours of headaches and work. But if done correctly, one small change can exponentially improve your business procedures and help move your IBM i modernization efforts along.

Reduce, Reuse, Recycle

RPG ILE, one of the more modern RPG languages, boasts the benefits of an object-oriented format, an idea that is helpful for the sake of ‘write once, use everywhere’. By utilizing modular techniques, you’re able to reduce, reuse, and recycle sections of your code. Breaking programs into smaller “objects” and connecting them together as singular pieces of a chain allows the code to be written faster, function quicker, and be debugged in a simpler operation.

The idea of reusing code is particularly popular in the topic of modernization and why using object-oriented language is considered superior to using the older methods of procedural programming.

Let’s take a data element like customer lookup, for example. The IBM i can call to this data for a variety of business needs, but if you boil it down, the four main uses of the data will be to retrieve, display, update, or delete. While an ERP may have thousands of stored customer data files, the code which calls the data can stay the same, with the only uniqueness being which customer information it’s accessing.

This means that every time a business needs to call customer information, whether that be for purchasing, invoicing, shipping, billing, or creating customer master lists the same program can be utilized to access the necessary customer information.

Write once, use often

These pathway programs can be, and should be, stored in the IBM i library allowing other projects, applications, and developers to take advantage of and build on work that has already been done. It’s for this reason that modularization has become part of the IBM i modernization ideal.

While all new code should certainly be written in an object-oriented style, it should also be practiced when converting old code to free form. In these modernization projects be sure to take the full-picture into account. This includes defining all the places the code is currently being used, as well as where it could be used in the future. When creating plans for new code, Identify ways to create building blocks of code that can be utilized in various locations and develop accordingly. While it may seem easier and quicker to code with a specific need in mind, taking the time to create reusable programs will pay dividends down the line.

Questions? Contact Us For More Info

Subscribe by Email

No Comments Yet

Let us know what you think