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...

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...

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; ...

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...

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...

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?

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...

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?

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...

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?

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...

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 ...

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...

6

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...

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...

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...

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...

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...

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...

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...

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...

© 2022 - 2025 — McMap. All rights reserved.