N
not_a_commie
I'm working on some legacy code that passes variables to other methods
in a class via class variables rather than parameters on the method.
This seems like bad practice to me, especially from a multithreaded
standpoint. I recognize that there are some situations where some
class state needs to be stored in class variables, but requiring that
properties or methods be called in a specific order also seems wrong.
It does seem appropriate to store references to dependent services
that came in on the constructor in class variables.
Does anyone know of any good books or articles that review appropriate
uses of class variables? (Especially from a Java or C# perspective?)
in a class via class variables rather than parameters on the method.
This seems like bad practice to me, especially from a multithreaded
standpoint. I recognize that there are some situations where some
class state needs to be stored in class variables, but requiring that
properties or methods be called in a specific order also seems wrong.
It does seem appropriate to store references to dependent services
that came in on the constructor in class variables.
Does anyone know of any good books or articles that review appropriate
uses of class variables? (Especially from a Java or C# perspective?)