Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How get actual class attributes from uml class
How get actual class attributes from uml class [message #473297] Tue, 26 June 2007 05:01 Go to next message
Lasith is currently offline LasithFriend
Messages: 29
Registered: July 2009
Junior Member
Hi All,

With the uml2 API I could not find a way to get actual class attributes
(except class properties for relationship ends).
We can use umlClass.getAttributes() method to get attributes related to a
class. But it returns relationship ends also as attributes. The
getAttributes() method returns list of properties.
So tried with property.isAttribute(p) method to check those properties for
class attributes. But it always returns false. Also I could not understand
why this isAttribute() method requires a parameter. Because we are always
invoking this isAttribute() for property so what is the meaning of passing
another property type parameter to it.

Thanks and Regards,
Re: How get actual class attributes from uml class [message #473301 is a reply to message #473297] Tue, 26 June 2007 08:58 Go to previous messageGo to next message
Francis Gavino is currently offline Francis GavinoFriend
Messages: 57
Registered: July 2009
Member
Hi there,

You could use Property.getAssociation() != null, but this is, in my
opinion, not really an elegant solution. Ideally there should be some way
to get the list of attributes without inspecting each one of them. If
someone has a better idea, please post here. Thanks!

Regards,
Francis

uml user wrote:

> Hi All,

> With the uml2 API I could not find a way to get actual class attributes
> (except class properties for relationship ends).
> We can use umlClass.getAttributes() method to get attributes related to a
> class. But it returns relationship ends also as attributes. The
> getAttributes() method returns list of properties.
> So tried with property.isAttribute(p) method to check those properties for
> class attributes. But it always returns false. Also I could not understand
> why this isAttribute() method requires a parameter. Because we are always
> invoking this isAttribute() for property so what is the meaning of passing
> another property type parameter to it.

> Thanks and Regards,
Re: How to get actual class attributes from uml class [message #473306 is a reply to message #473301] Tue, 26 June 2007 13:12 Go to previous messageGo to next message
Lasith is currently offline LasithFriend
Messages: 29
Registered: July 2009
Junior Member
Hi,

Thanks Francis,
But I think there must be a way to get those class attributes more easily
(as you mentioned in your mail).

Regards.
Re: How to get actual class attributes from uml class [message #473313 is a reply to message #473306] Tue, 26 June 2007 20:53 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi uml user,

I think Francis is right, his suggestion seems to be the only way to figure
out what you want.
There does seem to be something wrong with Property#isAttribute(p) ... I'll
double check that one.

- James.


"uml user" <lasith100@yahoo.com> wrote in message
news:6e5a64973b2c7e2443c1d3080ad6707c$1@www.eclipse.org...
> Hi,
>
> Thanks Francis,
> But I think there must be a way to get those class attributes more easily
> (as you mentioned in your mail).
>
> Regards.
>
Re: How to get actual class attributes from uml class [message #473315 is a reply to message #473313] Wed, 27 June 2007 04:18 Go to previous messageGo to next message
Lasith is currently offline LasithFriend
Messages: 29
Registered: July 2009
Junior Member
James Bruck wrote:

> Hi uml user,

> I think Francis is right, his suggestion seems to be the only way to figure
> out what you want.
> There does seem to be something wrong with Property#isAttribute(p) ... I'll
> double check that one.

> - James.


> "uml user" <lasith100@yahoo.com> wrote in message
> news:6e5a64973b2c7e2443c1d3080ad6707c$1@www.eclipse.org...
>> Hi,
>>
>> Thanks Francis,
>> But I think there must be a way to get those class attributes more easily
>> (as you mentioned in your mail).
>>
>> Regards.
>>
Hi James,

Thanks for your reply,
If you find something other way please let me know.

Regards,
- Lasith
Re: How to get actual class attributes from uml class [message #473650 is a reply to message #473315] Wed, 04 July 2007 19:52 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Lasith,

There is currently no convenient method for obtaining the attributes which
are not also association ends. Feel free to submit an enhancement request in
Bugzilla.

The isAttribute(Property) method requires an argument because the OCL query
from which it is generated was poorly defined in the UML specification:

[4] The query isAttribute() is true if the Property is defined as an
attribute of some classifier
context Property::isAttribute(p : Property) : Boolean
post: result = Classifier.allInstances->exists(c|
c.attribute->includes(p))

We'll open an issue with the OMG.

Kenn

"lasith" <lasith100@yahoo.com> wrote in message
news:b035f84b29a9c103e799adb34ebacf4a$1@www.eclipse.org...
> James Bruck wrote:
>
>> Hi uml user,
>
>> I think Francis is right, his suggestion seems to be the only way to
>> figure
>> out what you want.
>> There does seem to be something wrong with Property#isAttribute(p) ...
>> I'll
>> double check that one.
>
>> - James.
>
>
>> "uml user" <lasith100@yahoo.com> wrote in message
>> news:6e5a64973b2c7e2443c1d3080ad6707c$1@www.eclipse.org...
>>> Hi,
>>>
>>> Thanks Francis,
>>> But I think there must be a way to get those class attributes more
>>> easily
>>> (as you mentioned in your mail).
>>>
>>> Regards.
>>>
> Hi James,
>
> Thanks for your reply,
> If you find something other way please let me know.
>
> Regards,
> - Lasith
>
Re: How to get actual class attributes from uml class [message #473774 is a reply to message #473650] Fri, 06 July 2007 09:01 Go to previous messageGo to next message
Lasith is currently offline LasithFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Kenn,

Thanks for the reply.
But I can't understand the actual usage of isAttribute(Property) method.

Regards,
- Lasith.

Kenn Hussey wrote:

> Lasith,

> There is currently no convenient method for obtaining the attributes which
> are not also association ends. Feel free to submit an enhancement request in
> Bugzilla.

> The isAttribute(Property) method requires an argument because the OCL query
> from which it is generated was poorly defined in the UML specification:

> [4] The query isAttribute() is true if the Property is defined as an
> attribute of some classifier
> context Property::isAttribute(p : Property) : Boolean
> post: result = Classifier.allInstances->exists(c|
> c.attribute->includes(p))

> We'll open an issue with the OMG.

> Kenn

> "lasith" <lasith100@yahoo.com> wrote in message
> news:b035f84b29a9c103e799adb34ebacf4a$1@www.eclipse.org...
>> James Bruck wrote:
>>
>>> Hi uml user,
>>
>>> I think Francis is right, his suggestion seems to be the only way to
>>> figure
>>> out what you want.
>>> There does seem to be something wrong with Property#isAttribute(p) ...
>>> I'll
>>> double check that one.
>>
>>> - James.
>>
>>
>>> "uml user" <lasith100@yahoo.com> wrote in message
>>> news:6e5a64973b2c7e2443c1d3080ad6707c$1@www.eclipse.org...
>>>> Hi,
>>>>
>>>> Thanks Francis,
>>>> But I think there must be a way to get those class attributes more
>>>> easily
>>>> (as you mentioned in your mail).
>>>>
>>>> Regards.
>>>>
>> Hi James,
>>
>> Thanks for your reply,
>> If you find something other way please let me know.
>>
>> Regards,
>> - Lasith
>>
Re: How to get actual class attributes from uml class [message #473877 is a reply to message #473774] Fri, 06 July 2007 13:01 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Lasith,

I'm not sure the method has any practical use either, but it's in the
specification, so we need to include it in the API. One thing the method
will tell you is whether the property is owned by a classifier (as opposed
to a property that has no owner, or is perhaps a qualifier for another
property).

Kenn

"lasith" <lasith100@yahoo.com> wrote in message
news:5cc34316f548e0958d58ffacd4852620$1@www.eclipse.org...
> Hi Kenn,
>
> Thanks for the reply.
> But I can't understand the actual usage of isAttribute(Property) method.
>
> Regards,
> - Lasith.
>
> Kenn Hussey wrote:
>
>> Lasith,
>
>> There is currently no convenient method for obtaining the attributes
>> which are not also association ends. Feel free to submit an enhancement
>> request in Bugzilla.
>
>> The isAttribute(Property) method requires an argument because the OCL
>> query from which it is generated was poorly defined in the UML
>> specification:
>
>> [4] The query isAttribute() is true if the Property is defined as an
>> attribute of some classifier
>> context Property::isAttribute(p : Property) : Boolean
>> post: result = Classifier.allInstances->exists(c|
>> c.attribute->includes(p))
>
>> We'll open an issue with the OMG.
>
>> Kenn
>
>> "lasith" <lasith100@yahoo.com> wrote in message
>> news:b035f84b29a9c103e799adb34ebacf4a$1@www.eclipse.org...
>>> James Bruck wrote:
>>>
>>>> Hi uml user,
>>>
>>>> I think Francis is right, his suggestion seems to be the only way to
>>>> figure
>>>> out what you want.
>>>> There does seem to be something wrong with Property#isAttribute(p) ...
>>>> I'll
>>>> double check that one.
>>>
>>>> - James.
>>>
>>>
>>>> "uml user" <lasith100@yahoo.com> wrote in message
>>>> news:6e5a64973b2c7e2443c1d3080ad6707c$1@www.eclipse.org...
>>>>> Hi,
>>>>>
>>>>> Thanks Francis,
>>>>> But I think there must be a way to get those class attributes more
>>>>> easily
>>>>> (as you mentioned in your mail).
>>>>>
>>>>> Regards.
>>>>>
>>> Hi James,
>>>
>>> Thanks for your reply,
>>> If you find something other way please let me know.
>>>
>>> Regards,
>>> - Lasith
>>>
>
Re: How get actual class attributes from uml class [message #622568 is a reply to message #473297] Tue, 26 June 2007 08:58 Go to previous message
Francis Gavino is currently offline Francis GavinoFriend
Messages: 57
Registered: July 2009
Member
Hi there,

You could use Property.getAssociation() != null, but this is, in my
opinion, not really an elegant solution. Ideally there should be some way
to get the list of attributes without inspecting each one of them. If
someone has a better idea, please post here. Thanks!

Regards,
Francis

uml user wrote:

> Hi All,

> With the uml2 API I could not find a way to get actual class attributes
> (except class properties for relationship ends).
> We can use umlClass.getAttributes() method to get attributes related to a
> class. But it returns relationship ends also as attributes. The
> getAttributes() method returns list of properties.
> So tried with property.isAttribute(p) method to check those properties for
> class attributes. But it always returns false. Also I could not understand
> why this isAttribute() method requires a parameter. Because we are always
> invoking this isAttribute() for property so what is the meaning of passing
> another property type parameter to it.

> Thanks and Regards,
Re: How to get actual class attributes from uml class [message #622571 is a reply to message #473301] Tue, 26 June 2007 13:12 Go to previous message
Lasith is currently offline LasithFriend
Messages: 29
Registered: July 2009
Junior Member
Hi,

Thanks Francis,
But I think there must be a way to get those class attributes more easily
(as you mentioned in your mail).

Regards.
Re: How to get actual class attributes from uml class [message #622577 is a reply to message #473306] Tue, 26 June 2007 20:53 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi uml user,

I think Francis is right, his suggestion seems to be the only way to figure
out what you want.
There does seem to be something wrong with Property#isAttribute(p) ... I'll
double check that one.

- James.


"uml user" <lasith100@yahoo.com> wrote in message
news:6e5a64973b2c7e2443c1d3080ad6707c$1@www.eclipse.org...
> Hi,
>
> Thanks Francis,
> But I think there must be a way to get those class attributes more easily
> (as you mentioned in your mail).
>
> Regards.
>
Re: How to get actual class attributes from uml class [message #622579 is a reply to message #473313] Wed, 27 June 2007 04:18 Go to previous message
Lasith is currently offline LasithFriend
Messages: 29
Registered: July 2009
Junior Member
James Bruck wrote:

> Hi uml user,

> I think Francis is right, his suggestion seems to be the only way to figure
> out what you want.
> There does seem to be something wrong with Property#isAttribute(p) ... I'll
> double check that one.

> - James.


> "uml user" <lasith100@yahoo.com> wrote in message
> news:6e5a64973b2c7e2443c1d3080ad6707c$1@www.eclipse.org...
>> Hi,
>>
>> Thanks Francis,
>> But I think there must be a way to get those class attributes more easily
>> (as you mentioned in your mail).
>>
>> Regards.
>>
Hi James,

Thanks for your reply,
If you find something other way please let me know.

Regards,
- Lasith
Re: How to get actual class attributes from uml class [message #622722 is a reply to message #473315] Wed, 04 July 2007 19:52 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Lasith,

There is currently no convenient method for obtaining the attributes which
are not also association ends. Feel free to submit an enhancement request in
Bugzilla.

The isAttribute(Property) method requires an argument because the OCL query
from which it is generated was poorly defined in the UML specification:

[4] The query isAttribute() is true if the Property is defined as an
attribute of some classifier
context Property::isAttribute(p : Property) : Boolean
post: result = Classifier.allInstances->exists(c|
c.attribute->includes(p))

We'll open an issue with the OMG.

Kenn

"lasith" <lasith100@yahoo.com> wrote in message
news:b035f84b29a9c103e799adb34ebacf4a$1@www.eclipse.org...
> James Bruck wrote:
>
>> Hi uml user,
>
>> I think Francis is right, his suggestion seems to be the only way to
>> figure
>> out what you want.
>> There does seem to be something wrong with Property#isAttribute(p) ...
>> I'll
>> double check that one.
>
>> - James.
>
>
>> "uml user" <lasith100@yahoo.com> wrote in message
>> news:6e5a64973b2c7e2443c1d3080ad6707c$1@www.eclipse.org...
>>> Hi,
>>>
>>> Thanks Francis,
>>> But I think there must be a way to get those class attributes more
>>> easily
>>> (as you mentioned in your mail).
>>>
>>> Regards.
>>>
> Hi James,
>
> Thanks for your reply,
> If you find something other way please let me know.
>
> Regards,
> - Lasith
>
Re: How to get actual class attributes from uml class [message #622847 is a reply to message #473650] Fri, 06 July 2007 09:01 Go to previous message
Lasith is currently offline LasithFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Kenn,

Thanks for the reply.
But I can't understand the actual usage of isAttribute(Property) method.

Regards,
- Lasith.

Kenn Hussey wrote:

> Lasith,

> There is currently no convenient method for obtaining the attributes which
> are not also association ends. Feel free to submit an enhancement request in
> Bugzilla.

> The isAttribute(Property) method requires an argument because the OCL query
> from which it is generated was poorly defined in the UML specification:

> [4] The query isAttribute() is true if the Property is defined as an
> attribute of some classifier
> context Property::isAttribute(p : Property) : Boolean
> post: result = Classifier.allInstances->exists(c|
> c.attribute->includes(p))

> We'll open an issue with the OMG.

> Kenn

> "lasith" <lasith100@yahoo.com> wrote in message
> news:b035f84b29a9c103e799adb34ebacf4a$1@www.eclipse.org...
>> James Bruck wrote:
>>
>>> Hi uml user,
>>
>>> I think Francis is right, his suggestion seems to be the only way to
>>> figure
>>> out what you want.
>>> There does seem to be something wrong with Property#isAttribute(p) ...
>>> I'll
>>> double check that one.
>>
>>> - James.
>>
>>
>>> "uml user" <lasith100@yahoo.com> wrote in message
>>> news:6e5a64973b2c7e2443c1d3080ad6707c$1@www.eclipse.org...
>>>> Hi,
>>>>
>>>> Thanks Francis,
>>>> But I think there must be a way to get those class attributes more
>>>> easily
>>>> (as you mentioned in your mail).
>>>>
>>>> Regards.
>>>>
>> Hi James,
>>
>> Thanks for your reply,
>> If you find something other way please let me know.
>>
>> Regards,
>> - Lasith
>>
Re: How to get actual class attributes from uml class [message #622854 is a reply to message #473774] Fri, 06 July 2007 13:01 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Lasith,

I'm not sure the method has any practical use either, but it's in the
specification, so we need to include it in the API. One thing the method
will tell you is whether the property is owned by a classifier (as opposed
to a property that has no owner, or is perhaps a qualifier for another
property).

Kenn

"lasith" <lasith100@yahoo.com> wrote in message
news:5cc34316f548e0958d58ffacd4852620$1@www.eclipse.org...
> Hi Kenn,
>
> Thanks for the reply.
> But I can't understand the actual usage of isAttribute(Property) method.
>
> Regards,
> - Lasith.
>
> Kenn Hussey wrote:
>
>> Lasith,
>
>> There is currently no convenient method for obtaining the attributes
>> which are not also association ends. Feel free to submit an enhancement
>> request in Bugzilla.
>
>> The isAttribute(Property) method requires an argument because the OCL
>> query from which it is generated was poorly defined in the UML
>> specification:
>
>> [4] The query isAttribute() is true if the Property is defined as an
>> attribute of some classifier
>> context Property::isAttribute(p : Property) : Boolean
>> post: result = Classifier.allInstances->exists(c|
>> c.attribute->includes(p))
>
>> We'll open an issue with the OMG.
>
>> Kenn
>
>> "lasith" <lasith100@yahoo.com> wrote in message
>> news:b035f84b29a9c103e799adb34ebacf4a$1@www.eclipse.org...
>>> James Bruck wrote:
>>>
>>>> Hi uml user,
>>>
>>>> I think Francis is right, his suggestion seems to be the only way to
>>>> figure
>>>> out what you want.
>>>> There does seem to be something wrong with Property#isAttribute(p) ...
>>>> I'll
>>>> double check that one.
>>>
>>>> - James.
>>>
>>>
>>>> "uml user" <lasith100@yahoo.com> wrote in message
>>>> news:6e5a64973b2c7e2443c1d3080ad6707c$1@www.eclipse.org...
>>>>> Hi,
>>>>>
>>>>> Thanks Francis,
>>>>> But I think there must be a way to get those class attributes more
>>>>> easily
>>>>> (as you mentioned in your mail).
>>>>>
>>>>> Regards.
>>>>>
>>> Hi James,
>>>
>>> Thanks for your reply,
>>> If you find something other way please let me know.
>>>
>>> Regards,
>>> - Lasith
>>>
>
Previous Topic:EMF.edit commands
Next Topic:Re: Import XMI
Goto Forum:
  


Current Time: Fri Mar 29 12:56:25 GMT 2024

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

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

Back to the top