[UML Forum] Difference between InstanceSpecification and LiteralSpecification

4 views
Skip to first unread message

Timothy Marc

unread,
Jul 9, 2010, 4:03:43 AM7/9/10
to umlf...@googlegroups.com

Hi all,

 

i have a question regarding the instantiation of primitive types in UML2. The spec itself provides two different mechanisms for it and I would like to ensure whether there are semantically equivalent or different.

 

On the one hand, there is the metaclass InstanceSpecification. It may point to a classifier (e.g. a primitive type String). Through its specification association, it is possible to pass a value to this instance. In this case, the InstanceSpecification won’t own slots.

 

Another possibility is to use LiteralString, to describe the fix value of a string more intuitively.

 

Both kind of values may be passed through messages in an interaction. So the basic question for me is whether there is any senseful and meaningful semantical difference between both concepts.

 

Thanks a lot

Timothy

 

 

H. S. Lahman

unread,
Jul 9, 2010, 11:28:44 AM7/9/10
to umlf...@googlegroups.com
Responding to Marc...

> On the one hand, there is the metaclass InstanceSpecification. It may
> point to a classifier (e.g. a primitive type String). Through its
> specification association, it is possible to pass a value to this

> instance. In this case, the InstanceSpecification won�t own slots.
>

This mechanism is the one sued to describe ADTs (see my response to your
other message) when they are complex data structures with discrete,
different, identifiable members. Thus an ADT of ComplexNumber actually
represents a data structure of {real, imaginary} where 'real' and
'imaginary' have quite different semantics (at least to an EE or a
mathematician). One needs to provide a specification of the individual
components.

> Another possibility is to use LiteralString, to describe the fix value
> of a string more intuitively.
>

This is a short cut for the situation where the ADT is actually an
aggregate of elements of the same type. In particular, it deals with the
very common special situation of an invariant text string.

Note that both of these apply to the situation where the object
knowledge attribute is manipulated as-is. That is, UML is standardizing
a mechanism for use in other contexts like operator overloading. Thus
one can define '+' to do the correct thing for two ComplexNumber ADTs.
The manipulation of real and imaginary parts will be completely hidden
by the overloaded operator implementation, but that operator
implementation is not possible without some specification of what the
ADT actually is.

Life is the only flaw in an otherwise perfect nonexistence
-- Schopenhauer

H. S. Lahman
H.la...@verizon.net
software blog: http://pathfinderpeople.blogs.com/hslahman/index.html

Reply all
Reply to author
Forward
0 new messages