Don't Use Static? [closed]
- by Joshiatto
Possible Duplicate:
Is static universally “evil” for unit testing and if so why does resharper recommend it?
Heavy use of static methods in a Java EE web application?
I submitted an application I wrote to some other architects for code review. One of them almost immediately wrote me back and said "Don't use "static". You can't write automated tests with static classes and methods. "Static" is to be avoided."
I checked and fully 1/4 of my classes are marked "static". I use static when I am not going to create an instance of a class because the class is a single global class used throughout the code.
He went on to mention something involving mocking, IOC/DI techniques that can't be used with static code. He says it is unfortunate when 3rd party libraries are static because of their un-testability.
Is this other architect correct?