Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6811229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:18:06+00:00 2026-05-26T20:18:06+00:00

I am currently learning about the SOLID principles and especially the SRP. To put

  • 0

I am currently learning about the SOLID principles and especially the SRP.

To put this principle into perspective, I recall having worked on a small application a while ago that had a single Spring Service class that contained all service methods for the entire application.

Morevoer it had a single DAO class that contained all jpa-data access methods.

This is all in clear violation of the SRP. Isn’t it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:18:07+00:00Added an answer on May 26, 2026 at 8:18 pm

    Well, yes and no, the idea here is that a Class is “SRP approved” if it has only one “axis of change” (gotta love Martin’s jargon). In mortal words this means: “is there more than one kind of reason for this class to change?”. I.E. if your service class infact aggregated (let’s say) logic that would call some other service AND do some business logic on what that service call returned, then that service class would have 2 axes of change: one for when/if the service it calls would change, and another for when the business logic changed. In this case the part that calls the other service should be separated from the part that applies the business logic to the returned result.

    These things however are called “principles” and not “laws” because they shouldn’t be applied blindy to anything you develop, all the time (lest you wanan go crazy 🙂 ), but only when the context demands it.

    Example, Martin Fawler himself deems the Model (as Java beans) and DAO Objects separation as an anti pattern which he calls AnemicDomainModel. As a good alternative to this, see Play Frameworks model implementation . However I’m sure you, as well as many other people have indeed made this bean/dao separation when building a data-access tier in Java, and the code itself was clean, usable and flexible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ask this because I'm currently learning about Neural Networks as a subset of
I'm currently learning about bitset, and in one paragraph it says this about their
I'm currently learning after a book about how to convert xaml code into objects
I currently learning about scrum and want to learn from experienced professionals in the
I am currently learning about basic networking in java. I have been playing around
I'm currently learning a bit more about Linq-To-Entities - particularly at the moment about
I am currently learning C# and LINQ. I have lots of questions about them.
I am currently learning about widgets in Android. I want to create a WIFI
I am a student currently learning about Functional Reactive paradigm using F#. It's radically
I am a .NET student and currently we are learning about Application Domains. We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.