Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
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 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
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 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy MarcFriend
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
Re: Fundamental question on array/list instance specifications for UML interaction call messages [message #695071 is a reply to message #694115] Sun, 10 July 2011 23:19 Go to previous messageGo to next message
Ed Seidewitz is currently offline Ed SeidewitzFriend
Messages: 9
Registered: July 2011
Junior Member
Timothy --

As far as I can tell, this really is a UML bug. The Interactions clause was improved quite a bit in the UML 2.4 specification, but there are still some real problems with it. The workarounds, as you noted, are to use OpaqueExpression or Expression (both of which can be used directly as ValueSpecifications by the way -- you don't need to use an InstanceSpecification for the list itself).

I suggest that you log this as an issue with OMG by sending the text of your original post to issue@omg.org. (I checked and there does not seem to be an issue yet logged on this particular bug, though duplicate issues 8781/8786 have been long open on the general problems of handling arguments in the UML 2 metamodel.)

-- Ed

Re: Fundamental question on array/list instance specifications for UML interaction call messages [message #696912 is a reply to message #695071] Fri, 15 July 2011 05:26 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 161
Registered: July 2009
Senior Member
Thanks for jumping in, Ed! I knew this one was up your alley...
Previous Topic:runtime error when creating a simple class in a java program
Next Topic:"bug" in the properties view
Goto Forum:
  


Current Time: Thu Apr 25 23:08:28 GMT 2024

Powered by FUDForum. Page generated in 0.02966 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top