Recent

Author Topic: design advice number of tables per form  (Read 902 times)

3rdshiftcoder

  • New Member
  • *
  • Posts: 35
design advice number of tables per form
« 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

mangakissa

  • Hero Member
  • *****
  • Posts: 1117
Re: design advice number of tables per form
« Reply #1 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.
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

lucamar

  • Hero Member
  • *****
  • Posts: 4163
Re: design advice number of tables per form
« Reply #2 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).
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018