What is wrong with static methods? Why is it said that they "damage Object Orientation"? What do they have to do with coupling? In this video, we will answer these questions based on 3 main points regarding the harmful aspects of static class methods and attributes:
- They break the Object-Oriented paradigm
- They promote coupling
- Harming changeability (violating the Open/Closed Principle of SOLID)
- Making testability more difficult
- They hide dependencies between classes
I recommend checking out the videos on How to Listen to Your Tests (as we also talked about how coupling made test development difficult), and the one on SOLID's Dependency Inversion Principle (as it is one of the aspects discussed in today's video). In the upcoming videos, we will talk about topics such as:
- How to test classes that call static methods
- Under what circumstances it is not harmful to use static methods