I’m not saying that GDA, or external subroutines are good or bad, but everything has a trade-off. That’s why I asked you if a different approach exists. Sorry if I was misunderstood.
The concepts discussed are not from Java or other kind of language. It belongs to the design decision phase. Also, it’s not a OO concept, although OO languanges easily implement this approach. Information hidding is an old (about 1970-80) quality concept related to design, not to code. Although it interfers(positively) in the codification.
I agree with you. I can use the GDA only in the programs/subroutines that demands it. In the development phase it sounds good. The real problem appears in the maintenance phase. The GDA is visible to everybody (programers), then, one can use it freely and increments it in a uncontrolled way.
Regarding the in-line vs external subroutines, if I put in-line subroutines acessing the local data, all the variables in the program become shared among all subroutines. When a change needs to be done in the subroutine A, in order to fix a bug, another bug may be introduced in subroutine B, and so on, causing a chain of error propagation. This is a error-prone approach, and unfortunately is over-used in most companies.
I’m trying to construct a defensive design, increasing this way, the life-time of the system to be built.
The only wall between practice and theory is the human factor.