[Lazarus] TDataModule for non-database non-visual components

Kostas Michalopoulos badsectoracula at gmail.com
Mon Feb 6 20:17:48 CET 2017

Hi all,

A simple question, is it ok to use a TDataModule for non-visual components
that can be shared among forms (and generally contain app-wide stuff)?
There doesn't seem to be a plain TModule or something like that. I ask
because the docs do not make the distinction clear (the name doesn't help)
and the wiki has it in the database section.

I suspect this is the case and in Delphi/Embarcadero docs it explicitly
mentions that you can use it for non-database components, i just want to
make it sure it wont blow up in the future (and that there isn't another
way to create non-visual components from the IDE) because i just realized
that TDataModule can be used like that (currently i'm creating
non-form-specific components either in the main form or manually via code
in a dedicated unit).

My use case is a few custom non-visual components which can be shared among
forms (and to decouple the logic from the form when it has nothing to do
with it).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170206/8c4ab1e9/attachment.html>

More information about the Lazarus mailing list