lundi 17 juillet 2017

What is the correct design pattern to "turn off" an instance of a class?

Let's say I have a class with a bunch of methods and I want those methods to essentially no-op if a flag in a config file is turned off. . What would be the type of design pattern to follow? I've thought of hacky things like conditionally running methods (e.g. Can I conditionally control method calls at runtime with attributes?).

Aucun commentaire:

Enregistrer un commentaire