Operation and Interfaces [message #477209] |
Tue, 08 April 2008 09:12  |
Eclipse User |
|
|
|
Originally posted by: mail.nicetoeatyou.de
Hello,
i'm curios about a special detail within the operation.
First a simple use case:
class A implements I
{
public void test(){...}
}
interface I
{
public void test();
}
If i understand the UML2 model correctly, the operation test of class A should have a interface set, pointing to I.
But what if i have two different interfaces:
class A implements I1,I2
{
public void test(){...}
}
interface I1
{
public void test();
...
}
interface I2
{
public void test();
...
}
How should this be represented with the UML2 model?
With regards
Dennis Keßler
|
|
|
Re: Operation and Interfaces [message #477231 is a reply to message #477209] |
Wed, 09 April 2008 16:01  |
Eclipse User |
|
|
|
Dennis,
Note that, as part of "realizing" an interface in UML, the realizing
classifier (class in this case) must define operations that conform to those
of its realized interface(s). So I would expect this to be represented
something like this:
<packagedElement xmi:type="uml:Interface"
xmi:id="_4pbdUAZuEd2Gt5apY3MUbw" name="I1">
<ownedOperation xmi:id="_8IDgUAZuEd2Gt5apY3MUbw" name="test"/>
</packagedElement>
<packagedElement xmi:type="uml:Interface"
xmi:id="_93Nw0AZuEd2Gt5apY3MUbw" name="I2">
<ownedOperation xmi:id="__bNTIAZuEd2Gt5apY3MUbw" name="test"/>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_BGM1UAZvEd2Gt5apY3MUbw"
name="A" clientDependency="_cFZmsAZvEd2Gt5apY3MUbw _eTtRUAZvEd2Gt5apY3MUbw">
<interfaceRealization xmi:id="_cFZmsAZvEd2Gt5apY3MUbw"
supplier="_4pbdUAZuEd2Gt5apY3MUbw" client="_BGM1UAZvEd2Gt5apY3MUbw"
contract="_4pbdUAZuEd2Gt5apY3MUbw"/>
<interfaceRealization xmi:id="_eTtRUAZvEd2Gt5apY3MUbw"
supplier="_93Nw0AZuEd2Gt5apY3MUbw" client="_BGM1UAZvEd2Gt5apY3MUbw"
contract="_93Nw0AZuEd2Gt5apY3MUbw"/>
<ownedOperation xmi:id="_QAK6QAZvEd2Gt5apY3MUbw" name="test"/>
</packagedElement>
That is, the class A would own an operation that conforms to the test
operation from both I1 and I2.
Kenn
"Dennis Ke
|
|
|
Re: Operation and Interfaces [message #626389 is a reply to message #477209] |
Wed, 09 April 2008 16:01  |
Eclipse User |
|
|
|
Dennis,
Note that, as part of "realizing" an interface in UML, the realizing
classifier (class in this case) must define operations that conform to those
of its realized interface(s). So I would expect this to be represented
something like this:
<packagedElement xmi:type="uml:Interface"
xmi:id="_4pbdUAZuEd2Gt5apY3MUbw" name="I1">
<ownedOperation xmi:id="_8IDgUAZuEd2Gt5apY3MUbw" name="test"/>
</packagedElement>
<packagedElement xmi:type="uml:Interface"
xmi:id="_93Nw0AZuEd2Gt5apY3MUbw" name="I2">
<ownedOperation xmi:id="__bNTIAZuEd2Gt5apY3MUbw" name="test"/>
</packagedElement>
<packagedElement xmi:type="uml:Class" xmi:id="_BGM1UAZvEd2Gt5apY3MUbw"
name="A" clientDependency="_cFZmsAZvEd2Gt5apY3MUbw _eTtRUAZvEd2Gt5apY3MUbw">
<interfaceRealization xmi:id="_cFZmsAZvEd2Gt5apY3MUbw"
supplier="_4pbdUAZuEd2Gt5apY3MUbw" client="_BGM1UAZvEd2Gt5apY3MUbw"
contract="_4pbdUAZuEd2Gt5apY3MUbw"/>
<interfaceRealization xmi:id="_eTtRUAZvEd2Gt5apY3MUbw"
supplier="_93Nw0AZuEd2Gt5apY3MUbw" client="_BGM1UAZvEd2Gt5apY3MUbw"
contract="_93Nw0AZuEd2Gt5apY3MUbw"/>
<ownedOperation xmi:id="_QAK6QAZvEd2Gt5apY3MUbw" name="test"/>
</packagedElement>
That is, the class A would own an operation that conforms to the test
operation from both I1 and I2.
Kenn
"Dennis Ke
|
|
|
Powered by
FUDForum. Page generated in 0.02741 seconds