Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.453 Beiträge
Delphi 12 Athens
|
AW: nicht visuellen Komponenten auf den Forms
16. Mai 2022, 15:01
Du kannst deine DataSouce ja auch mit auf das DataModule legen, dann sind DS und DS zusammen.
Ähm, nein: Tweaking DFM Loading
Zitat:
While the data controls must reside on the form and the data source(s) should better be on the form, too (I will explain later why), the TDataSet descendants are better placed on a separate data module. This allows the separation of the data logic from the UI and (hopefully) encourages reuse.
...
This seems also a good place to explain the TDataSource should stay in the form rule mentioned in the beginning.
The official one is: One can easily change the dataset in the data source of an individual form instance without interferring with others also using a datasource in a datamodule.
The unofficial one is: Sometimes the IDE looses these connections, f.i. when the data module cannot be opened. In that case it is easier to re-connect the dataset of one data source on the form instead the data sources of several data controls.
|