|
|
Re: how can i customize primitive types to contain a few more attributes? [message #797207 is a reply to message #793982] |
Mon, 13 February 2012 07:08 |
Eclipse User |
|
|
|
Hi all,
@Ed: Sorry, but this is not true for UML. Technically, you can actually put
as many attributes into a PrimitiveType as you would like to. PrimitiveType
is a subclass of DataType, so it inherits the capabilities of owning
attributes and operations. At least the MARTE profile makes use of this
capability, when defining the allowed operations on a primitive type. You
could even specialize PrimitiveTypes.
Semantically, primitive type are kind of abstract data types, i.e. a data
structure that is hidden behind a scalara knowledge attribute, thus, the
details of the data implementation's are not relevant at this level of
abstraction. I would go for DataType rather, if I want to model attributes
and constraints on that attributes.
Marc-Florian
"Ed Willink" schrieb im Newsbeitrag news:jguk0s$9j9$1@news.eclipse.org...
Hi
Primitive Types are absolutekly not extensible; they are primitive.
If for instance you want a length with units then use a class with value
and units properties.
Regards
Ed Willink
On 08/02/2012 09:24, B Simpson wrote:
> hi,
> i'd like to specify additional properties to my data types.
> the idea is that i would import XMLprimitivetypes and somehow customized
> them/extended them.
>
> i can imagine i would use stereotypes for that. i would have class 'User'
> with attribute 'login' which would have 'max_length' set to 255.
> perhaps i could have 'login' field set to 'String' and then apply 'String'
> stereotype to it (having 'max_length' 255) if that is still clear.
> could i possibly do it by 'extending' primitive types? or is it a no-no
> alternative?
|
|
|
Re: how can i customize primitive types to contain a few more attributes? [message #797287 is a reply to message #797207] |
Mon, 13 February 2012 09:25 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Florian
Certainly PrimitiveType is extensible to allow all its instances to have
for instance an asciiRepresentation. But the Primitive Types (String
etc) do not define a mechanism whereby just String has a toUpperCase()
operation. The UML Primitive Types are magic; they have values without
any associated attributes, operations or supertypes. This vagueness is
good. It requires and allows practical usages to define them. So OCL has
a StringValue to realize the StringType with corresponding operations.
Regards
Ed Willink
On 13/02/2012 07:08, Florian Wendland wrote:
> Hi all,
>
> @Ed: Sorry, but this is not true for UML. Technically, you can
> actually put as many attributes into a PrimitiveType as you would like
> to. PrimitiveType is a subclass of DataType, so it inherits the
> capabilities of owning attributes and operations. At least the MARTE
> profile makes use of this capability, when defining the allowed
> operations on a primitive type. You could even specialize PrimitiveTypes.
>
> Semantically, primitive type are kind of abstract data types, i.e. a
> data structure that is hidden behind a scalara knowledge attribute,
> thus, the details of the data implementation's are not relevant at
> this level of abstraction. I would go for DataType rather, if I want
> to model attributes and constraints on that attributes.
>
> Marc-Florian
>
> "Ed Willink" schrieb im Newsbeitrag
> news:jguk0s$9j9$1@news.eclipse.org...
>
> Hi
>
> Primitive Types are absolutekly not extensible; they are primitive.
>
> If for instance you want a length with units then use a class with value
> and units properties.
>
> Regards
>
> Ed Willink
>
> On 08/02/2012 09:24, B Simpson wrote:
>> hi,
>> i'd like to specify additional properties to my data types.
>> the idea is that i would import XMLprimitivetypes and somehow
>> customized them/extended them.
>>
>> i can imagine i would use stereotypes for that. i would have class
>> 'User' with attribute 'login' which would have 'max_length' set to 255.
>> perhaps i could have 'login' field set to 'String' and then apply
>> 'String' stereotype to it (having 'max_length' 255) if that is still
>> clear.
>> could i possibly do it by 'extending' primitive types? or is it a
>> no-no alternative?
>
|
|
|
Powered by
FUDForum. Page generated in 0.03237 seconds