2022 Developer Survey is open! Take survey.

New answers tagged

-1 votes

Why is having bloated interfaces an anti pattern?

Bloat is always bad, because it costs resources (time, money, attention, efficiency, space) without giving value. Now in the specific case of bloated interfaces, they violate the Interface segregation ...
user avatar
  • 8,143
8 votes
Accepted

Why is having bloated interfaces an anti pattern?

The interface segregation principle (ISP) stands regardless one's desire to test classes. But if you never bothered to decouple (because there was no apparent need) and then you must write tests, the ...
user avatar
  • 15.4k
1 vote

How would a SRP `class Car` look like?

There is no global answer to this, and in particular it depends on what your program is simulating. To take some highly simplified examples: If your Car represents a Formula 1 race car, you probably ...
user avatar
1 vote

Clean code and SOLID principles in WPF/MVVM view models?

I spent three years developing a WPF application for flight test management. Here are some of the principles that I followed: Use a foundational infrastructure, such as Prism, that enables modular ...
user avatar
1 vote
Accepted

How to deduplicate implementation details coupling to the host objects' actions?

Reverse the dependency. The Worker is the class that is supposed to be stopping itself when its container goes to sleep, so let it subscribe to the container. This allows you to avoid repeating ...
user avatar
  • 24.6k

Top 50 recent answers are included