samedi 20 août 2022

Global Environment Pattern CPP

I have a global environment object that contains some objects that can be accessed from many parts of the project (the members of the environment are io_context, logger and so on). That's why I have to pass this object to the constructors of almost all classes in the project (and store them as GlobalEnvironment&). Is it a normal architecture of the project or something better can be used?

P.S. I can not use Singletons because there can be several different environemts

Aucun commentaire:

Enregistrer un commentaire