[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Unexpected lifetime of dataset member (REFERENCE-ONLY)

Status
Not open for further replies.
D

dbeavon

Guest
@frank.meulblok I have never seen a case where I had to worry about the lifespan of the DataInitializer utility class. It should probably be renamed, but it is basically a "factory" for static dataset instances. Once another class (eg. logic class) has bound to the same dataset, the "factory" class should be able to lose scope without any unexpected consequences. Are you certain that I will lose my dataset references, even if I have already used BIND to attach them to another class? I have never observed that to be the case. Please note that unlike the "DataInitializer" class, my regular logic classes deliberately AVOID having any datasets as members unless they are BY-REFERENCE (ie just pointers). A logic class should NEVER be designed with "IS A" relationships against the data that it is dependent on. This is because the dataset is considered a stand-alone object in its own right and may only be associated with the logic class for a particular purpose, after passing it in as a BY-REFERENCE parameter. Once that purpose has been served, the entire logic class is removed or replaced with another. The way OO classes interact with static ABL data is much too confusing. Perhaps there should be another modifier on static data in a class to say that the data references should NOT be pulled away once they are assigned (eg. "REFERENCE-ONLY STICKY"). In addition to that modifier, there needs to be some enhancements to the language to allow the UN-BINDING of static data and the TESTING of static data to detect whether it is bound. At a minimum, these are some of the things a programmer would need to better interact with static data from OO classes (see KB's: knowledgebase.progress.com/.../000057279 and knowledgebase.progress.com/.../How-to-test-if-REFERENCE-ONLY-temp-table-is-already-bound)

Continue reading...
 
Status
Not open for further replies.
Top