Procedures are the building blocks for an ILE application. They can be thought of as hybrid between subroutines and external called programs. Procedures can be created either in the same source member they are called from (similar to a subroutine) or in separate source members that will be compiled into modules (we'll cover modules a little later).
The ultimate vision of ILE involves building a foundation of procedures. Those procedures are then used to help build more procedures, and so on. Not only are generic programming utilities built into procedures, but your business rules are as well. For example, you may have one procedure to validate a customer number, and another one to create a new invoice for that customer. Each of those procedures may call other procedures.
The idea is to keep procedures small -- re-use as much code as possible instead of re-writing it. If two or more procedures have common code between them, the common code should be moved to another procedure.
Conceptually this is done by creating a low layer of procedures that handle basic functionality:
Once this foundation of building blocks is developed, another layer of procedures can be written that call those procedures when common functionality is needed:
This process is repeated as necessary until a full library of procedure utilities is developed. Keep in mind that procedures are not executable by themselves. Rather, they must be called by programs, similar to subroutines.
The benefit to all this, is that if enough forethought has been used designing the procedures, writing new programs is (theoritically) just a matter of writing some glue-code to bind together the procedures you need:
This modular system design philosophy provides many benefits over traditional systems design, not the least of which is the maximized re-use of code that has already been written, tested, verified, and implemented.
Also, note that the concepts we've talked about so far are not exclusive to RPG. Procedures may be written in any ILE language and combined with procedures from other ILE languages to form a single program.
In summary, some of the benefits offered by ILE include:
The above description of an ILE based system is the ultimate ILE solution. It will require a great deal of planning and design to reach this stage. However, ILE is not an all-or-nothing solution. There are many incremental benefits that can be obtained by using ILE procedures without re-writing your entire system.
In fact, there are many ways to implement ILE procedures as well. We'll start with the simplest, and work our way from there.
Send mail to email@example.com
with questions or comments about this web site.
Last Modified: December 27, 2000