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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:33:23+00:00 2026-06-14T23:33:23+00:00

I understand code fully however I’m having a bit of trouble understanding UML as

  • 0

I understand code fully however I’m having a bit of trouble understanding UML as it relates to code.

Question 1 – If I have a class

public class one
{....}

public class two
{
    one ob;
    public two(){ob=new one();}
}

I know this is an association but do I show this in a class diagram with an arrow or not?

enter image description here

Question 2 – if I have the following class

public class three
{
   public three(){.........}

   public void method() {  one obt=new one();  }
}

Is this an association between class three and class one? I’m not sure since its being applied from the method.

  • 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-14T23:33:24+00:00Added an answer on June 14, 2026 at 11:33 pm

    I know this is an association but do I show this in a class diagram with an arrow or not?

    If class one has no reference to class two then you should have an arrow head. But it points from two to one (opposite way to how you have it shown). Reason: the arrow indicates navigability. Class two can navigate to class one because it holds an instance. The opposite is not true. Technically it should be an open arrowhead, not the closed form you’ve used.

    Is this an association between class three and class one? I’m not sure since its being applied from the method.

    If the only reference from three to one is as a method parameter then you’d most likely show as a dependency not an association. Associations declare a systematic relationship among the entities – like a Purchase Order consisting of Order Lines. In code that most often translates to a member variable (or collection thereof). Dependencies are a weaker form of relationship than Associations and don’t imply a systematic link.

    hth.

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

Sidebar

Related Questions

I am trying to fully understand the process pro writing code in some language
I understand this code calculates the sum of the args of a variable, however,
I am now trying to understand some code and I have found a pattern,
I have a bug in my code that made me think I don't fully
I write couples of servlet program, however I dont think I fully understand how
I’m trying to understand code from http://www.yesodweb.com/book/conduits . After some fixes (like replacing Resource
I'm trying to understand code that I bought so I can modify it. In
I've been using xdebug to debug and understand code in php projects for a
I want to understand if code snippets are what I am looking for here.
I am trying to understand a code, what exactly &(ipA[iLower + 1] stands for

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.