What is the best way to serialize Delphi application configuration?

后端 未结 7 1736
猫巷女王i
猫巷女王i 2021-02-02 02:21

I will answer this question myself, but feel free to provide your answers if you are faster than me or if you don\'t like my solution. I just came up with this idea and would li

7条回答
  •  独厮守ぢ
    2021-02-02 02:40

    I use XML for all my application as means of configuration. It is:

    • flexible
    • future feature proof
    • easy to read with any text reader
    • very easy to extend in application. No class modifications needed

    I have an XML library that makes it extremely easy to read or modify configuration, without even having to watch for missing values. Now you can also map the XML to a class inside application for faster access if speed is the issue, or certain values are read constantly.

    I find other configuration methods far less optional:

    • Ini file: no in depth structure, far less flexible
    • registry: just keep away from that.

提交回复
热议问题