[fpc-devel] Rather large flaw in TJSONConfig component

Michael Van Canneyt michael at freepascal.org
Mon Jun 21 17:11:01 CEST 2010



On Mon, 21 Jun 2010, Graeme Geldenhuys wrote:

> Op 2010-06-21 16:33, Michael Van Canneyt het geskryf:
>>
>> The best way to avoid it is to create/destroy the config object after use.
>> When the form is opened, you create an ini/json/whatever file object and
>
> So then it's not wise to have TXMLConfig in the Lazarus component palette.
> Because dropping a component on a form doesn't give the behaviour you
> described.

It does if you set 'active' or 'enabled' to false, no ?

>
>
>> Likewise for a database application. Unless you take care of transaction
>> support, 2 users editing a record will overwrite each other's changes,
>> unless the programmer explicitly takes care of this.
>
> Doesn't Delphi's TClientDataset popup a 'conflict resolution dialog' in
> such a cases. I remember seeing such dialogs years ago (when I still used
> Delphi).

Only if you program it so. I program with UpdateMode=upWhereKeyOnly, and
then all updates go through, unless the record was deleted.

>
>
>> In 12 years that our apps run, we used the system 'last writer wins' and
>> no single user has complained yet about this.
>
> Because they don't get notified about their data (last saved) being lost. :-)

Well, I prefer that over bugging our users with dialogs that they don't understand
anyway. Additionally, it drastically degrades performance.

>
>
> Michael, how does documentation work in FCL? Can we start documentation on
> these units and include these usage warnings - then not let them appear in
> official documentation until the FCL-json or FCL-xml packages are 100%
> documented? I know FPC has the policy that it doesn't allow "partial"
> documentation. I just fear that not documenting it now (somewhere) - this
> information will be forgotten when the docs are eventually written.

You can start documenting them if you wish. But they won't be included
in the official docs till fully finished. (Actually, I started on fcl-json
to get it included on www.json.org. Documentation is a prerequisite)

Michael.



More information about the fpc-devel mailing list