On design patterns: When should I use the singleton?

后端 未结 20 3551
失恋的感觉
失恋的感觉 2020-11-22 02:45

The glorified global variable - becomes a gloried global class. Some say breaking object-oriented design.

Give me scenarios, other than the good old logger where it

20条回答
  •  面向向阳花
    2020-11-22 03:33

    Reading configuration files that should only be read at startup time and encapsulating them in a Singleton.

提交回复
热议问题