Hello,
I'm building an application, in which I have a ConfigManager class to hold all the important info about the application.
I need only one instance of ConfigManager class to be available throughout the application, from anywhere inside the application. From what I have read, the singleton pattern seems to match my problem
However, I built the ConfigManager with a constructor with parameters.
Until now, I've tried using global variables. One instance of ConfigManager class declared as global and used throughout th app. It works, but I am not very confortable with this. That's why I need a second opinion.
Thanks,
Adina
I'm building an application, in which I have a ConfigManager class to hold all the important info about the application.
I need only one instance of ConfigManager class to be available throughout the application, from anywhere inside the application. From what I have read, the singleton pattern seems to match my problem
However, I built the ConfigManager with a constructor with parameters.
Until now, I've tried using global variables. One instance of ConfigManager class declared as global and used throughout th app. It works, but I am not very confortable with this. That's why I need a second opinion.
Thanks,
Adina
Comment