Midware Ltd.
|
Sign-up for e-mail notifications
|
In the previous example, we used to CRTPGM command to bind two modules into a single executable program. This type of binding is called static. The program contains a fully copy of both of the modules. The modules can (and unless they will be used to create other programs, probably should) safely be deleted. The program can be distributed to other AS/400's without the modules and it will run normally. There are pros and cons to static binding. The main advantage is that the compiled program has already resolved all the procedure calls. Procedure calls create roughly the same overhead as a subroutine call. There are several drawbacks to static binding however. First, the executable program is larger than it needs to be. If the procedure module is used in multiple program, a separate copy of it will exist in each program. This leads us to the main drawback of static binding. If the procedure module needs to be changed (to fix a bug for example), all programs that use that module must be re-created (with the CRTPGM) command.
We see from our comparison chart that static binding of modules is comparable to procedure copybooks. I would not recommend using procedure copybooks however, as it complicates moving forward with other ILE functionality. There is an alternative to static binding. By incorporating one additional step, you can take advantage of the flexibility of dynamic binding.
|
Send mail to midware@midwareservices.com
with questions or comments about this web site. Last Modified: August 31, 2000 |