Ok, not sure if this is the right forum for this question, but to my mind it should be.
I am looking for suggestions or descriptions of best practices for setting up (or more accurately, changing) the calling structure for an application.
Here's the scenario:
We have a fairly large code base of applications (hundreds of programs and well over 10M SLOC) in Cobol running under Linux. All the programs are interlinked by hard-coded program calls. 99% of the program calls use absolute path names to identify their targets.
The problem this creates is that it makes it difficult to set up multiple independent development/test environments. Doing so requires maintaining separate copies of the source code with all the hard-coded links overridden to point to the current development environment.
When I was in the mainframe world, we used to manage this issue by concatenating multiple program libraries in the JOBLIB or STEPLIB. The equivalent in a *nix setup is to catenate multiple search directories pointed to by the PATH environment variable. And there's the rub, since all our called programs are identified by absolute fully qualified path names there's is no searching the PATH. So...
What are we to do?
As I see it, these are our options:
0) Status Quo
[ul]
[li]Pros: No immediate impact to production environments[/li]
[li]Cons: continuing bottleneck for multiple development efforts[/li]
[li]Risks: continuing degradation of ability for development to meet changing needs of business[/li][/ul]
1) Rewrite all application programs to use a centralized called program manager
[ul]
[li]Pros: maximum flexibility[/li]
[li]Cons: significant effort required with little immediate visible gain to justify the work[/li]
[li]Risks: high probability for errors based on integration of new code into existing code base[/li][/ul]
2) Remove all hard-coded links and fall back to using the PATH mechanism for controlling program versions that are executed
[ul]
[li]Pros: minimal code change, gain required flexibility, code changes can be largely automated[/li]
[li]Cons: requires validation of PATH setup for all existing users[/li]
[li]Risks: minimal risk for code translation errors, slight risk for user setup errors[/li][/ul]
3) Replace all absolute path names for called programs with relative path names
[ul]
[li]Pros: same as for #2, does not rely on PATH setup of users[/li]
[li]Cons: requires specialized links to be set up for each execution environment[/li]
[li]Risks: easy to crash production environment by destroying local links[/li][/ul]
I have proposed both options 2 and 3 before to my management, but they have always been reluctant to consider implementing either change. I think, somewhere in the past, they were bitten by an issue caused by executing the wrong version of a program and therefore are afraid to leave the security of their hard-coded absolute program identifiers. But we have got to do something...
Does anybody have any other suggestions for dealing with this type of situation?
Code what you mean,
and mean what you code!
But by all means post your code!
Razalas
I am looking for suggestions or descriptions of best practices for setting up (or more accurately, changing) the calling structure for an application.
Here's the scenario:
We have a fairly large code base of applications (hundreds of programs and well over 10M SLOC) in Cobol running under Linux. All the programs are interlinked by hard-coded program calls. 99% of the program calls use absolute path names to identify their targets.
The problem this creates is that it makes it difficult to set up multiple independent development/test environments. Doing so requires maintaining separate copies of the source code with all the hard-coded links overridden to point to the current development environment.
When I was in the mainframe world, we used to manage this issue by concatenating multiple program libraries in the JOBLIB or STEPLIB. The equivalent in a *nix setup is to catenate multiple search directories pointed to by the PATH environment variable. And there's the rub, since all our called programs are identified by absolute fully qualified path names there's is no searching the PATH. So...
What are we to do?
As I see it, these are our options:
0) Status Quo
Code:
CALL "/usr/apps/next-program.cob"
USING PASS-DATA...
[li]Pros: No immediate impact to production environments[/li]
[li]Cons: continuing bottleneck for multiple development efforts[/li]
[li]Risks: continuing degradation of ability for development to meet changing needs of business[/li][/ul]
1) Rewrite all application programs to use a centralized called program manager
Code:
MOVE "next-program.cob"
TO NAME-OF-NEXT-PROGRAM
*** PROGRAM-MANAGER looks up location of
*** next program from some data store
*** and effects the transfer of control
CALL PROGRAM-MANAGER
USING NAME-OF-NEXT-PROGRAM
PASS-DATA...
[li]Pros: maximum flexibility[/li]
[li]Cons: significant effort required with little immediate visible gain to justify the work[/li]
[li]Risks: high probability for errors based on integration of new code into existing code base[/li][/ul]
2) Remove all hard-coded links and fall back to using the PATH mechanism for controlling program versions that are executed
Code:
CALL "next-program.cob"
USING PASS-DATA...
[li]Pros: minimal code change, gain required flexibility, code changes can be largely automated[/li]
[li]Cons: requires validation of PATH setup for all existing users[/li]
[li]Risks: minimal risk for code translation errors, slight risk for user setup errors[/li][/ul]
3) Replace all absolute path names for called programs with relative path names
Code:
CALL "Programs/next-program.cob"
USING PASS-DATA...
[li]Pros: same as for #2, does not rely on PATH setup of users[/li]
[li]Cons: requires specialized links to be set up for each execution environment[/li]
[li]Risks: easy to crash production environment by destroying local links[/li][/ul]
I have proposed both options 2 and 3 before to my management, but they have always been reluctant to consider implementing either change. I think, somewhere in the past, they were bitten by an issue caused by executing the wrong version of a program and therefore are afraid to leave the security of their hard-coded absolute program identifiers. But we have got to do something...
Does anybody have any other suggestions for dealing with this type of situation?
Code what you mean,
and mean what you code!
But by all means post your code!
Razalas