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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:45:19+00:00 2026-05-26T08:45:19+00:00

I am not sure if I do use the association and aggregation or composition

  • 0

I am not sure if I do use the association and aggregation or composition diamond properly.

I would use the Association for interfaces, because I can’t instantiate them. Like they do it here for example. Or for static classes, same reason.

And the diamonds I use only for objects I can instantiate. Like normal classes.

But I am not sure if this is the correct way to differentiate them, because if you check again, you will see they aren’t so specific about it. In the UML 2.3 specification I couldn’t get out more, so how are you using it?

And there is a third manner, the dashed lined <> arrow, but I don’t have a glue when to use this one. So maybe you can help me with that one, too?

  • 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-05-26T08:45:20+00:00Added an answer on May 26, 2026 at 8:45 am

    I would use the Association for interfaces, because I can’t instantiate them. Like they do it here for example. Or for static classes, same reason.

    And the diamonds I use only for objects I can instantiate. Like normal classes.

    That’s not really how they work. The three forms (Association, Aggregation and Composition) define different properties about a relationship. All three are normally used between classes although can relate Interfaces too. Association and Composition are the two easiest:

    • Association (no diamond) is the most general form, allowing cardinality and navigability to be defined at both ends.
    • Composition (filled diamond) is a whole-part relationship where the ‘whole’ (end with the black diamond) ‘contains’ the part. It imposes two key restrictions:
      1. There can only be 1 container (i.e. cardinality at whole end is exactly 1);
      2. It imposes a lifecycle responsibility for parts on the whole. So the container is responsible for creating and deleting parts. A part cannot continue to exist if its container is deleted.

    Aggregation (unfilled diamond) sits somewhere in the middle. It’s a bit like composition – except it doesn’t mandate the properties described above. I don’t personally use it. The semantics are too unclear for it to be worthwhile.

    And there is a third manner, the dashed lined <> arrow, but I don’t have a glue when to use this one.

    I think you mean the dependency relationship. It’s a weaker form of association. As an example, take the following class definition

    class Foo {
    
     def bar(Baz: aParam) {
      ...
     }
    }
    

    In this case type Foo has a dependency on type Baz from its use in the bar() method signature. However there’s no association between them (can’t sensibly discuss e.g. cardinality of relationship between an instance of Foo and an instance of Baz).

    From a practical perspective I’d say:

    • you can use straight Associations for 80%+ of the relationships you’re likely to want to model
    • Composition probably accounts for most of the remaining scenarios
    • Dependency can be useful in some circumstances
    • You can get by quite happily without ever using Aggregation.

    hth.

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

Sidebar

Related Questions

I would like to use VB9 but am not sure what syntax to use
I am not sure, whether I should use for -loop. Perhaps, like for i
I'm not sure how to use composite key. My Categories table has CategoryId (PK,FK),
I've found ScriptingJsonSerializationSection but I'm not sure how to use it. I could write
I'm using JPA but I'm not sure how to use it for relation between
I am working on threading in MFC..I am not sure how to use threading..
Not sure this is a programming question, but we use LaTeX for all our
Not sure if this counts as programming related, it's a tool that I use.
I am not sure when I should use anonymous types instead of local variables
I'm not sure what kind of terminology to use in this so please edit

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.