Serialization vs Embedded Database for simple standalone application

前端 未结 2 1870
轮回少年
轮回少年 2021-01-28 13:12

Say, I have a pretty simple Java application that needs the way to store some user settings. XML is not a really good solution, since I want to store them in binary form. So, wh

相关标签:
2条回答
  • 2021-01-28 14:00

    User settings are typically stored as

    • properties, using the properties file format
    • properties using the XML format
    • preferences, using the Preferences API. This has the advantage of storing and reading user and system preferences for you, without having to think about where to store them, etc. See http://download.oracle.com/javase/1.4.2/docs/guide/lang/preferences.html
    0 讨论(0)
  • 2021-01-28 14:02

    As Apache Derby is an embeddable relational database, it makes sense to use it for storing and manipulating relational data. Using an embedded db for persisting a few user settings only is a bit overkill.

    If it were me, I would use a simple key/value pair serialization for persisting user settings.

    0 讨论(0)
提交回复
热议问题