What is the difference between OPM and ILE programming techniques on the IBM i System?
OPM (Original Program Model) and ILE (Integrated Language Environment) are two programming techniques used on the IBM i System.
OPM is the traditional programming model used on the IBM i System, which was inherited from the System/36 and System/38. It is a procedural programming model that uses a single program object to contain all the code, data, and control logic. In OPM, each program is a self-contained unit that can be compiled and executed independently.
ILE, on the other hand, is a more modern programming model that was introduced in the 1990s. It is an object-based programming model that allows for the creation of reusable code modules which can be used by multiple applications. ILE programs are compiled into modules, which are then linked together to create an executable program. ILE also gave us service programs – which contain common procedures that are used throughout the application.
Here is the same OPM Code example, refactored as an ILE RPG program. The code has not been modernised but just because it is in RPG FREE style it can now be compiled as a standalone bound RPG program or as a module (ready to be bound into an ILE Program):
The main differences between OPM and ILE are:
- Modularity: ILE programs are more modular, allowing for the creation of reusable code modules that can be used by multiple applications. OPM programs, on the other hand, are self-contained units that cannot be easily reused.
- Object-oriented programming: ILE supports object-oriented programming (OOP) concepts, such as encapsulation, inheritance, and polymorphism. OPM does not support OOP.
- Performance: ILE programs are generally faster and more efficient than OPM programs, since they can be optimized and compiled into machine code.
- Maintainability: ILE programs are easier to maintain and update, since changes can be made to individual modules without affecting the entire program. OPM programs, on the other hand, require changes to be made to the entire program.
ILE is a more modern and flexible programming model that offers many advantages over OPM. However, OPM is still widely used on the IBM i System, by many legacy applications which continue to use this programming model.
If you want to write ILE RPG Code (or CLLE) or migrate old OPM RPG3 and RPG400 to modern free format RPGLE then Visual Studio Code with the Code for IBM i Extension is what you need. Want to know more? Check out the course below:
Visual Studio Code for IBM i Programmers
Visual Studio Code (VS Code) is a popular source code editor developed by Microsoft that supports various programming languages, including IBM i (iSeries, AS/400) languages such as RPG, COBOL, and CL. With the help of extensions and plugins, VS Code can be transformed into a powerful tool for IBM i programming, providing features like syntax highlighting, code completion, debugging, and more.