UML aggregation X composition

Asked

Viewed 395 times

4

Studying associations in UML ( aggregation and composition) I realized that the difference between them would be only the existence or not of the parts without the whole.

http://ericksasse.com.br/agregao-x-composio/

  • Aggregation => Parts exist without the whole
  • Composition => Parts do not exist without the whole

The two deal with rules in the Part object, but I couldn’t find anything that denoted rules in the Todo object, example:

An order (All) consists of items (Part), there are no items without the whole (composition), the question is that a request also does not exist without items, how to represent this rule in UML? that is, where I say that the whole object also does not exist without the part object?

  • 2

    Read in http://answall.com/q/86715/101

  • It seems to me that the only way to achieve what I mentioned is by using multiplicity, that is, an explicit statement. Request must have 1.. * items.

1 answer

2


It is an interesting question. It has to do with the Use Case - Customer -> Order. Describing the main functionalities of the system and the interaction of these functionalities with the users of the same system. This artifact is commonly derived from the requirements specification, which in turn is not part of UML. However, we can express using UML standards for documentation of use cases.

Some books state that the whole does not exist (or make no sense) without the parts. As well as the aggregation, you should model a composition when the goal of your model is to describe the structure of a relationship. A composition explicitly shows the whole/part structural relationship. So it is implied that: "the Whole object also does not exist without the Part object".

Composition

  • A variation of the aggregation type
  • Represents a stronger bond between whole objects and part objects
  • Part-objects have to belong to the whole-object
  • The whole does not exist (or make no sense) without the parts
  • Or, the parts don’t exist without the whole

Browser other questions tagged

You are not signed in. Login or sign up in order to post.