× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



*       Several sources I have read imply that a module should consist
of a single sub-procedure.

Problems:

a) This makes it impossible for two routines to share an open file. Consequently, every routine has to have it's own open files and that's just not efficient. It also causes havok with record locking (if you're not very careful.)

b) It leads to a monolithic programming mindset. It's true that you CAN write modular code with only one procedure per module, but what tends to happen is that people start to think of modules the same way they think of programs (which also have only one entry point) and programmers tend to fall back on the way they've always done things, automatically. This leads to the monolithic code and defeats the purpose of modularization.

c) As alluded to in the previous point, you're really throwing away the advantages of ILE and modular design in general. You have nothing with this approach that you couldn't already do in OPM programs. Well, other than the speed boost of calling a bound procedure instead of a dynamic call... which is rarely significant.

I think one-procedure-per-module is a very poor design choice. And it does lead to a maintenance nightmare as well, as you'll soon be dealing with 15000 source members instead of 200. Yuck.

*       I can live with the idea of more than one sub-procedure in a
module as long as they are only used locally, but I'm having trouble
with the idea of modules with more than one sub-procedure. The compiler
allows this to occur and to my mind it must be very difficult tracking
the relationship between programs, modules, and sub-procedures.

I disagree wholeheartedly. In my experience putting only one procedure in a module is an absolute maintnenance nightmare.

And please do remember that there are a lot of people with experience on this subject. RPG has had this capability for more than a decade now, and every other language has had the capability for longer. Every program written for every computing platform uses modular code. Try to find a significant software project in C where they put only one function per object. Try to find one in C++. Try to find some non-trivial Java software where all of the classes have only one method. I bet you can't, in any of these cases. I could go on to name more languages and platforms -- nowhere in any modern language to people limit themselves to one procedure per module. The ONLY time people do that is when they're using a non-modular language like RPG III, where there's no choice.

*       My other beef with the module/sub-procedure relationship is the
size of the name - if the sub-procedure name can be 15 and the source
member name is 10, then we immediately have an issue. I am then faced
with having to have a naming standard which encodes the sub-procedure
name, or have to restrict my sub-procedure names to 10 characters.

Not sure where you got the number 15 from. (Subprocedure names can be, for all practical purposes, any length you want.)

I don't understand why a 25 character naming standard is a problem -- other than it's cumbersome to type -- and I don't understand why you need to restrict your subprocedure names to 10 characters. Is there somewhere that it's important to have 20 character names or less?

I'm lost.

Do other ILE developers restrict themselves to a single sub-procedure in
their modules?

I don't know of any successful implementation of ILE or any other modular environment where they've done this. Only in OPM or comparable non-modular languages do people do this.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.