Jump to content

Table on Form vs. Table on MainModule What's the difference?


maher

Recommended Posts

Farshad hello,

 

I have many forms in my app and in one form I need to use a table/query to display certain data to the user, I may put the table/query on the form directly and I may also put the table/query on the MainModule. Could you explain the difference between two approaches, from the view of server side (memory)?

 

Thank you

Link to comment
Share on other sites

I am relatively new to uniGUI and my understanding is that the MainModule is session wide and the ServerModule is Application wide.

 

I have code and other non visual components that I share among my forms on the MainModule (including SQL Query results), I also have unique SQL Query results on their respective forms. It is all a matter of resource optimization. 

 

I learnt the hard way never to access a timer on the MainModule from any of my forms, it appears timer events must be on their respective timer forms or modules.

 

Hope this helps - Andy

Link to comment
Share on other sites

The original design of Delphi always allowed to drop data controls everywhere.

But any medium-sized project doing that quickly becomes unmanageable.

The recommended design was always to use the form for visual components and the data module for data controls (and other non-visual controls).

Delphi used to create applications only for Windows, but now uniGUI can create applications for two different platforms, making the previous recommendation almost a requirement.

Now, if your application is very small, tiny, you can put all your data controls in the MainModule and you will be able to identify everything.

If that is not the case, every form could have its own data module (except if it is just something visual, which is highly improbable).

The only current advantage is the fact that managed data modules will be created on-demand and released by the session.

The code will be clear, easy to understand, easy to modify, and it will take advantage of future features of uniGUI.

Link to comment
Share on other sites

It does not matter, really.

 

But having lots of non visual components on single DataModule (MainModule) can be confusing.

 

Hello, for clarification is it the same to have non-visual components created in design or created in execution?

tks

 

Hello, for clarification is it the same to have non-visual components created in design or created in execution?

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...