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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T01:17:09+00:00 2026-05-12T01:17:09+00:00

In discussion about my answer to this question , there was some disagreement over

  • 0

In discussion about my answer to this question, there was some disagreement over how to model this code:

public class MainClass
{
    private Something something;

    public void Action()
    {
        OtherClass other = something.GetOtherClass();
    }
}

The key points being:

  1. the Something class is an attribute in MainClass, suggesting an association
  2. the Something class is referenced within MainClass, suggesting a dependency
  3. A dependency is supposed to be a specialised association

However, since a dependency is can be appropriate in cases where the supplier class is not an attribute, does using a dependency “hide” the intention that the Something is an attribute, rather than simply referenced?

Furthermore, does an association, which represents an attribute in a class, imply a dependency because it is being stored (and presumably referenced and used in some way).

So, with reference to the above points, does an association imply a dependency, and how would you model the above code in a class diagram?

  • 1 1 Answer
  • 2 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-12T01:17:09+00:00Added an answer on May 12, 2026 at 1:17 am

    Dependencies and associations are two different concepts. According to the UML metamodel, both are two independent subclasses of the “Relationship” metaclass.

    However, it is true, that in your scenario I’d just model an association between the two classes and not a dependency. The fact that the two classes are connected through an association already make them dependent.

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

Sidebar

Related Questions

If there is already a discussion about this somewhere, I'll take a link as
I know there were some discussions about this but i could not find good
The discussion to this answer just got me thinking about equality and equivalence of
The accepted answer to this question , and a similar discussion at work today
Just had a discussion at work about the merits of using PostgreSQL over MySQL
Okay, There seems to be a lot of discussion on here about how terribly
We were having this discussion wiht my colleagues about Inner assignments such as: return
I recently had a discussion with a colleague about serialization of byte data over
This question specifically relates to my experience with PHP, but there's no reason why
Although I found many answers and discussions about this question, I am unable to

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.