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

  • Home
  • SEARCH
  • 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 7090789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:05:59+00:00 2026-05-28T08:05:59+00:00

Could spring services be reduced to commands (according to the Command design pattern)? I

  • 0

Could spring services be reduced to commands (according to the Command design pattern)? I see this as a more flexible approach, and certainly one which increases the cross-cutting of concerns, than putting all functionality into one service class.

Good? Bad? I know that this will undoubtedly increase the number of classes the app will be dealing with, but I don’t mind.

  • 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-28T08:06:00+00:00Added an answer on May 28, 2026 at 8:06 am

    You’re still making a distinction where none needs to be made. Anything can be injected–you can call the entity whatever you want. A controller, a service, a command could all be injected with entities that implement a known interface, like a command interface implementing a run method, or whatever.

    There are a myriad ways to do this in Spring. You could layer AOP advice. You could inject lists of “commands”. Intercept calls and/or web requests, composite collections of services, …

    Until you provide an example of what you are actually trying to do, it’ll be tough to provide anything beyond generalities. Web searches turn up resources like this, which is just one way of doing it.

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

Sidebar

Related Questions

I was wondering how I could implement the simple factory pattern with Spring 3
Is anyone aware of cloud services (PaaS) which could be suitable for a spring/neo4j
I have strings like this: Car is blue String could also be like this:
We're using Spring Security to control access to some services. It is working fine
I'm exposing some services using RMI on Spring. Every service has a dependency to
We are currently using Spring MVC to implement REST web services. We now want
I have a spring web application with jsp pages that calls different web services
I know this sounds strange, mixing CDI (Weld) and Spring for the controller. But
What Spring annotation should I use for Hibernate DAO classes so they could be
I have a lot of methods (in this case, from web services, but maybe

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.