Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When to create forms

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
Hello all, I'm starting Version 2 of my jury program! Since I knew NOTHING about Delphi when I started the project, looking back through my first attempt makes me cringe (although I am very proud of the application and what it does).

So, I'd like to get opinions on whether it's better to create the forms on the fly or allow them to be created automatically when the program starts up. Is there some kind of criteria on when to use a dynamically created form? When do you use forms on the fly?

Thanks for any input!

leslie
 
Typically if a form is used intensively, then have the application create it during startup and let it remain in memory. This is bcos creating form on the fly takes processing time, especially if that form consists of lots of components and codes. You wouldn't want the user to wait a long time for a commonly-used screen to appear.
 
IMHO autocreate forms is a triumph of marketing over substance. It does mean that anyone can get a app up and running within 5 minutes of installing Delphi. But, it discourages the discovery of OO and encourages the use of global variables - both of which cause grief when the new programmer moves on to more substantial applications.

I agree with cwseetoh, allow any frequently used forms, and the appliction's main form, to autocreate. But control the creation and freeing of everything else. Form creation in most cases is instant. The app I am working on today has 62 forms and datamodules. Keeping that lot permamently in memory would zap resources and increase startup time considerably.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top