datamodule

Unit-testing Delphi data modules

拟墨画扇 提交于 2019-12-03 13:36:51
问题 If all the business logic is present in a datamodule (TSQLDataSets and TDataSetProviders) how would you refactor the code to make the application more appropiate for unit testing? 回答1: After the last question about this, I wrote a blog post about how to do it. 回答2: Some basic tips: Your DataModules should never have any references to forms or any other UI components Put the TDataSources on forms and not in your DataModules. Make sure there isn't any prompts for confirmation and operations

Delphi XE2 Data Module expects only database components?

 ̄綄美尐妖づ 提交于 2019-11-30 08:02:12
问题 In prior versions of Delphi, I have used the data module ( TDataModule ) as a place to keep non-visual components to avoid cluttering up the main form. In Delphi XE2, when I create a new data module, it only allows me to place database related components in it (such as TADOConnection and TDataSource ). Why is this and how can I put other components in it? Is there an alternative? 回答1: Data modules changed with the XE2 release. Remember that XE2 introduced a new component framework, FireMonkey

Delphi XE2 Data Module expects only database components?

旧巷老猫 提交于 2019-11-29 05:36:26
In prior versions of Delphi, I have used the data module ( TDataModule ) as a place to keep non-visual components to avoid cluttering up the main form. In Delphi XE2, when I create a new data module, it only allows me to place database related components in it (such as TADOConnection and TDataSource ). Why is this and how can I put other components in it? Is there an alternative? Data modules changed with the XE2 release. Remember that XE2 introduced a new component framework, FireMonkey, in addition to the long-standing VCL. A new pseudo-property, named ClassGroup was added to data modules.