Re: Rapid Development system
Posted in 1998
Dave Adams wrote: > > In <34BBD91F.5210@bloomberg.com>, "Art S. Kagel" <kagel@bloomberg.com> writes: [REAALLYY OLD POST REFERENCE SNIPPED] [Dave's other stuff SNIPPED] > We are attempting to provide an environment where a c4gl-based application > can be recompiled under RDS to facilitate debugging. I'm now breaking out > the 4gl portions of our standard libraries into a new source code library > just for debugging purposes, but I don't have any good solution for dealing > with the ESQL/C code that manipulates 4gl global variables directly. I'm > appealing, therefore, to the combined wisdom of this group (hi, John!) for > any insight into the problems listed above. Our environment includes AIX > version 4.2 for the RS/6000 series computers, Online DSA 7.22.UC2 engine and > fglgo/fgldb version 6.04.UC3 with pcode version 602. The compiled functions > (4gl and esql/c) were compiled via c4gl version 6.04.UC2. The ultimiate solution is: DO NOT USE GLOBAL VARIABLES FOR INTER-MODULE COMMUNICATION! The inter-module cohesion this produces is the entire cause of ALL of the problems that you are having with this application and also the cause of many, as yet, undiscovered bugs you will have to solve later. ALWAYS pass data between modules using the function/procedure calling conventions unless it is absolutely neccessary. I try to avoid this in my 4GL code as much as possible, but it is inevitable withing 4GL that I will use globals. However, when I interface between 4GL and C or ESQL/C I avoid global variables like the plague as I do in my pure C and ESQL/C coding. I even make it a habit to preceed the declaration of the few unavoidable globals with some version of the following comment: /* GLOBALS -- I HATE THESE THINGS! */ As a reminder to not add anything to the global declarations without serious thought. Art S. Kagel