Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Operation and Interfaces
Operation and Interfaces [message #477209] Tue, 08 April 2008 13:12 Go to next message
Eclipse UserFriend
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 20:01 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
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 20:01 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
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
Previous Topic:Resource from non UML2 uml model
Next Topic:[Announceme] New articles added to the UML2 Wiki
Goto Forum:
  


Current Time: Thu Apr 25 13:19:04 GMT 2024

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

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

Back to the top