Relative Content

Tag Archive for static-methods

Is this a candidate for Singleton?

I have an external thermometer connected via USB that is controlled by my SW. Different parts of my system will use it but never at the same time (all in one thread). However, it is a single device communicating over an established connection so for some reason I think either its method (GetTemperature) should be static or I could do it as Singleton.
I will be happy for suggestions. Thanks

Drawback of using static method [duplicate]

This question already has answers here: Make methods that do not depend on instance fields, static? (4 answers) Closed 9 years ago. For methods that never access instance variable or static variable and they act just like a function (name-spaced) and they are deterministic base on only the input arguments , I want to ask, […]

Drawback of using static method [duplicate]

This question already has answers here: Make methods that do not depend on instance fields, static? (4 answers) Closed 9 years ago. For methods that never access instance variable or static variable and they act just like a function (name-spaced) and they are deterministic base on only the input arguments , I want to ask, […]