4

I'm new to delphi and I'm looking up on ways to learn more about delphi underlying technology plus make something useful here in my job in the process, also if anyone has any tip or see anyway i can improve my idea please fell free to speak your mind...

i want to do make some kind of Scaffolding for dfms, the ideia is the following: i want to generate based on a firebird database table - with well defined domains - the bulk of the Form .

I think the idea is too simple or i'm not seeing the big picture that makes it difficult, i'm trying not to reinvent the well, i've looked up on google but without good results, so if anyone could giveme a direction here i would be most grateful.

UPDATE: @Larry Lustig thanks, i didn't think about delphi frameworks - i'm going to look them up.

i know something about form objects/handling and database metadata, but i'm unfamiliar with serilizing delphi objects to the HD. Any tips on Serialization and delphi frameworks (opensource so i could take a look :) ) would be welcome!

1
  • @Moderators: I promise to react with a proper answer when I have a bit more working code. @Jonathan: Drop me an email (almost anything at pluimers.com will work): I'm working on a session for DelphiLive on something similar (based on SQL Server, and not forms, but parts of frames) and like to adapt it to FireBird. We could work on this to get it working with FireBird, and post it as a good answer to your question). Commented Aug 2, 2010 at 19:41

2 Answers 2

4

Sounds like an interesting idea.

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

  • Get the structure of your table by examining the meta data.
  • Create a TForm and add a control to it for each column you want to represent.
  • Use Delphi's built in serialization to save the form to disk.

I haven't done this myself, but there are a number of run-time design frameworks that work using this idea.

Sign up to request clarification or add additional context in comments.

Comments

0

This would only make sense if you need to build a lot of forms at design time. You can't use the DFM's in your executable's. If you want to build the forms runtime, I suggest you go with Larry Lustig's answer.

We have taken this one step further... we don't build forms. We only write the classes, add some attributes and create the forms at runtime. Users can change this preset form layout during runtime and save their own layout. Data binding between the controls and the database is done with the excellent tiOPF framework. Maybe something you can consider to use as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.