Hi everyone
Hi everyone,
I am writing object classes to describe aspects of patients in a healthcare app and am bogged down in writing the database connectivity to Firebird. Lots of lines of code getting and setting data to and from class fields and database fields. I want to automate this. Of course the solution is to use an ORM or even MORMOT but that's a whole new learning curve (especially MORMOT) and I want to minimise 3rd party components, and also maintain compatability with Lazarus (I know MORMOT and TMS Aurelius work on Lazarus too). Third party components make for Delphi upgrade hell. So prefer and would be happy with generic plain code, in this case to just automatically parse a class's fields, and then database table’s fields and with a given stringlist of associated field names then shift the data in one direction or the other. Adding or removing fields to the class and database would just require adding or removing the field names from the stringlist. Has anyone done this, have a code example? Parsing database fields is easy in a TDataset. But I can't find how to parse any class's fields. Any ideas? Thanks. Martin
I am writing object classes to describe aspects of patients in a healthcare app and am bogged down in writing the database connectivity to Firebird. Lots of lines of code getting and setting data to and from class fields and database fields. I want to automate this. Of course the solution is to use an ORM or even MORMOT but that's a whole new learning curve (especially MORMOT) and I want to minimise 3rd party components, and also maintain compatability with Lazarus (I know MORMOT and TMS Aurelius work on Lazarus too). Third party components make for Delphi upgrade hell. So prefer and would be happy with generic plain code, in this case to just automatically parse a class's fields, and then database table’s fields and with a given stringlist of associated field names then shift the data in one direction or the other. Adding or removing fields to the class and database would just require adding or removing the field names from the stringlist. Has anyone done this, have a code example? Parsing database fields is easy in a TDataset. But I can't find how to parse any class's fields. Any ideas? Thanks. Martin
Hi Arnaud, MORMOT is the ORM I would consider in particular mainly because of your tireless advocacy and enthusiasm for the project, and the built in client server REST structure. Why didnt Emb use it in their RADserver offering? I dowloaded it about a year ago but didnt take the plunge in production code. Will look again.
ReplyDeleteUwe Raabe Thank you for it. It has become now a central part of any development we do. TDataSet should have it by default.
ReplyDeleteEsteban Pacheco Things go slowly in Embarcadero land.
ReplyDelete