New answers tagged

1 vote

Will I lose confidence of my code working in mocking dependency injected services?

Now that I've read your question a bit more thoroughly, I think the problem lies in you being unclear about what the public API of the IMagic type is, and how the return value figures in it. (It is ...
Filip Milovanović's user avatar
5 votes

Possible violation of LSP when adhering to ISP?

This is a covariance of a method's return type. This is compliant with LSP: The preconditions to getUser() are not changed and in particular, they are not strengthened. The postconditions of getUser()...
Christophe's user avatar
  • 76.6k
0 votes

What exactly is the single responsibility principle?

Each class should be the responsibility of a single team/person There's certainly some truth in this, because what we are saying is that the source code should be structured in a way that it is fully ...
Steve's user avatar
  • 8,426
2 votes

What exactly is the single responsibility principle?

Read the blog post kindly linked by @Greg Burghardt Ignore, for now, most everything Uncle Bob writes. Focus on the 1972 text by David Parnas, especially the parts that Uncle Bob highlights. We ...
user949300's user avatar
  • 8,823
6 votes
Accepted

What exactly is the single responsibility principle?

The Single Responsibility Principle is confusingly named and vaguely defined. Robert Martin who first named the principle has revised and clarified its meaning multiple times, but it still causes ...
JacquesB's user avatar
  • 58.7k
1 vote

What exactly is the single responsibility principle?

I would steer you away from the "reposisiblity to a team" interpretation. Clearly, if you have a small company with a single dev team, you wouldn't want to put everything in a single class. ...
Ewan's user avatar
  • 74.5k
0 votes

What exactly is the single responsibility principle?

Note that the blog post speaks about modules, not classes. It is a bit more abstract and higher level. Note also that the reference to people is mostly to clarify what it means that a piece of ...
FredWoozley's user avatar

Top 50 recent answers are included