Skip to main content

Questions tagged [single-responsibility]

The Single Responsibility Principle states that each module in a system should be responsible for a single feature or functionality, or aggregation of cohesive functionality. Another common way to put it is to say that each module should have only one reason to change.

1 vote
2 answers
230 views

Let's say I am coding an C++ application which needs to drive some motors with some hardware interface (USB, Serial...). There are several kinds of motors, which expose the same services, but with ...
Oodini's user avatar
  • 147
1 vote
1 answer
216 views

I'm developing a PHP application and trying to understand DTOs in context of single-responsibility principle. Being more specific, is it a bad practice having helper methods like toArray(), getValue(),...
Viacheslav Ravdin's user avatar
2 votes
5 answers
618 views

I've generally understood the SRP to roughly mean: Each class should do one thing Exactly what "one thing" is is up for debate. However, I've recently seen claims that the entire SRP has ...
ScottishTapWater's user avatar
0 votes
1 answer
184 views

I am going back and forth on an aspect of our FluentValidation and MediatR pipeline behavior implementation. We receive requests which, in a Mediator pattern, are mapped to command or query objects, ...
BJ Safdie's user avatar
  • 103
1 vote
4 answers
409 views

Edit based on responses so far I am starting with an edit so as to save future contributors from going down the same path others have. I am only interested in contributions that stick to the exact ...
Ash's user avatar
  • 219
-2 votes
1 answer
126 views

Goal: I am learning about SOLID principles and trying to refactor Gilded Rose code, in order to make it fresh and clean. What I have done: I have created an AbstractItem class as follows, which "...
tail's user avatar
  • 101
5 votes
4 answers
577 views

I often write front end apps with a generic MVC pattern. I use javascript but this questions is language independent and relates to OOP as a whole. I struggle to understand the SRP principle and I ...
Kevin Greetham's user avatar
3 votes
2 answers
293 views

Suppose I have a program that returns data from an API. If its cache of the data is too old, the program downloads more data from the API, caches it, and outputs the new data. Else, the program ...
moonman239's user avatar
  • 2,063

15 30 50 per page
1
2 3 4 5
20