Domanda

I have this relation:

A Email is sent to multiple Contacts so:

Email ♢---(has)------------- Contacts

Given that Contacts can be contained in many emails and Emails can contain many contacts, then:

Email ♢ (0..*)--------(1..*) Contacts

Is it correct? Can I now read Email contains multiple Contacts and Contacts are contained in 0 or more emails?

È stato utile?

Soluzione

The cardinality is right. I'd lose the diamond though, there's no need for it. What you have is a straight many:many binary association. Aggregation is not a particularly helpful adornment, see here for an explanation.

hth.

Altri suggerimenti

The association, if arrows in both sides are used, means TWO different attributes, in two different instances of two different classes. And each of the attributes looks at the opposite class. So, you are right.

And with "shared aggregation"=empty diamond, you are right, too. According to the UML standard, they are not strictly defined and it it up to us how to use them. There ARE many Emails in a Contact? Put a diamond. There ARE many contacts in an email? Put another diamond. Only you should definitely decide, what they mean to you. For example, having a list of references.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top