Jump to content

Reuse a normal datamodule?


DonaldShimoda

Recommended Posts

Both in VCL and uniGUI applications, creating a data module when the application or session start is only a good practice for small applications. Medium and large applications work best when data modules are created on demand. If a form needs a data module, it can create it in OnCreate, and release it in OnDestroy.

If you create a uniGUI data module, you are asking for automatic lifetime management of it for each session. All of them will be created when the session starts, and all of them will be released when the session is closed. But remember that data modules usually take a lot of resources.

Link to comment
Share on other sites

Yes, thanks , i do. As you can see theres no answers there to my question. Do you read the search results?

Link to comment
Share on other sites

Both in VCL and uniGUI applications, creating a data module when the application or session start is only a good practice for small applications. Medium and large applications work best when data modules are created on demand. If a form needs a data module, it can create it in OnCreate, and release it in OnDestroy.

If you create a uniGUI data module, you are asking for automatic lifetime management of it for each session. All of them will be created when the session starts, and all of them will be released when the session is closed. But remember that data modules usually take a lot of resources.

 

yes, i know. The idea is to be created in each new sesion. How to do?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...