[lazarus] Circle dependencies in the lcl

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jan 15 10:25:10 EST 2001


Hi all,

I want to discuss a structure problem in the LCL.
This is nothing new:
There some circle dependencies in the LCL. For example
forms.pp<->controls.pp.
Although the compiler can handle this, there are some problems. Some weeks
ago this was hidden with funny tricks like "make -C lcl" 6 times. Then a new
trick was invented: -Ca. AFAIK this prevents some optimization.
I believe it is bad coding to program circle dependencies. A circle is an
important sign that code should be gathered in one unit.

Case 1:
  graphics.pp <-> controls.pp
    Even Delphi avoids this. This circle can easily be destroyed.
    Move the procedure CN_SendMessage from
    controls.pp to lmessages.pp.

Case 2:
  controls <-> dialogs
    Why does controls depend on dialogs?

Case 3:
  forms.pp <-> controls.pp
    Delphi has the same problem. The LCL should be
    very similar to the VCL, but of course we don't
    want to copy the problems, do we?
    The dependency is TWinControl<->TCustomForm.
    To distribute them to two units is a design
    mistake. 

What do you think?

Mattias







More information about the Lazarus mailing list