[Lazarus] Why was XML format chosen for storing settings in Lazarus IDE?

Alexander Klenin klenin at gmail.com
Fri Jun 18 16:53:58 CEST 2010


On Sat, Jun 19, 2010 at 00:33, Martin <lazarus at mfriebe.de> wrote:
>>> There is code that read XML via RTTI directly to the object.
>>
>> By "there is" do you mean "in the universe" or "in Lazarus sources"?
>> In the first case -- of course, I know that, I have written and used
>> such code myself.
>> In the second -- why it is not used then?
>
> Both, since the Lazarus sources are included in the universe.

:-)

> EditorOptions.pp => and it is used there.

Yes, I have taken a look.

> It is hard to use it for older settings, since often the name of the values
> are not the rtti names needed. It is used for some of the newer setting
> (e.g. colors)

Config backwards-compatibility is a hard problem, but it is essentially the same
as the problem of LFM backwards-compatibility, which is an argument
in favor of using the same approach, if not the same code.
(I.e. I suggest something like
aXMLConfig.RegisterAlias('OldPath\OldOption', 'NewPath\NewOption'))

> Also the old code works => so why change it, just for the off-chance to
> introduce bugs?

There are many reasons for refactoring, I think you know them well enough.
To put it bluntly, adding a new Lazarus option it is now rather
frustrating experience.
Primary culprit is the fact that there are many places to modify
scattered around the code.
Consistently implementing RTTI-based save/loading will eliminate two
such places,
which would be a big step forward.

-- 
Alexander S. Klenin




More information about the Lazarus mailing list