Lazarus

Programming => Databases => Topic started by: 3rdshiftcoder on April 27, 2021, 05:08:54 am

Title: design advice number of tables per form
Post by: 3rdshiftcoder on April 27, 2021, 05:08:54 am
Hi all-

Is it better design to keep the number of tables and complex relationships for each form smaller? For example, if you have a master detail and a couple of lookups on one form, not to keep adding more stuff to the same form.

I am using data modules.

thanks,
robo-loki
Title: Re: design advice number of tables per form
Post by: mangakissa on May 03, 2021, 11:04:59 am
Actually, each form should have a separated datamodule / unit. For this advantage you can create a whole new form without interacting other forms with data.

So yes, your right.

Only my rule is: lookuptables on one datamodule. It's readonly and shows only data.
Title: Re: design advice number of tables per form
Post by: lucamar on May 03, 2021, 02:28:52 pm
Actually, unless there is a logical reason to do otherwise we use normally one data module per application. Only when there are several independent groups of related databases/tables do we use more than one datamodule. In fact, it all depends quite a lot on how your data is organized and used.

The rule, though, is to use datamodules to keep the data and presentation layers separate in datamodules (data) and forms (presentation).
TinyPortal © 2005-2018