[fpc-pascal] Class constructor called unconditionally

Dmitry Boyarintsev skalogryz.lists at gmail.com
Thu Mar 31 17:46:26 CEST 2016


On Thu, Mar 31, 2016 at 11:28 AM, Graeme Geldenhuys <
mailinglists at geldenhuys.co.uk> wrote:

> On 2016-03-31 16:06, Michael Van Canneyt wrote:
> > I usually have a 'Start Application' kind of routine where I register all
> > the necessary things, link things together (needed if you follow 'loosely
> > coupled' design).
>
> I do the same. The tiOPF project follows a similar path in the core
> framework and its UnitTest suite. It works well.
>

One could use an alternative approach and have "binding" units.
The unit would consist of initialization section only, that does the
necessary binding code.

They allow to avoid code within "start application" routine across
different projects.
At the same time they keep the actual library units free of initialization.

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160331/05dacb5c/attachment.html>


More information about the fpc-pascal mailing list