singleton
singleton copied to clipboard
Do not use the singleton design pattern on VIPCfg
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:
- Remove the static "gcInstance" from VIPCfg. Store it in VIPConfigs.java.
- Remove moduleCfgs from VIPCfg. Store it in VIPConfigs.java.
- Deprecate VIPCfg.getInstance and VIPCfg.getSubInstance.
Code clean up isn't clear, please use a specific issue for this change.