Home » Modeling » UML2 » Problems with UML2::NamedElement::isDistinguishableFrom
|
Re: Problems with UML2::NamedElement::isDistinguishableFrom [message #473893 is a reply to message #473891] |
Mon, 09 July 2007 15:21 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Anders,
The query isDistinguishableFrom() is checking metatypes not types.
In your case, the warning appears because the metatypes of "property" in
"Class" are the same ( Propety ) and the names are also the same.
The OCL as it appears in the spec is not entirely correct since it uses
"..self.oclType", where "oclType" is not properly formed OCL (I double
checked that with Christian Damus <aka Mr.OCL > )
The query behaves as you would expect most programming languages to behave
( Java in particular ). For example, you would get a warning if you had
two attributes with the same name even if their types were different.
The query should return true in a scenario where you have a nested Class and
a nested Interface under a namespace that have the same name. In that case,
the metatypes would be different.
Regards,
- James.
<user@domain.com> wrote in message news:468F7DC6.8050409@domain.com...
> Hi,
>
> I seem to have a problem with my reading understanding of the query
> NamedElement::isDistinguishableFrom()
>
> UML 2007-02-03, "The query isDistinguishableFrom() determines whether
> two NamedElements may logically co-exist within a Namespace.
> By default, two named elements are distinguishable if (a) they have
> unrelated types or (b) they have related types but
> different names."
>
>
> A warning is issued for atttached small file.
> "Not all the members of namespace '<Class> Class' are distinguishable
> within it."
>
> note: Im using the latest Europe 3.3 release.
>
> thanks
> /anders
>
------------------------------------------------------------ ----------------
----
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Package xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
xmi:id="_xZ0P4SpPEdybW4WcTRWaZg">
> <eAnnotations xmi:id="_2CQoASx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CQoAix7EdyIN_9H57vYNQ" key="uuid"
value="_2CQoACx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <packagedElement xmi:type="uml:DataType"
xmi:id="_3MagoCpPEdybW4WcTRWaZg" name="A">
> <eAnnotations xmi:id="_2CQoBCx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CQoBSx7EdyIN_9H57vYNQ" key="uuid"
value="_2CQoAyx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <ownedAttribute xmi:id="_5XvIsCpPEdybW4WcTRWaZg" name="property"
type="_PNCdICx2EdyhfbRgxFvqZQ" aggregation="composite">
> <eAnnotations xmi:id="_2CQoByx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CQoCCx7EdyIN_9H57vYNQ" key="uuid"
value="_2CQoBix7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> </packagedElement>
> <packagedElement xmi:type="uml:Class" xmi:id="_7f7kQCpPEdybW4WcTRWaZg"
name="Class">
> <eAnnotations xmi:id="_2CQoCix7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CQoCyx7EdyIN_9H57vYNQ" key="uuid"
value="_2CQoCSx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <ownedAttribute xmi:id="_B9caQCpQEdybW4WcTRWaZg" name="property"
type="_3MagoCpPEdybW4WcTRWaZg" isReadOnly="true" isDerived="true"
isDerivedUnion="true" aggregation="composite">
> <eAnnotations xmi:id="_2CaZASx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CaZAix7EdyIN_9H57vYNQ" key="uuid"
value="_2CaZACx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_uG_-0CpQEdybW4WcTRWaZg" value="*">
> <eAnnotations xmi:id="_2CaZBCx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CaZBSx7EdyIN_9H57vYNQ" key="uuid"
value="_2CaZAyx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </upperValue>
> <lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_ti8PgCpQEdybW4WcTRWaZg">
> <eAnnotations xmi:id="_2CaZByx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CaZCCx7EdyIN_9H57vYNQ" key="uuid"
value="_2CaZBix7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </lowerValue>
> </ownedAttribute>
> <ownedAttribute xmi:id="_Dq9sACpQEdybW4WcTRWaZg" name="property"
type="_8k7dcCpPEdybW4WcTRWaZg" aggregation="composite">
> <eAnnotations xmi:id="_2CaZCix7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CaZCyx7EdyIN_9H57vYNQ" key="uuid"
value="_2CaZCSx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> <ownedAttribute xmi:type="uml:Port" xmi:id="_m1ptMCx2EdyhfbRgxFvqZQ"
name="port" aggregation="composite">
> <eAnnotations xmi:id="_2Cji8Sx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2Cji8ix7EdyIN_9H57vYNQ" key="uuid"
value="_2Cji8Cx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> </packagedElement>
> <packagedElement xmi:type="uml:DataType"
xmi:id="_8k7dcCpPEdybW4WcTRWaZg" name="B">
> <eAnnotations xmi:id="_2Cji9Cx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2Cji9Sx7EdyIN_9H57vYNQ" key="uuid"
value="_2Cji8yx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </packagedElement>
> <packagedElement xmi:type="uml:PrimitiveType"
xmi:id="_9pxloCpPEdybW4WcTRWaZg" name="P">
> <eAnnotations xmi:id="_2Cji9yx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2Cji-Cx7EdyIN_9H57vYNQ" key="uuid"
value="_2Cji9ix7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <ownedAttribute xmi:id="_AKZvUCpQEdybW4WcTRWaZg" name="property"
aggregation="composite">
> <eAnnotations xmi:id="_2Cji-ix7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2Cji-yx7EdyIN_9H57vYNQ" key="uuid"
value="_2Cji-Sx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> </packagedElement>
> <packagedElement xmi:type="uml:DataType"
xmi:id="_PNCdICx2EdyhfbRgxFvqZQ" name="DataType">
> <eAnnotations xmi:id="_2CtT-ix7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CtT-yx7EdyIN_9H57vYNQ" key="uuid"
value="_2CtT-Sx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <ownedAttribute xmi:id="_QX2DYCx2EdyhfbRgxFvqZQ" name="property"
aggregation="composite">
> <eAnnotations xmi:id="_2CtUACx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CtUASx7EdyIN_9H57vYNQ" key="uuid"
value="_2CtT_yx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> </packagedElement>
> <packagedElement xmi:type="uml:Component"
xmi:id="_oATicCx2EdyhfbRgxFvqZQ" name="Component">
> <eAnnotations xmi:id="_2C3E8Sx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2C3E8ix7EdyIN_9H57vYNQ" key="uuid"
value="_2C3E8Cx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <ownedAttribute xmi:type="uml:Port" xmi:id="_oh_TMCx2EdyhfbRgxFvqZQ"
name="port" aggregation="composite">
> <eAnnotations xmi:id="_2C3E9Cx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2C3E9Sx7EdyIN_9H57vYNQ" key="uuid"
value="_2C3E8yx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> </packagedElement>
> </uml:Package>
>
------------------------------------------------------------ ----------------
----
|
|
|
Re: Problems with UML2::NamedElement::isDistinguishableFrom [message #473947 is a reply to message #473893] |
Wed, 11 July 2007 13:23 |
user Messages: 296 Registered: July 2009 |
Senior Member |
|
|
Hi James,
Thanks with the reading help, i see now what i missed!
Unfortunately I was hoping that the rule was wider than what its is.
Im trying to layer different kinds of naming-conventions ontop of CMOF
and UML2 (namespace, named element), but one of the really tricky one
allows same named properties with different property-type:s.
Personally I objected to that particular rule but for some reasons it
was needed.
It would have been great if the Infrastructure: E/CMOF Namedelement
isDistinguishableFrom would have been more permissive in order to allow
flexible naming conventions. And then UML2 could have restricted the
query to get better alignment with realisation technologies..
thanks
/anders
James Bruck wrote:
> Hi Anders,
>
> The query isDistinguishableFrom() is checking metatypes not types.
> In your case, the warning appears because the metatypes of "property" in
> "Class" are the same ( Propety ) and the names are also the same.
>
> The OCL as it appears in the spec is not entirely correct since it uses
> "..self.oclType", where "oclType" is not properly formed OCL (I double
> checked that with Christian Damus <aka Mr.OCL > )
> The query behaves as you would expect most programming languages to behave
> ( Java in particular ). For example, you would get a warning if you had
> two attributes with the same name even if their types were different.
>
> The query should return true in a scenario where you have a nested Class and
> a nested Interface under a namespace that have the same name. In that case,
> the metatypes would be different.
>
> Regards,
>
> - James.
>
> <user@domain.com> wrote in message news:468F7DC6.8050409@domain.com...
>> Hi,
>>
>> I seem to have a problem with my reading understanding of the query
>> NamedElement::isDistinguishableFrom()
>>
>> UML 2007-02-03, "The query isDistinguishableFrom() determines whether
>> two NamedElements may logically co-exist within a Namespace.
>> By default, two named elements are distinguishable if (a) they have
>> unrelated types or (b) they have related types but
>> different names."
>>
>>
>> A warning is issued for atttached small file.
>> "Not all the members of namespace '<Class> Class' are distinguishable
>> within it."
>>
>> note: Im using the latest Europe 3.3 release.
>>
>> thanks
>> /anders
>>
>
>
> ------------------------------------------------------------ ----------------
> ----
>
>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <uml:Package xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xmi:id="_xZ0P4SpPEdybW4WcTRWaZg">
>> <eAnnotations xmi:id="_2CQoASx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CQoAix7EdyIN_9H57vYNQ" key="uuid"
> value="_2CQoACx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <packagedElement xmi:type="uml:DataType"
> xmi:id="_3MagoCpPEdybW4WcTRWaZg" name="A">
>> <eAnnotations xmi:id="_2CQoBCx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CQoBSx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CQoAyx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <ownedAttribute xmi:id="_5XvIsCpPEdybW4WcTRWaZg" name="property"
> type="_PNCdICx2EdyhfbRgxFvqZQ" aggregation="composite">
>> <eAnnotations xmi:id="_2CQoByx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CQoCCx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CQoBix7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> </packagedElement>
>> <packagedElement xmi:type="uml:Class" xmi:id="_7f7kQCpPEdybW4WcTRWaZg"
> name="Class">
>> <eAnnotations xmi:id="_2CQoCix7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CQoCyx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CQoCSx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <ownedAttribute xmi:id="_B9caQCpQEdybW4WcTRWaZg" name="property"
> type="_3MagoCpPEdybW4WcTRWaZg" isReadOnly="true" isDerived="true"
> isDerivedUnion="true" aggregation="composite">
>> <eAnnotations xmi:id="_2CaZASx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CaZAix7EdyIN_9H57vYNQ" key="uuid"
> value="_2CaZACx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_uG_-0CpQEdybW4WcTRWaZg" value="*">
>> <eAnnotations xmi:id="_2CaZBCx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CaZBSx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CaZAyx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </upperValue>
>> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_ti8PgCpQEdybW4WcTRWaZg">
>> <eAnnotations xmi:id="_2CaZByx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CaZCCx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CaZBix7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </lowerValue>
>> </ownedAttribute>
>> <ownedAttribute xmi:id="_Dq9sACpQEdybW4WcTRWaZg" name="property"
> type="_8k7dcCpPEdybW4WcTRWaZg" aggregation="composite">
>> <eAnnotations xmi:id="_2CaZCix7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CaZCyx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CaZCSx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> <ownedAttribute xmi:type="uml:Port" xmi:id="_m1ptMCx2EdyhfbRgxFvqZQ"
> name="port" aggregation="composite">
>> <eAnnotations xmi:id="_2Cji8Sx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2Cji8ix7EdyIN_9H57vYNQ" key="uuid"
> value="_2Cji8Cx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> </packagedElement>
>> <packagedElement xmi:type="uml:DataType"
> xmi:id="_8k7dcCpPEdybW4WcTRWaZg" name="B">
>> <eAnnotations xmi:id="_2Cji9Cx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2Cji9Sx7EdyIN_9H57vYNQ" key="uuid"
> value="_2Cji8yx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </packagedElement>
>> <packagedElement xmi:type="uml:PrimitiveType"
> xmi:id="_9pxloCpPEdybW4WcTRWaZg" name="P">
>> <eAnnotations xmi:id="_2Cji9yx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2Cji-Cx7EdyIN_9H57vYNQ" key="uuid"
> value="_2Cji9ix7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <ownedAttribute xmi:id="_AKZvUCpQEdybW4WcTRWaZg" name="property"
> aggregation="composite">
>> <eAnnotations xmi:id="_2Cji-ix7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2Cji-yx7EdyIN_9H57vYNQ" key="uuid"
> value="_2Cji-Sx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> </packagedElement>
>> <packagedElement xmi:type="uml:DataType"
> xmi:id="_PNCdICx2EdyhfbRgxFvqZQ" name="DataType">
>> <eAnnotations xmi:id="_2CtT-ix7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CtT-yx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CtT-Sx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <ownedAttribute xmi:id="_QX2DYCx2EdyhfbRgxFvqZQ" name="property"
> aggregation="composite">
>> <eAnnotations xmi:id="_2CtUACx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CtUASx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CtT_yx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> </packagedElement>
>> <packagedElement xmi:type="uml:Component"
> xmi:id="_oATicCx2EdyhfbRgxFvqZQ" name="Component">
>> <eAnnotations xmi:id="_2C3E8Sx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2C3E8ix7EdyIN_9H57vYNQ" key="uuid"
> value="_2C3E8Cx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <ownedAttribute xmi:type="uml:Port" xmi:id="_oh_TMCx2EdyhfbRgxFvqZQ"
> name="port" aggregation="composite">
>> <eAnnotations xmi:id="_2C3E9Cx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2C3E9Sx7EdyIN_9H57vYNQ" key="uuid"
> value="_2C3E8yx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> </packagedElement>
>> </uml:Package>
>>
>
>
> ------------------------------------------------------------ ----------------
> ----
>
>
>
>
>
|
|
|
Re: Problems with UML2::NamedElement::isDistinguishableFrom [message #473949 is a reply to message #473947] |
Wed, 11 July 2007 13:48 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Anders,
You might want to bring that up with OMG and attempt getting the spec
changed.
You can try sending an email to issues@omg.org or uml2-rtf@omg.org.
Unless you have very strong arguments against how the spec defines this
currently you might have a bit of a battle getting the spec changed :)
The opensource API really tries to follow the spec to the letter; warts and
all.
- James.
<user@domain.com> wrote in message news:f72lki$80c$1@build.eclipse.org...
> Hi James,
>
> Thanks with the reading help, i see now what i missed!
>
> Unfortunately I was hoping that the rule was wider than what its is.
>
> Im trying to layer different kinds of naming-conventions ontop of CMOF
> and UML2 (namespace, named element), but one of the really tricky one
> allows same named properties with different property-type:s.
>
> Personally I objected to that particular rule but for some reasons it
> was needed.
>
> It would have been great if the Infrastructure: E/CMOF Namedelement
> isDistinguishableFrom would have been more permissive in order to allow
> flexible naming conventions. And then UML2 could have restricted the
> query to get better alignment with realisation technologies..
>
> thanks
> /anders
>
>
> James Bruck wrote:
> > Hi Anders,
> >
> > The query isDistinguishableFrom() is checking metatypes not types.
> > In your case, the warning appears because the metatypes of "property" in
> > "Class" are the same ( Propety ) and the names are also the same.
> >
> > The OCL as it appears in the spec is not entirely correct since it uses
> > "..self.oclType", where "oclType" is not properly formed OCL (I double
> > checked that with Christian Damus <aka Mr.OCL > )
> > The query behaves as you would expect most programming languages to
behave
> > ( Java in particular ). For example, you would get a warning if you
had
> > two attributes with the same name even if their types were different.
> >
> > The query should return true in a scenario where you have a nested Class
and
> > a nested Interface under a namespace that have the same name. In that
case,
> > the metatypes would be different.
> >
> > Regards,
> >
> > - James.
> >
> > <user@domain.com> wrote in message news:468F7DC6.8050409@domain.com...
> >> Hi,
> >>
> >> I seem to have a problem with my reading understanding of the query
> >> NamedElement::isDistinguishableFrom()
> >>
> >> UML 2007-02-03, "The query isDistinguishableFrom() determines whether
> >> two NamedElements may logically co-exist within a Namespace.
> >> By default, two named elements are distinguishable if (a) they have
> >> unrelated types or (b) they have related types but
> >> different names."
> >>
> >>
> >> A warning is issued for atttached small file.
> >> "Not all the members of namespace '<Class> Class' are distinguishable
> >> within it."
> >>
> >> note: Im using the latest Europe 3.3 release.
> >>
> >> thanks
> >> /anders
> >>
> >
> >
>
> ------------------------------------------------------------ --------------
--
> > ----
> >
> >
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <uml:Package xmi:version="2.1"
> > xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> > xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> > xmi:id="_xZ0P4SpPEdybW4WcTRWaZg">
> >> <eAnnotations xmi:id="_2CQoASx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CQoAix7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CQoACx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <packagedElement xmi:type="uml:DataType"
> > xmi:id="_3MagoCpPEdybW4WcTRWaZg" name="A">
> >> <eAnnotations xmi:id="_2CQoBCx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CQoBSx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CQoAyx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <ownedAttribute xmi:id="_5XvIsCpPEdybW4WcTRWaZg" name="property"
> > type="_PNCdICx2EdyhfbRgxFvqZQ" aggregation="composite">
> >> <eAnnotations xmi:id="_2CQoByx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CQoCCx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CQoBix7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> </packagedElement>
> >> <packagedElement xmi:type="uml:Class"
xmi:id="_7f7kQCpPEdybW4WcTRWaZg"
> > name="Class">
> >> <eAnnotations xmi:id="_2CQoCix7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CQoCyx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CQoCSx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <ownedAttribute xmi:id="_B9caQCpQEdybW4WcTRWaZg" name="property"
> > type="_3MagoCpPEdybW4WcTRWaZg" isReadOnly="true" isDerived="true"
> > isDerivedUnion="true" aggregation="composite">
> >> <eAnnotations xmi:id="_2CaZASx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CaZAix7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CaZACx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> > xmi:id="_uG_-0CpQEdybW4WcTRWaZg" value="*">
> >> <eAnnotations xmi:id="_2CaZBCx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CaZBSx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CaZAyx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </upperValue>
> >> <lowerValue xmi:type="uml:LiteralInteger"
> > xmi:id="_ti8PgCpQEdybW4WcTRWaZg">
> >> <eAnnotations xmi:id="_2CaZByx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CaZCCx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CaZBix7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </lowerValue>
> >> </ownedAttribute>
> >> <ownedAttribute xmi:id="_Dq9sACpQEdybW4WcTRWaZg" name="property"
> > type="_8k7dcCpPEdybW4WcTRWaZg" aggregation="composite">
> >> <eAnnotations xmi:id="_2CaZCix7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CaZCyx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CaZCSx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> <ownedAttribute xmi:type="uml:Port"
xmi:id="_m1ptMCx2EdyhfbRgxFvqZQ"
> > name="port" aggregation="composite">
> >> <eAnnotations xmi:id="_2Cji8Sx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2Cji8ix7EdyIN_9H57vYNQ" key="uuid"
> > value="_2Cji8Cx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> </packagedElement>
> >> <packagedElement xmi:type="uml:DataType"
> > xmi:id="_8k7dcCpPEdybW4WcTRWaZg" name="B">
> >> <eAnnotations xmi:id="_2Cji9Cx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2Cji9Sx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2Cji8yx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </packagedElement>
> >> <packagedElement xmi:type="uml:PrimitiveType"
> > xmi:id="_9pxloCpPEdybW4WcTRWaZg" name="P">
> >> <eAnnotations xmi:id="_2Cji9yx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2Cji-Cx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2Cji9ix7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <ownedAttribute xmi:id="_AKZvUCpQEdybW4WcTRWaZg" name="property"
> > aggregation="composite">
> >> <eAnnotations xmi:id="_2Cji-ix7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2Cji-yx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2Cji-Sx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> </packagedElement>
> >> <packagedElement xmi:type="uml:DataType"
> > xmi:id="_PNCdICx2EdyhfbRgxFvqZQ" name="DataType">
> >> <eAnnotations xmi:id="_2CtT-ix7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CtT-yx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CtT-Sx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <ownedAttribute xmi:id="_QX2DYCx2EdyhfbRgxFvqZQ" name="property"
> > aggregation="composite">
> >> <eAnnotations xmi:id="_2CtUACx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CtUASx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CtT_yx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> </packagedElement>
> >> <packagedElement xmi:type="uml:Component"
> > xmi:id="_oATicCx2EdyhfbRgxFvqZQ" name="Component">
> >> <eAnnotations xmi:id="_2C3E8Sx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2C3E8ix7EdyIN_9H57vYNQ" key="uuid"
> > value="_2C3E8Cx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <ownedAttribute xmi:type="uml:Port"
xmi:id="_oh_TMCx2EdyhfbRgxFvqZQ"
> > name="port" aggregation="composite">
> >> <eAnnotations xmi:id="_2C3E9Cx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2C3E9Sx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2C3E8yx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> </packagedElement>
> >> </uml:Package>
> >>
> >
> >
>
> ------------------------------------------------------------ --------------
--
> > ----
> >
> >
> >
> >
> >
|
|
|
Re: Problems with UML2::NamedElement::isDistinguishableFrom [message #623307 is a reply to message #473891] |
Mon, 09 July 2007 15:21 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Anders,
The query isDistinguishableFrom() is checking metatypes not types.
In your case, the warning appears because the metatypes of "property" in
"Class" are the same ( Propety ) and the names are also the same.
The OCL as it appears in the spec is not entirely correct since it uses
"..self.oclType", where "oclType" is not properly formed OCL (I double
checked that with Christian Damus <aka Mr.OCL > )
The query behaves as you would expect most programming languages to behave
( Java in particular ). For example, you would get a warning if you had
two attributes with the same name even if their types were different.
The query should return true in a scenario where you have a nested Class and
a nested Interface under a namespace that have the same name. In that case,
the metatypes would be different.
Regards,
- James.
<user@domain.com> wrote in message news:468F7DC6.8050409@domain.com...
> Hi,
>
> I seem to have a problem with my reading understanding of the query
> NamedElement::isDistinguishableFrom()
>
> UML 2007-02-03, "The query isDistinguishableFrom() determines whether
> two NamedElements may logically co-exist within a Namespace.
> By default, two named elements are distinguishable if (a) they have
> unrelated types or (b) they have related types but
> different names."
>
>
> A warning is issued for atttached small file.
> "Not all the members of namespace '<Class> Class' are distinguishable
> within it."
>
> note: Im using the latest Europe 3.3 release.
>
> thanks
> /anders
>
------------------------------------------------------------ ----------------
----
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Package xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
xmi:id="_xZ0P4SpPEdybW4WcTRWaZg">
> <eAnnotations xmi:id="_2CQoASx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CQoAix7EdyIN_9H57vYNQ" key="uuid"
value="_2CQoACx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <packagedElement xmi:type="uml:DataType"
xmi:id="_3MagoCpPEdybW4WcTRWaZg" name="A">
> <eAnnotations xmi:id="_2CQoBCx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CQoBSx7EdyIN_9H57vYNQ" key="uuid"
value="_2CQoAyx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <ownedAttribute xmi:id="_5XvIsCpPEdybW4WcTRWaZg" name="property"
type="_PNCdICx2EdyhfbRgxFvqZQ" aggregation="composite">
> <eAnnotations xmi:id="_2CQoByx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CQoCCx7EdyIN_9H57vYNQ" key="uuid"
value="_2CQoBix7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> </packagedElement>
> <packagedElement xmi:type="uml:Class" xmi:id="_7f7kQCpPEdybW4WcTRWaZg"
name="Class">
> <eAnnotations xmi:id="_2CQoCix7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CQoCyx7EdyIN_9H57vYNQ" key="uuid"
value="_2CQoCSx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <ownedAttribute xmi:id="_B9caQCpQEdybW4WcTRWaZg" name="property"
type="_3MagoCpPEdybW4WcTRWaZg" isReadOnly="true" isDerived="true"
isDerivedUnion="true" aggregation="composite">
> <eAnnotations xmi:id="_2CaZASx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CaZAix7EdyIN_9H57vYNQ" key="uuid"
value="_2CaZACx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_uG_-0CpQEdybW4WcTRWaZg" value="*">
> <eAnnotations xmi:id="_2CaZBCx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CaZBSx7EdyIN_9H57vYNQ" key="uuid"
value="_2CaZAyx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </upperValue>
> <lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_ti8PgCpQEdybW4WcTRWaZg">
> <eAnnotations xmi:id="_2CaZByx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CaZCCx7EdyIN_9H57vYNQ" key="uuid"
value="_2CaZBix7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </lowerValue>
> </ownedAttribute>
> <ownedAttribute xmi:id="_Dq9sACpQEdybW4WcTRWaZg" name="property"
type="_8k7dcCpPEdybW4WcTRWaZg" aggregation="composite">
> <eAnnotations xmi:id="_2CaZCix7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CaZCyx7EdyIN_9H57vYNQ" key="uuid"
value="_2CaZCSx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> <ownedAttribute xmi:type="uml:Port" xmi:id="_m1ptMCx2EdyhfbRgxFvqZQ"
name="port" aggregation="composite">
> <eAnnotations xmi:id="_2Cji8Sx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2Cji8ix7EdyIN_9H57vYNQ" key="uuid"
value="_2Cji8Cx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> </packagedElement>
> <packagedElement xmi:type="uml:DataType"
xmi:id="_8k7dcCpPEdybW4WcTRWaZg" name="B">
> <eAnnotations xmi:id="_2Cji9Cx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2Cji9Sx7EdyIN_9H57vYNQ" key="uuid"
value="_2Cji8yx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </packagedElement>
> <packagedElement xmi:type="uml:PrimitiveType"
xmi:id="_9pxloCpPEdybW4WcTRWaZg" name="P">
> <eAnnotations xmi:id="_2Cji9yx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2Cji-Cx7EdyIN_9H57vYNQ" key="uuid"
value="_2Cji9ix7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <ownedAttribute xmi:id="_AKZvUCpQEdybW4WcTRWaZg" name="property"
aggregation="composite">
> <eAnnotations xmi:id="_2Cji-ix7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2Cji-yx7EdyIN_9H57vYNQ" key="uuid"
value="_2Cji-Sx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> </packagedElement>
> <packagedElement xmi:type="uml:DataType"
xmi:id="_PNCdICx2EdyhfbRgxFvqZQ" name="DataType">
> <eAnnotations xmi:id="_2CtT-ix7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CtT-yx7EdyIN_9H57vYNQ" key="uuid"
value="_2CtT-Sx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <ownedAttribute xmi:id="_QX2DYCx2EdyhfbRgxFvqZQ" name="property"
aggregation="composite">
> <eAnnotations xmi:id="_2CtUACx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2CtUASx7EdyIN_9H57vYNQ" key="uuid"
value="_2CtT_yx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> </packagedElement>
> <packagedElement xmi:type="uml:Component"
xmi:id="_oATicCx2EdyhfbRgxFvqZQ" name="Component">
> <eAnnotations xmi:id="_2C3E8Sx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2C3E8ix7EdyIN_9H57vYNQ" key="uuid"
value="_2C3E8Cx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> <ownedAttribute xmi:type="uml:Port" xmi:id="_oh_TMCx2EdyhfbRgxFvqZQ"
name="port" aggregation="composite">
> <eAnnotations xmi:id="_2C3E9Cx7EdyIN_9H57vYNQ"
source="http://www.topcased.org/uuid">
> <details xmi:id="_2C3E9Sx7EdyIN_9H57vYNQ" key="uuid"
value="_2C3E8yx7EdyIN_9H57vYNQ"/>
> </eAnnotations>
> </ownedAttribute>
> </packagedElement>
> </uml:Package>
>
------------------------------------------------------------ ----------------
----
|
|
|
Re: Problems with UML2::NamedElement::isDistinguishableFrom [message #623646 is a reply to message #473893] |
Wed, 11 July 2007 13:23 |
user Messages: 296 Registered: July 2009 |
Senior Member |
|
|
Hi James,
Thanks with the reading help, i see now what i missed!
Unfortunately I was hoping that the rule was wider than what its is.
Im trying to layer different kinds of naming-conventions ontop of CMOF
and UML2 (namespace, named element), but one of the really tricky one
allows same named properties with different property-type:s.
Personally I objected to that particular rule but for some reasons it
was needed.
It would have been great if the Infrastructure: E/CMOF Namedelement
isDistinguishableFrom would have been more permissive in order to allow
flexible naming conventions. And then UML2 could have restricted the
query to get better alignment with realisation technologies..
thanks
/anders
James Bruck wrote:
> Hi Anders,
>
> The query isDistinguishableFrom() is checking metatypes not types.
> In your case, the warning appears because the metatypes of "property" in
> "Class" are the same ( Propety ) and the names are also the same.
>
> The OCL as it appears in the spec is not entirely correct since it uses
> "..self.oclType", where "oclType" is not properly formed OCL (I double
> checked that with Christian Damus <aka Mr.OCL > )
> The query behaves as you would expect most programming languages to behave
> ( Java in particular ). For example, you would get a warning if you had
> two attributes with the same name even if their types were different.
>
> The query should return true in a scenario where you have a nested Class and
> a nested Interface under a namespace that have the same name. In that case,
> the metatypes would be different.
>
> Regards,
>
> - James.
>
> <user@domain.com> wrote in message news:468F7DC6.8050409@domain.com...
>> Hi,
>>
>> I seem to have a problem with my reading understanding of the query
>> NamedElement::isDistinguishableFrom()
>>
>> UML 2007-02-03, "The query isDistinguishableFrom() determines whether
>> two NamedElements may logically co-exist within a Namespace.
>> By default, two named elements are distinguishable if (a) they have
>> unrelated types or (b) they have related types but
>> different names."
>>
>>
>> A warning is issued for atttached small file.
>> "Not all the members of namespace '<Class> Class' are distinguishable
>> within it."
>>
>> note: Im using the latest Europe 3.3 release.
>>
>> thanks
>> /anders
>>
>
>
> ------------------------------------------------------------ ----------------
> ----
>
>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <uml:Package xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xmi:id="_xZ0P4SpPEdybW4WcTRWaZg">
>> <eAnnotations xmi:id="_2CQoASx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CQoAix7EdyIN_9H57vYNQ" key="uuid"
> value="_2CQoACx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <packagedElement xmi:type="uml:DataType"
> xmi:id="_3MagoCpPEdybW4WcTRWaZg" name="A">
>> <eAnnotations xmi:id="_2CQoBCx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CQoBSx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CQoAyx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <ownedAttribute xmi:id="_5XvIsCpPEdybW4WcTRWaZg" name="property"
> type="_PNCdICx2EdyhfbRgxFvqZQ" aggregation="composite">
>> <eAnnotations xmi:id="_2CQoByx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CQoCCx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CQoBix7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> </packagedElement>
>> <packagedElement xmi:type="uml:Class" xmi:id="_7f7kQCpPEdybW4WcTRWaZg"
> name="Class">
>> <eAnnotations xmi:id="_2CQoCix7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CQoCyx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CQoCSx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <ownedAttribute xmi:id="_B9caQCpQEdybW4WcTRWaZg" name="property"
> type="_3MagoCpPEdybW4WcTRWaZg" isReadOnly="true" isDerived="true"
> isDerivedUnion="true" aggregation="composite">
>> <eAnnotations xmi:id="_2CaZASx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CaZAix7EdyIN_9H57vYNQ" key="uuid"
> value="_2CaZACx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_uG_-0CpQEdybW4WcTRWaZg" value="*">
>> <eAnnotations xmi:id="_2CaZBCx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CaZBSx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CaZAyx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </upperValue>
>> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_ti8PgCpQEdybW4WcTRWaZg">
>> <eAnnotations xmi:id="_2CaZByx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CaZCCx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CaZBix7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </lowerValue>
>> </ownedAttribute>
>> <ownedAttribute xmi:id="_Dq9sACpQEdybW4WcTRWaZg" name="property"
> type="_8k7dcCpPEdybW4WcTRWaZg" aggregation="composite">
>> <eAnnotations xmi:id="_2CaZCix7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CaZCyx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CaZCSx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> <ownedAttribute xmi:type="uml:Port" xmi:id="_m1ptMCx2EdyhfbRgxFvqZQ"
> name="port" aggregation="composite">
>> <eAnnotations xmi:id="_2Cji8Sx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2Cji8ix7EdyIN_9H57vYNQ" key="uuid"
> value="_2Cji8Cx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> </packagedElement>
>> <packagedElement xmi:type="uml:DataType"
> xmi:id="_8k7dcCpPEdybW4WcTRWaZg" name="B">
>> <eAnnotations xmi:id="_2Cji9Cx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2Cji9Sx7EdyIN_9H57vYNQ" key="uuid"
> value="_2Cji8yx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </packagedElement>
>> <packagedElement xmi:type="uml:PrimitiveType"
> xmi:id="_9pxloCpPEdybW4WcTRWaZg" name="P">
>> <eAnnotations xmi:id="_2Cji9yx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2Cji-Cx7EdyIN_9H57vYNQ" key="uuid"
> value="_2Cji9ix7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <ownedAttribute xmi:id="_AKZvUCpQEdybW4WcTRWaZg" name="property"
> aggregation="composite">
>> <eAnnotations xmi:id="_2Cji-ix7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2Cji-yx7EdyIN_9H57vYNQ" key="uuid"
> value="_2Cji-Sx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> </packagedElement>
>> <packagedElement xmi:type="uml:DataType"
> xmi:id="_PNCdICx2EdyhfbRgxFvqZQ" name="DataType">
>> <eAnnotations xmi:id="_2CtT-ix7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CtT-yx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CtT-Sx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <ownedAttribute xmi:id="_QX2DYCx2EdyhfbRgxFvqZQ" name="property"
> aggregation="composite">
>> <eAnnotations xmi:id="_2CtUACx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2CtUASx7EdyIN_9H57vYNQ" key="uuid"
> value="_2CtT_yx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> </packagedElement>
>> <packagedElement xmi:type="uml:Component"
> xmi:id="_oATicCx2EdyhfbRgxFvqZQ" name="Component">
>> <eAnnotations xmi:id="_2C3E8Sx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2C3E8ix7EdyIN_9H57vYNQ" key="uuid"
> value="_2C3E8Cx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> <ownedAttribute xmi:type="uml:Port" xmi:id="_oh_TMCx2EdyhfbRgxFvqZQ"
> name="port" aggregation="composite">
>> <eAnnotations xmi:id="_2C3E9Cx7EdyIN_9H57vYNQ"
> source="http://www.topcased.org/uuid">
>> <details xmi:id="_2C3E9Sx7EdyIN_9H57vYNQ" key="uuid"
> value="_2C3E8yx7EdyIN_9H57vYNQ"/>
>> </eAnnotations>
>> </ownedAttribute>
>> </packagedElement>
>> </uml:Package>
>>
>
>
> ------------------------------------------------------------ ----------------
> ----
>
>
>
>
>
|
|
|
Re: Problems with UML2::NamedElement::isDistinguishableFrom [message #623648 is a reply to message #473947] |
Wed, 11 July 2007 13:48 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Anders,
You might want to bring that up with OMG and attempt getting the spec
changed.
You can try sending an email to issues@omg.org or uml2-rtf@omg.org.
Unless you have very strong arguments against how the spec defines this
currently you might have a bit of a battle getting the spec changed :)
The opensource API really tries to follow the spec to the letter; warts and
all.
- James.
<user@domain.com> wrote in message news:f72lki$80c$1@build.eclipse.org...
> Hi James,
>
> Thanks with the reading help, i see now what i missed!
>
> Unfortunately I was hoping that the rule was wider than what its is.
>
> Im trying to layer different kinds of naming-conventions ontop of CMOF
> and UML2 (namespace, named element), but one of the really tricky one
> allows same named properties with different property-type:s.
>
> Personally I objected to that particular rule but for some reasons it
> was needed.
>
> It would have been great if the Infrastructure: E/CMOF Namedelement
> isDistinguishableFrom would have been more permissive in order to allow
> flexible naming conventions. And then UML2 could have restricted the
> query to get better alignment with realisation technologies..
>
> thanks
> /anders
>
>
> James Bruck wrote:
> > Hi Anders,
> >
> > The query isDistinguishableFrom() is checking metatypes not types.
> > In your case, the warning appears because the metatypes of "property" in
> > "Class" are the same ( Propety ) and the names are also the same.
> >
> > The OCL as it appears in the spec is not entirely correct since it uses
> > "..self.oclType", where "oclType" is not properly formed OCL (I double
> > checked that with Christian Damus <aka Mr.OCL > )
> > The query behaves as you would expect most programming languages to
behave
> > ( Java in particular ). For example, you would get a warning if you
had
> > two attributes with the same name even if their types were different.
> >
> > The query should return true in a scenario where you have a nested Class
and
> > a nested Interface under a namespace that have the same name. In that
case,
> > the metatypes would be different.
> >
> > Regards,
> >
> > - James.
> >
> > <user@domain.com> wrote in message news:468F7DC6.8050409@domain.com...
> >> Hi,
> >>
> >> I seem to have a problem with my reading understanding of the query
> >> NamedElement::isDistinguishableFrom()
> >>
> >> UML 2007-02-03, "The query isDistinguishableFrom() determines whether
> >> two NamedElements may logically co-exist within a Namespace.
> >> By default, two named elements are distinguishable if (a) they have
> >> unrelated types or (b) they have related types but
> >> different names."
> >>
> >>
> >> A warning is issued for atttached small file.
> >> "Not all the members of namespace '<Class> Class' are distinguishable
> >> within it."
> >>
> >> note: Im using the latest Europe 3.3 release.
> >>
> >> thanks
> >> /anders
> >>
> >
> >
>
> ------------------------------------------------------------ --------------
--
> > ----
> >
> >
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <uml:Package xmi:version="2.1"
> > xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> > xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> > xmi:id="_xZ0P4SpPEdybW4WcTRWaZg">
> >> <eAnnotations xmi:id="_2CQoASx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CQoAix7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CQoACx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <packagedElement xmi:type="uml:DataType"
> > xmi:id="_3MagoCpPEdybW4WcTRWaZg" name="A">
> >> <eAnnotations xmi:id="_2CQoBCx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CQoBSx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CQoAyx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <ownedAttribute xmi:id="_5XvIsCpPEdybW4WcTRWaZg" name="property"
> > type="_PNCdICx2EdyhfbRgxFvqZQ" aggregation="composite">
> >> <eAnnotations xmi:id="_2CQoByx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CQoCCx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CQoBix7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> </packagedElement>
> >> <packagedElement xmi:type="uml:Class"
xmi:id="_7f7kQCpPEdybW4WcTRWaZg"
> > name="Class">
> >> <eAnnotations xmi:id="_2CQoCix7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CQoCyx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CQoCSx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <ownedAttribute xmi:id="_B9caQCpQEdybW4WcTRWaZg" name="property"
> > type="_3MagoCpPEdybW4WcTRWaZg" isReadOnly="true" isDerived="true"
> > isDerivedUnion="true" aggregation="composite">
> >> <eAnnotations xmi:id="_2CaZASx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CaZAix7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CaZACx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> > xmi:id="_uG_-0CpQEdybW4WcTRWaZg" value="*">
> >> <eAnnotations xmi:id="_2CaZBCx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CaZBSx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CaZAyx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </upperValue>
> >> <lowerValue xmi:type="uml:LiteralInteger"
> > xmi:id="_ti8PgCpQEdybW4WcTRWaZg">
> >> <eAnnotations xmi:id="_2CaZByx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CaZCCx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CaZBix7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </lowerValue>
> >> </ownedAttribute>
> >> <ownedAttribute xmi:id="_Dq9sACpQEdybW4WcTRWaZg" name="property"
> > type="_8k7dcCpPEdybW4WcTRWaZg" aggregation="composite">
> >> <eAnnotations xmi:id="_2CaZCix7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CaZCyx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CaZCSx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> <ownedAttribute xmi:type="uml:Port"
xmi:id="_m1ptMCx2EdyhfbRgxFvqZQ"
> > name="port" aggregation="composite">
> >> <eAnnotations xmi:id="_2Cji8Sx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2Cji8ix7EdyIN_9H57vYNQ" key="uuid"
> > value="_2Cji8Cx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> </packagedElement>
> >> <packagedElement xmi:type="uml:DataType"
> > xmi:id="_8k7dcCpPEdybW4WcTRWaZg" name="B">
> >> <eAnnotations xmi:id="_2Cji9Cx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2Cji9Sx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2Cji8yx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </packagedElement>
> >> <packagedElement xmi:type="uml:PrimitiveType"
> > xmi:id="_9pxloCpPEdybW4WcTRWaZg" name="P">
> >> <eAnnotations xmi:id="_2Cji9yx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2Cji-Cx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2Cji9ix7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <ownedAttribute xmi:id="_AKZvUCpQEdybW4WcTRWaZg" name="property"
> > aggregation="composite">
> >> <eAnnotations xmi:id="_2Cji-ix7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2Cji-yx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2Cji-Sx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> </packagedElement>
> >> <packagedElement xmi:type="uml:DataType"
> > xmi:id="_PNCdICx2EdyhfbRgxFvqZQ" name="DataType">
> >> <eAnnotations xmi:id="_2CtT-ix7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CtT-yx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CtT-Sx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <ownedAttribute xmi:id="_QX2DYCx2EdyhfbRgxFvqZQ" name="property"
> > aggregation="composite">
> >> <eAnnotations xmi:id="_2CtUACx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2CtUASx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2CtT_yx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> </packagedElement>
> >> <packagedElement xmi:type="uml:Component"
> > xmi:id="_oATicCx2EdyhfbRgxFvqZQ" name="Component">
> >> <eAnnotations xmi:id="_2C3E8Sx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2C3E8ix7EdyIN_9H57vYNQ" key="uuid"
> > value="_2C3E8Cx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> <ownedAttribute xmi:type="uml:Port"
xmi:id="_oh_TMCx2EdyhfbRgxFvqZQ"
> > name="port" aggregation="composite">
> >> <eAnnotations xmi:id="_2C3E9Cx7EdyIN_9H57vYNQ"
> > source="http://www.topcased.org/uuid">
> >> <details xmi:id="_2C3E9Sx7EdyIN_9H57vYNQ" key="uuid"
> > value="_2C3E8yx7EdyIN_9H57vYNQ"/>
> >> </eAnnotations>
> >> </ownedAttribute>
> >> </packagedElement>
> >> </uml:Package>
> >>
> >
> >
>
> ------------------------------------------------------------ --------------
--
> > ----
> >
> >
> >
> >
> >
|
|
|
Goto Forum:
Current Time: Thu Apr 25 04:43:22 GMT 2024
Powered by FUDForum. Page generated in 0.04929 seconds
|