Is a “master preferences” class a good idea?

前端 未结 6 1653
走了就别回头了
走了就别回头了 2021-02-06 06:50

I have a class that manages user preferences for a large software project. Any class in the project that may need to set or retrieve a user preference from a persistent store i

6条回答
  •  面向向阳花
    2021-02-06 07:23

    The JSR-10 (java.util.prefs.*) API uses a factory method with a Class parameter to create Preferences instances. That way the API can store preferences from different classes belonging to the same package in a single file.

提交回复
热议问题