S
ske
Guest
I totally agree that it would be preferable for ABL to allow local temp-tables in methods. And if I would choose between our suggestions and just keeping the temp-table at the class level, I too would choose the class level. It just seemed to me, originally, that you were objecting so strongly to having to do that, that it seemed to be interresting to come up with various other alternatives that would avoid keeping it at the class level. (Which is easier for us to do than changing ABL.) But of course there will be some trade-offs in doing so. I do accept your objections to these suggestions as motivation for desiring real local temp-tables in ABL. I don't want to detract from that. And I don't really see our suggestions as being better than keeping the temp-table at the class level. - But in general, in other cases, for my own part, I would now and then accept some flexibility or "creativity" when interpreting the principles of "good" OO design, if it allows me to get closer to the gist of these same principles, and if there were no other work-arounds. (E.g if there were no class level temp-tables either, or if I needed recursion too.) I'm used to having to make do with whatever the current language provides. And it can be a bit of fun, too. For instance, if you would just pretend that the helper class in my suggestion is not a "real" class of its own, then it all works out just like a local temp-table, good OO principles notwithstanding. I don' see much of a risk for problems in practice with that, even if at some literal level it may be seen as breaking the principles. And the concept of "friend" classes with access to each other's implementation is not new, and have many uses, although each one can be debated, of course. Although ABL is lacking a FRIEND option too, as well as local/private classes inside classes, which would make this work-around less public. Regarding passing temp-tables as parameters exposing the implementation, does that mean you don't like passing record buffers either? What about passing structs around, in other languages? I can see the point of only passing around objects, but I'm not quite that strict myself.
Continue reading...
Continue reading...