On Thu, 31 Mar 2016, Dmitry Boyarintsev wrote:

On Thu, Mar 31, 2016 at 11:28 AM, Graeme Geldenhuys <
mailingli...@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.

I have 1 common  routine which is called from all my projects. It accepts an
enumeration to decide what parts to start.

I guess this is your 'binding' unit idea, except it doesn't have an
initialization section...

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to