Home » Modeling » UML2 » Fundamental question on array/list instance specifications for UML interaction call messages
Fundamental question on array/list instance specifications for UML interaction call messages [message #693807] |
Thu, 07 July 2011 08:30 |
Timothy Marc Messages: 547 Registered: July 2009 |
Senior Member |
|
|
Hi guys,
I have a very fundamental questions regarding how to model instance
specifications representing arrays/list. I've to use them within UML
interactions, more precisely in a sequence diagram. Let's consider a very
simple example:
There is an operation with the following signature
Op1(in par1 : String [0..1], in par2 : String [0..*], in par3 : String [1])
Let's consider as well, there are two fictional lifelines caller and callee,
where the caller calls Op1 method on callee.
In UML interactions, there is the possibility to convey a message call with
concrete arguments (ValueSpecification). The UML spec defines, that an
argument is related to a parameter of the message call by their order, so
the first arguments must correspond to the first parameter of the invoked
operation, and so forth.
Let's get to the gist of the matter: How would you model the array in the
middle as an instance specification?
I really do not see how multiple values of one classifier can be expressed
in an instance specification. The problem is, that multiple values within an
instance specification are only allowed for slots, representing multivalued
properties. Since this parameter is sort of a standalone parameter, i.e. not
embedded into a surrounding classifier as an attribute.
I mean, there are other "workarounds" like using the specification property
of instance specification and adding OpaqueExpression or Expression filled
with multiple values. But this does not feel like being "correct". Actually,
I believe this is really a bug in UML that should be fixed.
Any other opinions, thoughts, suggestions on this are highly appreciated. In
fact, I have not encountered a problem in UML for which I do not see an
almost good solution for long time now.
Timothy
|
|
|
Re: Fundamental question on array/list instance specifications for UML interaction call messages [message #693846 is a reply to message #693807] |
Thu, 07 July 2011 09:20 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Timothy
I'm not sure whether this addresses you problem, but there is a
recognition of an asymmetry between UML and OCL type declarations:
e.g: 'UML': myOperation(arg : Type[0..4] {ordered, unique})
e.g. OCL: myOperation(arg: OrderedSet(Bag(Type))
UML can specify arbitrary bounds which OCL cannot
OCL can specify nested collections which UML cannot
A suggested merged capability is
myOperation(arg : Sequence<Bag<Type>[0..4]>[*])
Regards
Ed Willink
On 07/07/2011 09:30, Timothy Marc wrote:
> Hi guys,
>
> I have a very fundamental questions regarding how to model instance
> specifications representing arrays/list. I've to use them within UML
> interactions, more precisely in a sequence diagram. Let's consider a
> very simple example:
>
> There is an operation with the following signature
>
> Op1(in par1 : String [0..1], in par2 : String [0..*], in par3 : String
> [1])
>
> Let's consider as well, there are two fictional lifelines caller and
> callee, where the caller calls Op1 method on callee.
>
> In UML interactions, there is the possibility to convey a message call
> with concrete arguments (ValueSpecification). The UML spec defines,
> that an argument is related to a parameter of the message call by
> their order, so the first arguments must correspond to the first
> parameter of the invoked operation, and so forth.
>
> Let's get to the gist of the matter: How would you model the array in
> the middle as an instance specification?
>
> I really do not see how multiple values of one classifier can be
> expressed in an instance specification. The problem is, that multiple
> values within an instance specification are only allowed for slots,
> representing multivalued properties. Since this parameter is sort of a
> standalone parameter, i.e. not embedded into a surrounding classifier
> as an attribute.
>
> I mean, there are other "workarounds" like using the specification
> property of instance specification and adding OpaqueExpression or
> Expression filled with multiple values. But this does not feel like
> being "correct". Actually, I believe this is really a bug in UML that
> should be fixed.
>
> Any other opinions, thoughts, suggestions on this are highly
> appreciated. In fact, I have not encountered a problem in UML for
> which I do not see an almost good solution for long time now.
>
> Timothy
|
|
|
Re: Fundamental question on array/list instance specifications for UML interaction call messages [message #694115 is a reply to message #693846] |
Thu, 07 July 2011 20:31 |
Timothy Marc Messages: 547 Registered: July 2009 |
Senior Member |
|
|
Hi Ed,
well, this does not help me very much. I was asking how to model concrete
instance specifications for arrays instead of defining the signature of an
operation that incorporate an array.
Timothy
"Ed Willink" schrieb im Newsbeitrag news:iv3t6a$oin$1@news.eclipse.org...
Hi Timothy
I'm not sure whether this addresses you problem, but there is a
recognition of an asymmetry between UML and OCL type declarations:
e.g: 'UML': myOperation(arg : Type[0..4] {ordered, unique})
e.g. OCL: myOperation(arg: OrderedSet(Bag(Type))
UML can specify arbitrary bounds which OCL cannot
OCL can specify nested collections which UML cannot
A suggested merged capability is
myOperation(arg : Sequence<Bag<Type>[0..4]>[*])
Regards
Ed Willink
On 07/07/2011 09:30, Timothy Marc wrote:
> Hi guys,
>
> I have a very fundamental questions regarding how to model instance
> specifications representing arrays/list. I've to use them within UML
> interactions, more precisely in a sequence diagram. Let's consider a very
> simple example:
>
> There is an operation with the following signature
>
> Op1(in par1 : String [0..1], in par2 : String [0..*], in par3 : String
> [1])
>
> Let's consider as well, there are two fictional lifelines caller and
> callee, where the caller calls Op1 method on callee.
>
> In UML interactions, there is the possibility to convey a message call
> with concrete arguments (ValueSpecification). The UML spec defines, that
> an argument is related to a parameter of the message call by their order,
> so the first arguments must correspond to the first parameter of the
> invoked operation, and so forth.
>
> Let's get to the gist of the matter: How would you model the array in the
> middle as an instance specification?
>
> I really do not see how multiple values of one classifier can be expressed
> in an instance specification. The problem is, that multiple values within
> an instance specification are only allowed for slots, representing
> multivalued properties. Since this parameter is sort of a standalone
> parameter, i.e. not embedded into a surrounding classifier as an
> attribute.
>
> I mean, there are other "workarounds" like using the specification
> property of instance specification and adding OpaqueExpression or
> Expression filled with multiple values. But this does not feel like being
> "correct". Actually, I believe this is really a bug in UML that should be
> fixed.
>
> Any other opinions, thoughts, suggestions on this are highly appreciated.
> In fact, I have not encountered a problem in UML for which I do not see an
> almost good solution for long time now.
>
> Timothy
|
|
| | |
Goto Forum:
Current Time: Thu Apr 25 16:30:13 GMT 2024
Powered by FUDForum. Page generated in 0.02777 seconds
|