Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Can enumerations specialize primitive types ?
Can enumerations specialize primitive types ? [message #471821] Tue, 27 March 2007 15:44 Go to next message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
A UML Enumeration (metaclass) is a kind of UML Classifier (metaclass),
and the same is true for the UML PrimitiveType.

As we all know, Classifiers can have a Generalization association (and
relationship) between them.

Questions:

1. Does UML2 (i.e. the specs) allow that enumerations in a user model
specialize (via instance of the UML Generalization metaclass) primitive
types defined in a user model (e.g. in a model library) ?

Our specific use case would be that the user model defines an
enumeration which specalizes a primitive type defined in a model library
which specializes one of the UML defined primitive types (that latter
specialization we have working, the question is about the former).

2. Does the UML2 implementation of Eclipse support that ?

Andy
Re: Can enumerations specialize primitive types ? [message #471925 is a reply to message #471821] Tue, 27 March 2007 16:44 Go to previous messageGo to next message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Andy,
The UML2 spec prohibits this, so the UML2 implementation cannot support
it. Or at a minimum, must create a validation error if your model
includes such structures.

I use a model structure almost exactly like what you describe in my XSD
modeling tools, except that I define my datatype model libraries using
instances of DataType instead of PrimitiveType. Modeling this way, an
Enumeration *can* extend a DataType -- this is allowed by the spec. And
a DataType can extend a DataType. But a DataType cannot extend a
PrimitiveType.

Cheers,
Dave Carlson

Andreas Maier wrote:
> A UML Enumeration (metaclass) is a kind of UML Classifier (metaclass),
> and the same is true for the UML PrimitiveType.
>
> As we all know, Classifiers can have a Generalization association (and
> relationship) between them.
>
> Questions:
>
> 1. Does UML2 (i.e. the specs) allow that enumerations in a user model
> specialize (via instance of the UML Generalization metaclass) primitive
> types defined in a user model (e.g. in a model library) ?
>
> Our specific use case would be that the user model defines an
> enumeration which specalizes a primitive type defined in a model library
> which specializes one of the UML defined primitive types (that latter
> specialization we have working, the question is about the former).
>
> 2. Does the UML2 implementation of Eclipse support that ?
>
> Andy
Re: Can enumerations specialize primitive types ? [message #471941 is a reply to message #471925] Wed, 28 March 2007 10:13 Go to previous messageGo to next message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Dave,
would you mind pointing me to the place in the UML specs where it says
that an Enumeration instance cannot specialize an PrimitiveType instance
by means of a Generalization instance ? I did not find any such
restriction in the UML Superstructure Spec V2.1.1.

Andy

Dave Carlson wrote:
> Andy,
> The UML2 spec prohibits this, so the UML2 implementation cannot support
> it. Or at a minimum, must create a validation error if your model
> includes such structures.
>
> I use a model structure almost exactly like what you describe in my XSD
> modeling tools, except that I define my datatype model libraries using
> instances of DataType instead of PrimitiveType. Modeling this way, an
> Enumeration *can* extend a DataType -- this is allowed by the spec. And
> a DataType can extend a DataType. But a DataType cannot extend a
> PrimitiveType.
>
> Cheers,
> Dave Carlson
>
> Andreas Maier wrote:
>> A UML Enumeration (metaclass) is a kind of UML Classifier (metaclass),
>> and the same is true for the UML PrimitiveType.
>>
>> As we all know, Classifiers can have a Generalization association (and
>> relationship) between them.
>>
>> Questions:
>>
>> 1. Does UML2 (i.e. the specs) allow that enumerations in a user model
>> specialize (via instance of the UML Generalization metaclass)
>> primitive types defined in a user model (e.g. in a model library) ?
>>
>> Our specific use case would be that the user model defines an
>> enumeration which specalizes a primitive type defined in a model
>> library which specializes one of the UML defined primitive types (that
>> latter specialization we have working, the question is about the former).
>>
>> 2. Does the UML2 implementation of Eclipse support that ?
>>
>> Andy
Re: Can enumerations specialize primitive types ? [message #471944 is a reply to message #471941] Wed, 28 March 2007 12:22 Go to previous messageGo to next message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Andy,
It is a constraint on all Classifier generalizations, p. 54 of the 2.1.1
spec. PrimitiveType is a peer metaclass with Enumeration, both have
DataType as their superclass. Thus, PrimitiveType is not of the same or
more general type wrt Enumeration.

I investigated this a year ago, because I wanted to do exactly what you
are trying to do...

[8] The query maySpecializeType() determines whether this classifier may
have a generalization relationship to classifiers of
the specified type. By default a classifier may specialize classifiers
of the same or a more general type. It is intended to be
redefined by classifiers that have different specialization constraints.

Classifier::maySpecializeType(c : Classifier) : Boolean;
maySpecializeType = self.oclIsKindOf(c.oclType)

Andreas Maier wrote:
> Dave,
> would you mind pointing me to the place in the UML specs where it says
> that an Enumeration instance cannot specialize an PrimitiveType instance
> by means of a Generalization instance ? I did not find any such
> restriction in the UML Superstructure Spec V2.1.1.
>
Re: Can enumerations specialize primitive types ? [message #471949 is a reply to message #471944] Wed, 28 March 2007 12:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi,

In case it isn't clear, the wording of this query might rather use the term
"metaclass" than "type". So, read it as:

The query maySpecializeType() determines whether this classifier may
have a generalization relationship to classifiers of the specified
[metaclass]. By default a classifier may specialize classifiers
of the same or a more general [metaclass]. It is intended to be
redefined by classifiers that have different specialization constraints.

Another important consequence of this constraint is that AssociationClasses
may specialize Classes, but not vice-versa.

I'll pick on the OCL representation of this constraint, too: note that
"oclType" is not a property (nor is "oclType()" an operation) defined by
OCL. As it stands, today, this constraint cannot be specified in OCL; OCL
provides no facility for reflection on the metamodel.

Cheers,

Christian


Dave Carlson wrote:

> Andy,
> It is a constraint on all Classifier generalizations, p. 54 of the 2.1.1
> spec. PrimitiveType is a peer metaclass with Enumeration, both have
> DataType as their superclass. Thus, PrimitiveType is not of the same or
> more general type wrt Enumeration.
>
> I investigated this a year ago, because I wanted to do exactly what you
> are trying to do...
>
> [8] The query maySpecializeType() determines whether this classifier may
> have a generalization relationship to classifiers of
> the specified type. By default a classifier may specialize classifiers
> of the same or a more general type. It is intended to be
> redefined by classifiers that have different specialization constraints.
>
> Classifier::maySpecializeType(c : Classifier) : Boolean;
> maySpecializeType = self.oclIsKindOf(c.oclType)
>
> Andreas Maier wrote:
>> Dave,
>> would you mind pointing me to the place in the UML specs where it says
>> that an Enumeration instance cannot specialize an PrimitiveType instance
>> by means of a Generalization instance ? I did not find any such
>> restriction in the UML Superstructure Spec V2.1.1.
>>
Re: Can enumerations specialize primitive types ? [message #471962 is a reply to message #471949] Wed, 28 March 2007 15:26 Go to previous messageGo to next message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Dave, Christian,
I think it is clear now. Thanks!

I first was confused whether you are talking about specialization in a
user model, vs. specialization in the UML metaclass hierarchy, but the
key to understand is that the query maySpecializeType() defines a
default rule that (sort of) maps the UML metaclass inheritance hierarchy
into the type inheritance hierarchy of the user model.

I agree with Christian that the clarity of the text would benefit from
talking about metaclasses.

Let me know if you are aware of an existing OMG issue about this,
otherwise I'd submit one.

Thanks again for your help!

Andy

Christian W. Damus wrote:
> Hi,
>
> In case it isn't clear, the wording of this query might rather use the term
> "metaclass" than "type". So, read it as:
>
> The query maySpecializeType() determines whether this classifier may
> have a generalization relationship to classifiers of the specified
> [metaclass]. By default a classifier may specialize classifiers
> of the same or a more general [metaclass]. It is intended to be
> redefined by classifiers that have different specialization constraints.
>
> Another important consequence of this constraint is that AssociationClasses
> may specialize Classes, but not vice-versa.
>
> I'll pick on the OCL representation of this constraint, too: note that
> "oclType" is not a property (nor is "oclType()" an operation) defined by
> OCL. As it stands, today, this constraint cannot be specified in OCL; OCL
> provides no facility for reflection on the metamodel.
>
> Cheers,
>
> Christian
>
>
> Dave Carlson wrote:
>
>> Andy,
>> It is a constraint on all Classifier generalizations, p. 54 of the 2.1.1
>> spec. PrimitiveType is a peer metaclass with Enumeration, both have
>> DataType as their superclass. Thus, PrimitiveType is not of the same or
>> more general type wrt Enumeration.
>>
>> I investigated this a year ago, because I wanted to do exactly what you
>> are trying to do...
>>
>> [8] The query maySpecializeType() determines whether this classifier may
>> have a generalization relationship to classifiers of
>> the specified type. By default a classifier may specialize classifiers
>> of the same or a more general type. It is intended to be
>> redefined by classifiers that have different specialization constraints.
>>
>> Classifier::maySpecializeType(c : Classifier) : Boolean;
>> maySpecializeType = self.oclIsKindOf(c.oclType)
>>
>> Andreas Maier wrote:
>>> Dave,
>>> would you mind pointing me to the place in the UML specs where it says
>>> that an Enumeration instance cannot specialize an PrimitiveType instance
>>> by means of a Generalization instance ? I did not find any such
>>> restriction in the UML Superstructure Spec V2.1.1.
>>>
>
Re: Can enumerations specialize primitive types ? [message #471972 is a reply to message #471962] Wed, 28 March 2007 15:53 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Andy,
This issue is close to the topic you are questioning:
http://www.omg.org/issues/issue7223.txt

Also see my posting to the Eclipse UML2 newsgroup in Sept 2005 where I
cited this OMG issue. My reference to RSA in that posting referred to
RSA 6.0. That limitation has been resolved in RSA 7.
http://dev.eclipse.org/newslists/news.eclipse.tools.uml2/msg 01971.html

As far as I can see, the OMG issue has no response and no action plan...

Dave

Andreas Maier wrote:
>
> Let me know if you are aware of an existing OMG issue about this,
> otherwise I'd submit one.
>
> Thanks again for your help!
>
> Andy
>
Re: Can enumerations specialize primitive types ? [message #603261 is a reply to message #471821] Tue, 27 March 2007 16:44 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Andy,
The UML2 spec prohibits this, so the UML2 implementation cannot support
it. Or at a minimum, must create a validation error if your model
includes such structures.

I use a model structure almost exactly like what you describe in my XSD
modeling tools, except that I define my datatype model libraries using
instances of DataType instead of PrimitiveType. Modeling this way, an
Enumeration *can* extend a DataType -- this is allowed by the spec. And
a DataType can extend a DataType. But a DataType cannot extend a
PrimitiveType.

Cheers,
Dave Carlson

Andreas Maier wrote:
> A UML Enumeration (metaclass) is a kind of UML Classifier (metaclass),
> and the same is true for the UML PrimitiveType.
>
> As we all know, Classifiers can have a Generalization association (and
> relationship) between them.
>
> Questions:
>
> 1. Does UML2 (i.e. the specs) allow that enumerations in a user model
> specialize (via instance of the UML Generalization metaclass) primitive
> types defined in a user model (e.g. in a model library) ?
>
> Our specific use case would be that the user model defines an
> enumeration which specalizes a primitive type defined in a model library
> which specializes one of the UML defined primitive types (that latter
> specialization we have working, the question is about the former).
>
> 2. Does the UML2 implementation of Eclipse support that ?
>
> Andy
Re: Can enumerations specialize primitive types ? [message #604049 is a reply to message #471925] Wed, 28 March 2007 10:13 Go to previous message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Dave,
would you mind pointing me to the place in the UML specs where it says
that an Enumeration instance cannot specialize an PrimitiveType instance
by means of a Generalization instance ? I did not find any such
restriction in the UML Superstructure Spec V2.1.1.

Andy

Dave Carlson wrote:
> Andy,
> The UML2 spec prohibits this, so the UML2 implementation cannot support
> it. Or at a minimum, must create a validation error if your model
> includes such structures.
>
> I use a model structure almost exactly like what you describe in my XSD
> modeling tools, except that I define my datatype model libraries using
> instances of DataType instead of PrimitiveType. Modeling this way, an
> Enumeration *can* extend a DataType -- this is allowed by the spec. And
> a DataType can extend a DataType. But a DataType cannot extend a
> PrimitiveType.
>
> Cheers,
> Dave Carlson
>
> Andreas Maier wrote:
>> A UML Enumeration (metaclass) is a kind of UML Classifier (metaclass),
>> and the same is true for the UML PrimitiveType.
>>
>> As we all know, Classifiers can have a Generalization association (and
>> relationship) between them.
>>
>> Questions:
>>
>> 1. Does UML2 (i.e. the specs) allow that enumerations in a user model
>> specialize (via instance of the UML Generalization metaclass)
>> primitive types defined in a user model (e.g. in a model library) ?
>>
>> Our specific use case would be that the user model defines an
>> enumeration which specalizes a primitive type defined in a model
>> library which specializes one of the UML defined primitive types (that
>> latter specialization we have working, the question is about the former).
>>
>> 2. Does the UML2 implementation of Eclipse support that ?
>>
>> Andy
Re: Can enumerations specialize primitive types ? [message #604053 is a reply to message #471941] Wed, 28 March 2007 12:22 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Andy,
It is a constraint on all Classifier generalizations, p. 54 of the 2.1.1
spec. PrimitiveType is a peer metaclass with Enumeration, both have
DataType as their superclass. Thus, PrimitiveType is not of the same or
more general type wrt Enumeration.

I investigated this a year ago, because I wanted to do exactly what you
are trying to do...

[8] The query maySpecializeType() determines whether this classifier may
have a generalization relationship to classifiers of
the specified type. By default a classifier may specialize classifiers
of the same or a more general type. It is intended to be
redefined by classifiers that have different specialization constraints.

Classifier::maySpecializeType(c : Classifier) : Boolean;
maySpecializeType = self.oclIsKindOf(c.oclType)

Andreas Maier wrote:
> Dave,
> would you mind pointing me to the place in the UML specs where it says
> that an Enumeration instance cannot specialize an PrimitiveType instance
> by means of a Generalization instance ? I did not find any such
> restriction in the UML Superstructure Spec V2.1.1.
>
Re: Can enumerations specialize primitive types ? [message #604059 is a reply to message #471944] Wed, 28 March 2007 12:47 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi,

In case it isn't clear, the wording of this query might rather use the term
"metaclass" than "type". So, read it as:

The query maySpecializeType() determines whether this classifier may
have a generalization relationship to classifiers of the specified
[metaclass]. By default a classifier may specialize classifiers
of the same or a more general [metaclass]. It is intended to be
redefined by classifiers that have different specialization constraints.

Another important consequence of this constraint is that AssociationClasses
may specialize Classes, but not vice-versa.

I'll pick on the OCL representation of this constraint, too: note that
"oclType" is not a property (nor is "oclType()" an operation) defined by
OCL. As it stands, today, this constraint cannot be specified in OCL; OCL
provides no facility for reflection on the metamodel.

Cheers,

Christian


Dave Carlson wrote:

> Andy,
> It is a constraint on all Classifier generalizations, p. 54 of the 2.1.1
> spec. PrimitiveType is a peer metaclass with Enumeration, both have
> DataType as their superclass. Thus, PrimitiveType is not of the same or
> more general type wrt Enumeration.
>
> I investigated this a year ago, because I wanted to do exactly what you
> are trying to do...
>
> [8] The query maySpecializeType() determines whether this classifier may
> have a generalization relationship to classifiers of
> the specified type. By default a classifier may specialize classifiers
> of the same or a more general type. It is intended to be
> redefined by classifiers that have different specialization constraints.
>
> Classifier::maySpecializeType(c : Classifier) : Boolean;
> maySpecializeType = self.oclIsKindOf(c.oclType)
>
> Andreas Maier wrote:
>> Dave,
>> would you mind pointing me to the place in the UML specs where it says
>> that an Enumeration instance cannot specialize an PrimitiveType instance
>> by means of a Generalization instance ? I did not find any such
>> restriction in the UML Superstructure Spec V2.1.1.
>>
Re: Can enumerations specialize primitive types ? [message #604079 is a reply to message #471949] Wed, 28 March 2007 15:26 Go to previous message
Andreas Maier is currently offline Andreas MaierFriend
Messages: 32
Registered: July 2009
Member
Dave, Christian,
I think it is clear now. Thanks!

I first was confused whether you are talking about specialization in a
user model, vs. specialization in the UML metaclass hierarchy, but the
key to understand is that the query maySpecializeType() defines a
default rule that (sort of) maps the UML metaclass inheritance hierarchy
into the type inheritance hierarchy of the user model.

I agree with Christian that the clarity of the text would benefit from
talking about metaclasses.

Let me know if you are aware of an existing OMG issue about this,
otherwise I'd submit one.

Thanks again for your help!

Andy

Christian W. Damus wrote:
> Hi,
>
> In case it isn't clear, the wording of this query might rather use the term
> "metaclass" than "type". So, read it as:
>
> The query maySpecializeType() determines whether this classifier may
> have a generalization relationship to classifiers of the specified
> [metaclass]. By default a classifier may specialize classifiers
> of the same or a more general [metaclass]. It is intended to be
> redefined by classifiers that have different specialization constraints.
>
> Another important consequence of this constraint is that AssociationClasses
> may specialize Classes, but not vice-versa.
>
> I'll pick on the OCL representation of this constraint, too: note that
> "oclType" is not a property (nor is "oclType()" an operation) defined by
> OCL. As it stands, today, this constraint cannot be specified in OCL; OCL
> provides no facility for reflection on the metamodel.
>
> Cheers,
>
> Christian
>
>
> Dave Carlson wrote:
>
>> Andy,
>> It is a constraint on all Classifier generalizations, p. 54 of the 2.1.1
>> spec. PrimitiveType is a peer metaclass with Enumeration, both have
>> DataType as their superclass. Thus, PrimitiveType is not of the same or
>> more general type wrt Enumeration.
>>
>> I investigated this a year ago, because I wanted to do exactly what you
>> are trying to do...
>>
>> [8] The query maySpecializeType() determines whether this classifier may
>> have a generalization relationship to classifiers of
>> the specified type. By default a classifier may specialize classifiers
>> of the same or a more general type. It is intended to be
>> redefined by classifiers that have different specialization constraints.
>>
>> Classifier::maySpecializeType(c : Classifier) : Boolean;
>> maySpecializeType = self.oclIsKindOf(c.oclType)
>>
>> Andreas Maier wrote:
>>> Dave,
>>> would you mind pointing me to the place in the UML specs where it says
>>> that an Enumeration instance cannot specialize an PrimitiveType instance
>>> by means of a Generalization instance ? I did not find any such
>>> restriction in the UML Superstructure Spec V2.1.1.
>>>
>
Re: Can enumerations specialize primitive types ? [message #604094 is a reply to message #471962] Wed, 28 March 2007 15:53 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Andy,
This issue is close to the topic you are questioning:
http://www.omg.org/issues/issue7223.txt

Also see my posting to the Eclipse UML2 newsgroup in Sept 2005 where I
cited this OMG issue. My reference to RSA in that posting referred to
RSA 6.0. That limitation has been resolved in RSA 7.
http://dev.eclipse.org/newslists/news.eclipse.tools.uml2/msg 01971.html

As far as I can see, the OMG issue has no response and no action plan...

Dave

Andreas Maier wrote:
>
> Let me know if you are aware of an existing OMG issue about this,
> otherwise I'd submit one.
>
> Thanks again for your help!
>
> Andy
>
Previous Topic:Installing uml2...
Next Topic:Creating a Usage programmatically
Goto Forum:
  


Current Time: Thu Mar 28 13:59:15 GMT 2024

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

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

Back to the top