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 8701123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:19:14+00:00 2026-06-13T02:19:14+00:00

Say I have 2 service classes: UserService ProductService Is it wrong if within my

  • 0

Say I have 2 service classes:

UserService
ProductService

Is it wrong if within my ProductService class I inject the UserService?

public class ProductserviceImpl implements ProductService {


  @Autowired
  UserService userService;


  @Override
  public void someThing() {
      ..
      userService.otherThing(..);
      ..
  }

}

I know as an alternative I could create yet another class that injects both UserService and ProductService, but coming up with a name for this class is very tricky 🙂 Is there a name for these types of classes in the SOA world?

  • 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-06-13T02:19:16+00:00Added an answer on June 13, 2026 at 2:19 am

    For me, there’s no problem to inject a service into another one. That’s the point with services and SOA as you said.

    Services can help each others in order to give you the final result. Besides, as told JB Nizet, if there is no cyclic dependencies, no problem.

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

Sidebar

Related Questions

Say I have a service: UserService And it has 2 public methods: Method1, Method2
So let's say I have something like this: public class Service : IService {
Lets say I have a controller class like this. public class InStorePickupController : Controller
Let's say I have some classes defined as follows: class Security { Boolean AuthenticateUser(String
I have a class, say Provider, that exposes its funcationality to the above service
I have the following classes: [DataContract] [KnownType(typeof(SpecifiedItemCollection))] public class ItemCollection<T> : IEnumerable where T
Let's say we have a service to add a new hotel: > POST /hotel
Say I have a web service where I want to serve the content only
Let's say I have a WCF service which has a method returning object Person.
Say we have two tables in an MS Access db: Service Users: | ID

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.