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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:08:22+00:00 2026-06-13T10:08:22+00:00

How can we map basic UML relationships like Aggregation, Dependency, Association to Java classes?

  • 0

How can we map basic UML relationships like Aggregation, Dependency, Association to Java classes? How does this actually work?

  • 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-13T10:08:24+00:00Added an answer on June 13, 2026 at 10:08 am

    A dependency can be anything, so one can’t tell how this is mapped to Java. It could be a plain usage of a class as local variable type; possibly even a dependency that does not appear in the code at all.

    An Association is much more concrete. It is usually implemented by an instance variable (attribute/field) in the class which is referencing the other one. If it is a bidirectional Association the other class has a corresponding attribute. If the upper bound is 1 the corresponding role is a plain Java field. If greater than one a collection is used. Another implementation scheme would be using an extra class which has a collection of link tuples. For bidirectional Associations you might want to investigate for “referential integrity” as well.

    An Aggregation is a special kind of Association. The difference in code usually is that the aggregate usually get it’s parts already at construction time (e.g. in the constructor).

    You can experiment with implementation styles (so called CodeStyles) e.g. with UML Lab – it allows you to see different Association implementations (Note: I’m an employee of the vendor of UML Lab). There are numerous other UML tools which generate code for Associations, of course.

    Reading a book about it – as AmitD suggested – wouldn’t hurt, as Associations can become quite complex.

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

Sidebar

Related Questions

I have image map that can I move, but this map will be so
In Bash I can create a map (hashtable) with this common construction hput() {
I can't beleive there's no easy way to do such a basic thing like
I can't understand why does this code fail with segfault: #include <cstdlib> #include <iostream>
I am familiar with Java Collection Framework which contains basic interfaces: Collection and Map
this seems pretty basic stuff here, but actually i'm finding it a bit harsh
I need to create a map that can contain as its value any basic
How I can map a service running on a specific port number to an
I'm writing a lightweight ORM that can map database columns to instance fields with
Is it expected behavior that two encodings can map to the same decoding? I'm

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.