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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:43:50+00:00 2026-06-13T19:43:50+00:00

I am noticing occasions where I need to add dependencies to parent classes, and

  • 0

I am noticing occasions where I need to add dependencies to parent classes, and their parents and so on, only because a child class needs it. Is this a code smell? Is it reasonable for a parent class to need information only because a child class needs it?

In particular in our [slightly anemic] flavor of DDD this seems to occur with Application Services (Domain boundary) needing information from our application layer to pass on to Domain Services. It is quite painful to add dependencies to app services calling a particular domain service and all of the associated tests when a domain service needs a new dependency.

  • 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-13T19:43:51+00:00Added an answer on June 13, 2026 at 7:43 pm

    Yes, it is a smell. If your child class needs some dependency, then inject dependency directly into child class. And let parent class know (i.e. be dependent) only about child.

    BTW Are you sure that in your case dependency is passed to domain service? Dependency is a specific service that is required by dependent object to fulfill its function. It looks like in your case simple data is passed to domain service.

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

Sidebar

Related Questions

I am noticing large amounts of this class being leaked in our automated environment.
The issue I'm noticing is this line of code: tempList.Add(orderables); In this full code:
I'm noticing that $config = $this->getOptions(); gets only the settings of the default application.ini
I'm noticing this error more and more in my error logs. I've read through
I'm noticing some behavior that I don't like, and I'm wondering if this is
I'm noticing code accumulating in my project that looks like this: Response.Redirect(/Foo/Bar.aspx); This seems
I've been noticing static classes getting a lot of bad rep on SO in
I'm noticing that UIView animations using the UIView class methods seem to more or
I'm noticing a few errors flagged by analytics: class android.content.ActivityNotFoundException Msg: android.app.Instrumentation.checkStartActivityResult:1408 (No Activity
I have been noticing __construct a lot with classes. I did a little reading

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.