I'm trying to get my head around the usage of the factory pattern, when I wish to disable features within an application.
Lets say for example I have a factory called LoggerFactory, which creates a logger instance.
If in the configuration logging is disabled in my application:
Should the logger factory pass back an instance of the logger that is a dummy, that doesn't do anything? So any code using the logger does not need to change.
Or, is it the responsibility of the code using the logger, not to use the logger if it is disabled in the configuration?
Or, is it the responsibility of the logger itself not to do anything, if it is disabled?
Thanks for the help.