Help in generating Delphi DFM based on database tables (scaffolding?)

I am new to delphi, and I am looking for ways to learn more about technologies related to delphi, and do something useful here in my work in this process, also, if anyone has a hint or see, I can improve my idea please feel free to speak on your mind ...

I want to make some kind of scaffolding for dfms, the ideal is this: I want to create Firebird databases based on a table - with clearly defined domains - the main part of the form.

I think the idea is too simple or I don’t see the big picture that makes it difficult, I try not to invent well, I searched google, but without good results, so if anyone could I would say that I would be very grateful .

UPDATE: @Larry Lustig thanks, I did not think about delphi frameworks - I will look for them.

I know something about form / processing objects and database metadata, but I am not familiar with the serialization of delphi objects for HD. Any advice on Serialization and delphi frameworks (openource so I can take a look :)).

+4
source share
2 answers

Sounds like an interesting idea.

Instead of writing the DFM form manually on disk, I would use the following approach:

  • Get the structure of your table by looking at the metadata.
  • Create a TForm and add a control to it for each column that you want to represent.
  • Use the Delphi built-in serialization to save the form to disk.

I did not do this myself, but there are many runtime design frameworks that use this idea.

+4
source

This will make sense if you need to build many forms at design time. You cannot use DFM in your executable file. If you want to create runtime forms, I suggest you go with Larry Lustig's answer.

We took another step ... we are not building forms. We just write classes, add some attributes and create forms at runtime. Users can change this format of the predefined form at run time and save their own layout. Data binding between controls and the database is performed with an excellent tiOPF structure. Perhaps there is something that you can consider and use.

0
source

All Articles