Midware Ltd.

Procedures

Home
Services
News
AS/400
Employment

Sign-up for e-mail notifications

Take our weekly poll

Dow Jones Intraday

Nasdaq Intraday

 

 

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:

  • Code re-use:  Benefits programming productivity as well as program accuracy.  Once a procedure is tested and deemed to be bulletproof, you never again need to worry about the accuracy of that process.  However, as a programmer you should take the extra time to make sure a production procedure is coded accurately.
  • Maintenance:  When business rules change and additional functionality needs to be added to an application system, utilization of procedures can insure that a minimal number of procedures need to be changed and re-tested.
  • Pre-build library of procedures:  Once you move to ILE, you'll have access to literally hundreds of C procedures written by IBM that are already on your system.  These procedure provide access to a wide array of system function that were unavailable with OPM programming languages.
  • Encapsulation:  This term is traditionally associated with object-oriented programming languages (such as Java and C/C++).  Encapsulation refers to the idea of isolating a process or data set from a user, and only allowing it to be accessed or modified by a set of procedure that encapsulate (or surround) the entity.  Encapsulation provides many benefits, including data integrity and security.
  • Multiple Languages:  Because ILE programs may integrate multiple programming languages into a single program, you are allowed the luxury of writing procedures in the most appropriate language for the task.

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.

 
  Back to ILE Concepts Okay, enough fluff!  How do I code a procedure? 
 

Home Feedback Contents Search

Send mail to midware@midwareservices.com with questions or comments about this web site.
Copyright © 2000 Midware, Ltd.

Last Modified:  December 27, 2000