singleton icon indicating copy to clipboard operation
singleton copied to clipboard

Do not use the singleton design pattern on VIPCfg

Open jessiejuachon opened this issue 4 years ago • 1 comments

VIPCfg.java was originally using the Singleton design pattern (single static VIPCfg object instance for the entire application). However, the use case of having multiple VIP products in the same app was introduced (a.k.a subInstance). The singleton design pattern is not applicable in this anymore as multiple instances of VIPCfg have to be created and stored.

Solution:

  1. Remove the static "gcInstance" from VIPCfg. Store it in VIPConfigs.java.
  2. Remove moduleCfgs from VIPCfg. Store it in VIPConfigs.java.
  3. Deprecate VIPCfg.getInstance and VIPCfg.getSubInstance.

jessiejuachon avatar Nov 03 '20 04:11 jessiejuachon

Code clean up isn't clear, please use a specific issue for this change.

Xiaochao8 avatar Dec 18 '20 04:12 Xiaochao8