[Lazarus] When do I need a component rather than a plain object?

Michael Van Canneyt michael at freepascal.org
Tue Nov 16 11:32:23 CET 2010



On Tue, 16 Nov 2010, Frank Church wrote:

>
>
> I realized the wisdom of Bo's approach to creating components at run-time
> and setting the properties in code only 2 days go.
>
> I overwrote some of my newer code with older code, and although I restored
> the *.pas from git, I forgot about the*.lfm where the SQL was stored. It was
> only hours later that I realized the the update code was in the components
> that I restored it.
>
> Initialzing non-visual components from form properties is an evil which is
> best avoided.

I think your mileage may vary. I work with lots of custom components in
Delphi and Lazarus (in fact, I never use the 'standard' ones, always
descendants or third-party components, installed in the IDE). 
In 12 years, I never experienced any of the problems you describe.
Not in Lazarus, not in Delphi.

So I cannot say that my experience supports your conclusion.

> It will be good if Lazarus can generate the source code to initialize
> components at the start of a program, rather than stream them in, hopefully
> in a future version. It makes revision control much easier, a lot more
> transparent.

I am all for such a feature (to each his own, after all), but I don't 
think it solves any real problems. You admitted you made a mistake in 
your VCS, but you blame the lazarus way of doing for it. 
This is definitely not logical to me.

Michael.




More information about the Lazarus mailing list