mercredi 5 juillet 2017

Best way to pass around manager class

Say that i have a class called "ConfigManager" which will handle the config file for my application, like to load it and reload it. Which design pattern would be best to pass around and access the class from everywhere in my project? I'm currently thinking on a simple singleton pattern with a static getter method for easy access, or that i initiate the class in the "Main/Startup" class and then pass the "Main/Startup" class around in order to access the "ConfigManager" class.

This might be little bit fussy, but i hope your guys understand what i mean.

Aucun commentaire:

Enregistrer un commentaire