[Lazarus] Circular references and code quality

Alexander Klenin klenin at gmail.com
Tue Oct 4 17:12:31 CEST 2011


On Wed, Oct 5, 2011 at 01:40, Marcos Douglas <md at delfire.net> wrote:
>> The comments always tell to use interfaces and abstract base classes, and
>> claim that this feature enforces good design.
>> Bollocks!
>
> I agree with you.
> I found this example by Nikolai ZHUBR:
> http://lists.freepascal.org/lists/fpc-devel/2010-January/018942.html
> I do not think this is better solution. For only one "circular
> reference" between 2 classes, I have to created 3 files! And if these
> references grow?!

You misunderstood. Of course you do not have to create 3 files
to use interfaces -- it is the reverse, interfaces allow you to split
you code cleanly
into 3 (or more) files if/when it becomes too large for a single one.

-- 
Alexander S. Klenin




More information about the Lazarus mailing list