TRecord or when less is more

José Luis Sánchez
Harbour Magazine
Published in
2 min readOct 23, 2017

Some months ago an old network application turn slow. The server of one office had been removed, and the application must be runned remotely from other office that mantains its server. Then the slowness problems sarted, to open a TFSDI https://cincomundos.wordpress.com/2006/06/13/fsdi2006/ form took almost 10 seconds. After several tests, I realized that the problem was the old version browse class I used, and just updating the Harbour + FWH version the aplication has an speed was just acceptable.

Then I realized than in this application I used a class to handle dbf files, and when I tried to compile it with the new Harbour version I had several errors that I could not solve. I had two alternatives: write all the affected with this class again in pure Harbour or update the class, which leads again to rewrite all the code because the new class version wasn’t compatible with the older one.

I took a third option. I rewrote all the affected code in pure Harbour and started using a dbf buffer hande class provided by Marcelo Via Giglio in http://forums.fivetechsupport.com/viewtopic.php?f=6&t=34402 . With this class I can handle all data fields in a dbf like data in an objects, and load/save them with a method call. It’s a simple solution, but it avoids me to learn the issues of other dbf handle class that surely has tons of features that I’ll never use. For me, less is more.

This TRecord class is published at https://github.com/JoseluisSanchez/TRecord and I’ve updated Colossus to show the use of this class, the new code is in the password management at https://github.com/JoseluisSanchez/colossus/blob/master/prg/pclaves.prg

Do you use third party classes and have lived scenarios like mine ? Are you for or against the use of these classes ? I wait your answerd in the comments.

--

--