What is the best way to serialize Delphi application configuration?

后端 未结 7 1751
猫巷女王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条回答
  •  旧时难觅i
    2021-02-02 02:48

    Nicks answer (using Java Properties) has a point: this simple way to read and pass configuration around between parts of the application does not introduce dependencies on a special configuration class. A simple key/value list can reduce the dependencies between application modules and make code reuse easier.

    In Delphi, a simple TStrings-based configuration is an easy way to implement a configuration. Example:

    mail.smtp.host=192.168.10.8    
    mail.smtp.user=joe    
    mail.smtp.pass=*******
    

提交回复
热议问题