Progress 4GL concept

Reynold

Member
Hello All,

Just need to know 2 concepts behind Variable & temp-table.
1) If we define some variables in a program but we are not using it. Still progress uses some space either in memory/disk for those unused variables?
2) Suppose If we define 4 temp-tables like some DB tables and in our code we are using only 1 table and rest we are not using for any data storage. Still progress allocates some memory or disk space for those unused tables?

These above cases are for some common files which can be used in multi programs that's the reason we need such scenario.

I just want to know the concept behind that. please help.

Thanks.
Ray
 

tamhas

ProgressTalk.com Sponsor
Yes, in both cases space will be allocated whether you reference the variable or TT or not. In version 11.0, there will be an enhancement such that the TT will not be initialized until it is actually referenced so space would not be consumed until the TT is actually used, not just referenced. I.e., there could be conditional logic so that it was used some times and not others, and it would only be allocated when actually used. Not having this has led to what is called the TMTT or Too Many Temp-table problem in which some sites who have done as you propose end up with significant performance problems because there are so many TTs that the empty ones are causing a slop to disk.

Which said Don't Do That˜ Defining variables and TTs in a program and than not using them is going to make your analysis much more difficult. Moreover, it is a symptom of not thinking in terms of encapsulating functionality. Wrap those TTs in programs, persistent procedures, or classes and provide methods to manipulate them and they will only need to be defined in one place. No bleeding functionality. No mysterious interactions. Just a clean testable piece of reusable code.
 

RealHeavyDude

Well-Known Member
Again I can only second what Tamhas said:

I'll take it that you are thing about using include files. While include files still find justification you should be aware that they are a coding technique dating back from the beginning of Progress. Nowadays utilizing a modern application design you should not rely and that technique to bring common functionality into your programs anymore. Instead you should encapsulate that common functionality and provide it in the form of persistent procedures or objects. Not because of memory consumption for superfluous variables or TTs included into a program where they are not need. Include files are sucked in at compile time which makes you r-code larger than need be bringing other performance penalties with it. Plus, they do not make your code transparent and promote re-usability - the do make the opposite.

Heavy Regards, RealHeavyDude.
 
Top