Multiplicity of 0..1 on composition end
From: Matthias Hofmann (hofmann_at_anvil-soft.com)
Date: 03/26/05
- Next message: Shayne Wissler: "Re: Design is intent."
- Previous message: H. S. Lahman: "Re: On the combination of AOP and GP"
- Next in thread: Calum Grant: "Re: Multiplicity of 0..1 on composition end"
- Reply: Calum Grant: "Re: Multiplicity of 0..1 on composition end"
- Reply: karl.wettin_at_gmail.com: "Re: Multiplicity of 0..1 on composition end"
- Reply: Lurker: "Re: Multiplicity of 0..1 on composition end"
- Reply: H. S. Lahman: "Re: Multiplicity of 0..1 on composition end"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 26 Mar 2005 17:59:40 +0100
Hello!
The concept of composite aggregation seems to be a controversial matter. The
latest thread I started in order to discuss this topic resultated in a
heated debate lasting several weeks. This makes me reluctant to post any
question about that issue, but it looks like I do not have a choice...
The focus of my problem is the following statement from 3.48.1 in Version
1.5 of the OMG Unified Modeling Language Specification, which describes the
semantics of a composition:
"The multiplicity of the aggregate end may not exceed one (it is unshared)."
It seems clear that according to this rule, the multiplicity of the
aggregate end of a composition may be either 1 or 0..1. While there seems to
be common agreement over the meaning of the former case (a multiplicty of
exactly one), the latter situation (a multiplicity of zero or one) remains a
mystery.
I consulted several text books on the UML in order to find out how a
multiplicity of zero or one is supposed to be interpreted. Unfortunately,
the outcome of my research is rather unsatisfactory. The vast majority of
text books keeps quiet about the existence of a multiplicty of zero or one
and insists that the only multiplicity allowed one the aggregate end of a
composition is exactly one. Only a single book mentioned the theoretical
possibility of a multiplicty of zero or one, but also labeled it nonsense
which should be avoided.
I am convinced that said multiplicity of zero or one has a well-defined
meaning. There was also a footnote in one book stating that some people
interpret such a multiplicity of zero or one in such a way that the part can
be created outside the whole and added to the whole at a later time.
However, this seems to contradict the rule that "the composite object has
sole responsibility for the disposition of its parts" (also found in
3.48.1).
Another interpretation I got to know during the debate mentioned at the
beginning of this post is that a multiplicity of zero or one means that the
part can be removed from the whole. This leads to my own 'favorite'
interpretion, which is as follows:
If (and only if) the multiplicty on the aggregation end of a composition is
zero or one, then the part can exist without the whole. An example (in
C/C++) would be:
struct X
{
int i;
};
Or as a diagram:
0..1 1
| X |<#>-----------| int |
(I hope the layout is not messed up to much due to various character sets.
My intent is to show a diagram with a class "X" and a class "int". The
multiplicity is "0..1" one the whole end and "1" one the part end of the
composition.)
The way I would interpret such a diagram with my present knowledge is that
an object of type "int" can exist as part of an object of type "X", but
there are also stand-alone objects of type "int". If the multiplicity on the
whole end where "1" instead of "0..1", then an object of type "int" could
*only* exist as part of an object of type "X".
Answering the question about how to interpret a multiplicity of zero or one
on the aggregation end of a composition would bring me much closer to my
goal of understanding the concept of composition in the UML. I appreciate
your thoughts and comments.
Best regards,
Matthias Hofmann
- Next message: Shayne Wissler: "Re: Design is intent."
- Previous message: H. S. Lahman: "Re: On the combination of AOP and GP"
- Next in thread: Calum Grant: "Re: Multiplicity of 0..1 on composition end"
- Reply: Calum Grant: "Re: Multiplicity of 0..1 on composition end"
- Reply: karl.wettin_at_gmail.com: "Re: Multiplicity of 0..1 on composition end"
- Reply: Lurker: "Re: Multiplicity of 0..1 on composition end"
- Reply: H. S. Lahman: "Re: Multiplicity of 0..1 on composition end"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|