single-responsibility-principle Questions
8
Solved
I am struggling to understand how the Single Responsibility Principle can me made to work with OOP.
If we are to follow the principle to a tee, then are we not left with many classes, many of whi...
Fronton asked 3/10, 2017 at 9:19
4
Suppose we are designing a UserServiceImpl class which does CRUD (Create, Read, Update, and Delete) operations. In my view Create, Read, Update, and Delete are four reasons for a class to change. D...
Diazotize asked 15/4, 2010 at 7:53
6
Solved
How does the SOLID "Interface Segregation Principle" differ from "Single Responsibility Principle"?
The Wikipedia entry for SOLID says that
ISP splits interfaces which are very large into small...
Disclaim asked 17/1, 2013 at 21:20
4
Solved
I am trying to understand the Single Responsibility principle but I have tough time in grasping the concept. I am reading the book "Design Patterns and Best Practices in Java by Lucian-Paul Torje; ...
Lynching asked 9/9, 2018 at 18:12
3
Solved
I want to implement Single Responsibility principle in my projects Domain layer (Clean MVVM).
I've approximately 200 different use-cases which are being very hectic to manage. Now I'm thinking to c...
Malvasia asked 23/6, 2018 at 6:39
4
Solved
My simplest ASP.NET MVC 2 controllers make calls to my service layer and map view models to entities using AutoMapper. Everything looks fantastic and there is no repeated code.
However, when I get...
Gallon asked 12/11, 2010 at 18:15
4
Solved
I have YoutubeVideoService class which does CRUD(Create, Read, Update, and Delete) operations. In my view Create, Read, Update, and Delete are four reasons for a class to change. Does this class vi...
Rrhagia asked 10/10, 2011 at 19:1
13
Solved
What is the difference between Single Responsibility Principle and Separation of Concerns?
Sidell asked 12/11, 2009 at 18:46
2
Solved
I am quite confused with the Single Responsibility Principle. The Principle states that there should only be one reason for the class to change.
The problem which I am facing is, any change to a m...
Nakasuji asked 22/11, 2019 at 3:12
2
Solved
I am wondering if JPA entity and DDD entity should be the same class?
I can see in examples that it is a common practice, but doesn't it violate single responsibility principle?
Guglielmo asked 22/7, 2019 at 15:8
1
Another engineer at my job asked me today about "what is this single responsibility thing?" and my answer was as follows:
"Every scope of your code, be it an if statement, a function, a clas...
Acclivity asked 4/7, 2019 at 20:25
2
Solved
I'm trying to understand SRP principle and most of the sof threads didn't answer this particular query I'm having,
Use-case
I'm trying to send an email to the user's email address to verify himse...
Relator asked 29/6, 2019 at 11:7
1
I have an algorithm to create a version for an entity and then I save that version against below 2 entity:
1) Variant
2) Category
interface IEntityVersion
{
string GetVersion();
}
public class...
Telluric asked 7/5, 2019 at 6:51
4
Solved
Is high cohesion a synonym for the Single Responsibility Principle? If not, how are they different?
Medieval asked 26/6, 2012 at 20:5
4
Solved
The Single Responsibility Principle states that:
A class should have one, and only one, reason to change.
The Open/Closed Principle states that:
You should be able to extend a classes behav...
Missis asked 9/3, 2018 at 15:46
6
Solved
I have bunch of keys and values that I want to send to our messaging queue by packing them in one byte array. I will make one byte array of all the keys and values which should always be less than ...
Pilose asked 11/1, 2018 at 7:35
6
Solved
If an object has a Single Responsibility, can the following be acceptable:
public class Person
{
public string Name;
public DateTime DateOfBirth;
private IStorageService _storageService;
pub...
Dissuade asked 11/11, 2011 at 21:9
6
Aren't Information Expert & Tell Don't Ask at odds with Single Responsibility Principle?
Information-Expert, Tell-Don't-Ask, and SRP are often mentioned together as best practices. But I think they are at odds. Here is what I'm talking about.
Code that favors SRP but violates Tell-Don...
Hhour asked 4/10, 2008 at 0:48
3
Solved
Can someone give me an example of the Single Responsibility Principle? I am trying to understand what it means, in practice, for a class to have a single responsibility as I fear I probably b...
Voyeurism asked 16/5, 2012 at 13:51
2
Solved
When initializing an authentication to AWS Cognito, the API is rejecting my request:
InvalidParameterException: Missing required parameter UserName
status code: 400,
Here is the content of the r...
Carmichael asked 1/8, 2016 at 1:1
2
Solved
An interesting thread came up when I typed in this question just now. I don't think it answers my question though.
I've been working a lot with .NET MVC3, where it's desirable to have an anemic mo...
Welcome asked 4/5, 2012 at 18:56
1
Currently in the middle of a substantive bit of refactoring work after realising my classes were all over the place. I'm trying to split things up a bit, to follow the SRP better, but I have always...
Blair asked 8/6, 2016 at 9:24
2
I have a large class (1500 lines, but will soon be several times that) that I'd like to split so that it fits better with SRP (and so that each file is smaller and more manageable.)
The class cont...
Sadick asked 18/5, 2016 at 16:38
4
Solved
In the following video, the author takes an existing class and assigns the Single Responsibility Principle to it. He takes a Print Class that has the job of Accessing Data, Formatting, and Printing...
Dewie asked 1/8, 2009 at 0:14
3
Solved
Is interface segregation principle only a substitue for single responsibility principle ?
I think that if my class fulfill SRP there is no need to extract more than one interface.
So ISP looks li...
Mephitic asked 11/11, 2011 at 19:35
1 Next >
© 2022 - 2025 — McMap. All rights reserved.