Home » Modeling » UML2 » Required Interface
Required Interface [message #475917] |
Tue, 18 September 2007 14:16 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
Hi,
I'm having some problems (see some of my other recent posts / Connector
validation problem and ocl query, getRequireds()).
I think that both problems have one thing in common : required Interface.
I can define a provided interface from port in 2 ways: from uml2tools
component diagram and in uml2 tree editor select port and type it to an
interface.
Problem I'm having is specifying a required interface. How can I do this?
thx
nick
your help has been/is very much appreciated!!!
|
|
|
Re: Required Interface [message #475918 is a reply to message #475917] |
Tue, 18 September 2007 15:04 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Nick,
To quote from my reply of 13 September to your posting "ocl query":
AFAIK, this requires that the port's type have some kind of
usage or like dependency on the interface.
So, try creating a class and in that class a dependency on the interface
that you require. Then assign that class as your port's type.
HTH,
Christian
Nick Kirtley wrote:
> Hi,
> I'm having some problems (see some of my other recent posts / Connector
> validation problem and ocl query, getRequireds()).
>
> I think that both problems have one thing in common : required Interface.
>
> I can define a provided interface from port in 2 ways: from uml2tools
> component diagram and in uml2 tree editor select port and type it to an
> interface.
>
> Problem I'm having is specifying a required interface. How can I do this?
>
> thx
> nick
>
> your help has been/is very much appreciated!!!
|
|
|
Re: Required Interface [message #476014 is a reply to message #475918] |
Thu, 20 September 2007 13:02 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
Hi,
I still haven't got it working, and by that I mean that I still have an
error regarding the connector validation saying that a connector should
connect a role end requiring and a role end providing that interface.
Secondly I still can't retrieve the required Interface using
self.getRequireds(). So it would seem that required interface is not
defined properly. I'm not sure if I have defined the dependency properly.
three questions:
a) If I already have a component,port and a provided interface, then the
provided interface is defined using type of the port. So if I change the
type of the port to define a required interface, then don't I lose the
provided interface reference?
b) could you provide a detailed explanation of how to define a component,
a port, a required and a provided interface.
c) How do I define a dependency within a class (not sure if I've done it
properly) .
Another remark: this seems like a bit of a work around, to define a
provided port i just select port type, choose interface. But for required
I have to define another class and add a dependency etc.
|
|
|
Re: Required Interface [message #476017 is a reply to message #476014] |
Thu, 20 September 2007 15:08 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Nick,
See some replies in-line, below.
Christian
Nick Kirtley wrote:
> Hi,
>
> I still haven't got it working, and by that I mean that I still have an
> error regarding the connector validation saying that a connector should
> connect a role end requiring and a role end providing that interface.
> Secondly I still can't retrieve the required Interface using
> self.getRequireds(). So it would seem that required interface is not
> defined properly. I'm not sure if I have defined the dependency properly.
>
>
> three questions:
> a) If I already have a component,port and a provided interface, then the
> provided interface is defined using type of the port. So if I change the
> type of the port to define a required interface, then don't I lose the
> provided interface reference?
Specifying the interface as the type of the port is but one way to provide
an interface. Another way is to assign the port a class of some kind that
realizes the interface in question. Such a class can also depend on a
different interface. In that case, your port would both provide and
require interfaces (usually different ones, but not necessarily).
> b) could you provide a detailed explanation of how to define a component,
> a port, a required and a provided interface.
- create component C
- create owned port p in C
- create class X
- create interface I
- create interface J
- create realization relationship to I in X
- create dependency relationship to J in X
- set type of p to be X
> c) How do I define a dependency within a class (not sure if I've done it
> properly) .
If your diagramming application doesn't have tools for creating interface
realizations and/or dependencies, then try using the example tree editor
from UML2: org.eclipse.uml2.uml.editor plug-in.
> Another remark: this seems like a bit of a work around, to define a
> provided port i just select port type, choose interface. But for required
> I have to define another class and add a dependency etc.
Perhaps you're thinking of this backwards. The interfaces that a port
requires or provides are derived from the relationships between the port's
type and those interfaces. When modeling a component, the type of a port
is often a class in which you can model the behaviour using interactions,
state machines, etc. The interfaces that the port's type realizes or uses
determine provideds/requireds for wiring the port and/or its component to
other components, not the other way around.
|
|
|
Re: Required Interface [message #476018 is a reply to message #476017] |
Thu, 20 September 2007 15:19 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
.... one small clarification.. the kind of dependency needed to obtain
required interfaces is "Usage" ....
"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:fcu2ec$m6v$1@build.eclipse.org...
> Hi, Nick,
>
> See some replies in-line, below.
>
> Christian
>
> Nick Kirtley wrote:
>
> > Hi,
> >
> > I still haven't got it working, and by that I mean that I still have an
> > error regarding the connector validation saying that a connector should
> > connect a role end requiring and a role end providing that interface.
> > Secondly I still can't retrieve the required Interface using
> > self.getRequireds(). So it would seem that required interface is not
> > defined properly. I'm not sure if I have defined the dependency
properly.
> >
> >
> > three questions:
> > a) If I already have a component,port and a provided interface, then the
> > provided interface is defined using type of the port. So if I change the
> > type of the port to define a required interface, then don't I lose the
> > provided interface reference?
>
> Specifying the interface as the type of the port is but one way to provide
> an interface. Another way is to assign the port a class of some kind that
> realizes the interface in question. Such a class can also depend on a
> different interface. In that case, your port would both provide and
> require interfaces (usually different ones, but not necessarily).
>
>
> > b) could you provide a detailed explanation of how to define a
component,
> > a port, a required and a provided interface.
>
> - create component C
> - create owned port p in C
> - create class X
> - create interface I
> - create interface J
> - create realization relationship to I in X
> - create dependency relationship to J in X
> - set type of p to be X
>
>
> > c) How do I define a dependency within a class (not sure if I've done it
> > properly) .
>
> If your diagramming application doesn't have tools for creating interface
> realizations and/or dependencies, then try using the example tree editor
> from UML2: org.eclipse.uml2.uml.editor plug-in.
>
>
> > Another remark: this seems like a bit of a work around, to define a
> > provided port i just select port type, choose interface. But for
required
> > I have to define another class and add a dependency etc.
>
> Perhaps you're thinking of this backwards. The interfaces that a port
> requires or provides are derived from the relationships between the port's
> type and those interfaces. When modeling a component, the type of a port
> is often a class in which you can model the behaviour using interactions,
> state machines, etc. The interfaces that the port's type realizes or uses
> determine provideds/requireds for wiring the port and/or its component to
> other components, not the other way around.
|
|
|
Re: Required Interface [message #476025 is a reply to message #476018] |
Mon, 24 September 2007 10:42 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
Hi,
I don't see dependency, or usage when I right click class x->new child.
I added Interface realization and it works because I can retrieve the
provided interface using ocl.
What am I doing wrong?
-nick
|
|
|
Re: Required Interface [message #476026 is a reply to message #476025] |
Mon, 24 September 2007 11:12 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
Hi,
I've got required working, I think, I craeted a component x instead of a
class x and then I see usage in the list from new child -> packaged
element.
i then type the port with x, same as in your explanation.
Is there any reason why I shouldn't use component instead of class like
you suggested?
regards,
Nick
|
|
|
Re: Required Interface [message #476187 is a reply to message #476026] |
Mon, 24 September 2007 11:43 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
One other thing.
When I validate the model it says that i have to set the port to an
composite aggregation kind. Is that because now I have a composite between
port and x?
-nick
|
|
| | |
Re: Required Interface [message #476200 is a reply to message #476192] |
Mon, 24 September 2007 21:20 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
hi,
Yeah but i don't see usage option for class, and i'd rather use a class,
but i suppose it doesn't really matter.
But I find it slightly 'overkill' to use a component for a port type.
regards,
Nick
|
|
|
Re: Required Interface [message #476209 is a reply to message #476200] |
Tue, 25 September 2007 09:25 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
hi,
Could you also explain what's going on when I type a port with a component.
The effect is that when component requires/provides interfaces then the
port does too, but what does typing actually mean?
regards,
nick
|
|
| |
Re: Required Interface [message #476225 is a reply to message #476224] |
Thu, 27 September 2007 10:41 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
hi,
I would prefer to use class as well, considering all it will do is
realize/use an interface. Using a class seems smaller/tidier.
However , I can't find the usage option for class, I've looked at all the
options when right clicking ->new child for a class. It works for
component but not for class.
You know what the problem is?
nick
|
|
|
Re: Required Interface [message #476227 is a reply to message #476225] |
Thu, 27 September 2007 13:51 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Nick,
Dependencies (including Usages) are owned by Packages, not by Classifiers.
The reason is that a dependency can have multiple clients, so none of them
can reasonably own it.
Try the new child menu of the containing package.
HTH,
Christian
nick kirtley wrote:
> hi,
>
> I would prefer to use class as well, considering all it will do is
> realize/use an interface. Using a class seems smaller/tidier.
>
> However , I can't find the usage option for class, I've looked at all the
> options when right clicking ->new child for a class. It works for
> component but not for class.
>
> You know what the problem is?
>
> nick
|
|
|
Re: Required Interface [message #476228 is a reply to message #476227] |
Thu, 27 September 2007 14:03 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
yes I can see usage within package and component.
I can't type a port with a package though.
You said in one of the earlier posts to create usage within class x and
then to type port with x. Not to type port with package.
nick
|
|
|
Re: Required Interface [message #476230 is a reply to message #476228] |
Thu, 27 September 2007 16:48 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Nick,
Sorry, I guess I used some loose terminology. I should have said "create a
clientDependency of type Usage on Class X supplied by Interface Y."
Packages are not Types; you don't want to use a package as the type of your
port. The Usage that has X as a client and Y as a supplier indicates that
X uses Y, i.e., that X "requires" Y in the component terminology.
So, create in your package a Usage whose client is the Class that types your
Port and whose supplier is the Interface that you want your Port to
require. That's it. I don't think I'll be able to spell it out more
clearly.
This is all, incidentally, described fairly clearly in the UML
specification. The description of Usage even uses the word "require":
A usage is a relationship in which one element requires
another element (or set of elements) for its full
implementation or operation. In the metamodel, a Usage is
a Dependency in which the client requires the presence of
the supplier.
Cheers,
Christian
nick kirtley wrote:
> yes I can see usage within package and component.
> I can't type a port with a package though.
>
> You said in one of the earlier posts to create usage within class x and
> then to type port with x. Not to type port with package.
>
> nick
|
|
|
Re: Required Interface [message #624811 is a reply to message #475917] |
Tue, 18 September 2007 15:04 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Nick,
To quote from my reply of 13 September to your posting "ocl query":
AFAIK, this requires that the port's type have some kind of
usage or like dependency on the interface.
So, try creating a class and in that class a dependency on the interface
that you require. Then assign that class as your port's type.
HTH,
Christian
Nick Kirtley wrote:
> Hi,
> I'm having some problems (see some of my other recent posts / Connector
> validation problem and ocl query, getRequireds()).
>
> I think that both problems have one thing in common : required Interface.
>
> I can define a provided interface from port in 2 ways: from uml2tools
> component diagram and in uml2 tree editor select port and type it to an
> interface.
>
> Problem I'm having is specifying a required interface. How can I do this?
>
> thx
> nick
>
> your help has been/is very much appreciated!!!
|
|
|
Re: Required Interface [message #624917 is a reply to message #475918] |
Thu, 20 September 2007 13:02 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
Hi,
I still haven't got it working, and by that I mean that I still have an
error regarding the connector validation saying that a connector should
connect a role end requiring and a role end providing that interface.
Secondly I still can't retrieve the required Interface using
self.getRequireds(). So it would seem that required interface is not
defined properly. I'm not sure if I have defined the dependency properly.
three questions:
a) If I already have a component,port and a provided interface, then the
provided interface is defined using type of the port. So if I change the
type of the port to define a required interface, then don't I lose the
provided interface reference?
b) could you provide a detailed explanation of how to define a component,
a port, a required and a provided interface.
c) How do I define a dependency within a class (not sure if I've done it
properly) .
Another remark: this seems like a bit of a work around, to define a
provided port i just select port type, choose interface. But for required
I have to define another class and add a dependency etc.
|
|
|
Re: Required Interface [message #624926 is a reply to message #476014] |
Thu, 20 September 2007 15:08 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Nick,
See some replies in-line, below.
Christian
Nick Kirtley wrote:
> Hi,
>
> I still haven't got it working, and by that I mean that I still have an
> error regarding the connector validation saying that a connector should
> connect a role end requiring and a role end providing that interface.
> Secondly I still can't retrieve the required Interface using
> self.getRequireds(). So it would seem that required interface is not
> defined properly. I'm not sure if I have defined the dependency properly.
>
>
> three questions:
> a) If I already have a component,port and a provided interface, then the
> provided interface is defined using type of the port. So if I change the
> type of the port to define a required interface, then don't I lose the
> provided interface reference?
Specifying the interface as the type of the port is but one way to provide
an interface. Another way is to assign the port a class of some kind that
realizes the interface in question. Such a class can also depend on a
different interface. In that case, your port would both provide and
require interfaces (usually different ones, but not necessarily).
> b) could you provide a detailed explanation of how to define a component,
> a port, a required and a provided interface.
- create component C
- create owned port p in C
- create class X
- create interface I
- create interface J
- create realization relationship to I in X
- create dependency relationship to J in X
- set type of p to be X
> c) How do I define a dependency within a class (not sure if I've done it
> properly) .
If your diagramming application doesn't have tools for creating interface
realizations and/or dependencies, then try using the example tree editor
from UML2: org.eclipse.uml2.uml.editor plug-in.
> Another remark: this seems like a bit of a work around, to define a
> provided port i just select port type, choose interface. But for required
> I have to define another class and add a dependency etc.
Perhaps you're thinking of this backwards. The interfaces that a port
requires or provides are derived from the relationships between the port's
type and those interfaces. When modeling a component, the type of a port
is often a class in which you can model the behaviour using interactions,
state machines, etc. The interfaces that the port's type realizes or uses
determine provideds/requireds for wiring the port and/or its component to
other components, not the other way around.
|
|
|
Re: Required Interface [message #624928 is a reply to message #476017] |
Thu, 20 September 2007 15:19 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
.... one small clarification.. the kind of dependency needed to obtain
required interfaces is "Usage" ....
"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:fcu2ec$m6v$1@build.eclipse.org...
> Hi, Nick,
>
> See some replies in-line, below.
>
> Christian
>
> Nick Kirtley wrote:
>
> > Hi,
> >
> > I still haven't got it working, and by that I mean that I still have an
> > error regarding the connector validation saying that a connector should
> > connect a role end requiring and a role end providing that interface.
> > Secondly I still can't retrieve the required Interface using
> > self.getRequireds(). So it would seem that required interface is not
> > defined properly. I'm not sure if I have defined the dependency
properly.
> >
> >
> > three questions:
> > a) If I already have a component,port and a provided interface, then the
> > provided interface is defined using type of the port. So if I change the
> > type of the port to define a required interface, then don't I lose the
> > provided interface reference?
>
> Specifying the interface as the type of the port is but one way to provide
> an interface. Another way is to assign the port a class of some kind that
> realizes the interface in question. Such a class can also depend on a
> different interface. In that case, your port would both provide and
> require interfaces (usually different ones, but not necessarily).
>
>
> > b) could you provide a detailed explanation of how to define a
component,
> > a port, a required and a provided interface.
>
> - create component C
> - create owned port p in C
> - create class X
> - create interface I
> - create interface J
> - create realization relationship to I in X
> - create dependency relationship to J in X
> - set type of p to be X
>
>
> > c) How do I define a dependency within a class (not sure if I've done it
> > properly) .
>
> If your diagramming application doesn't have tools for creating interface
> realizations and/or dependencies, then try using the example tree editor
> from UML2: org.eclipse.uml2.uml.editor plug-in.
>
>
> > Another remark: this seems like a bit of a work around, to define a
> > provided port i just select port type, choose interface. But for
required
> > I have to define another class and add a dependency etc.
>
> Perhaps you're thinking of this backwards. The interfaces that a port
> requires or provides are derived from the relationships between the port's
> type and those interfaces. When modeling a component, the type of a port
> is often a class in which you can model the behaviour using interactions,
> state machines, etc. The interfaces that the port's type realizes or uses
> determine provideds/requireds for wiring the port and/or its component to
> other components, not the other way around.
|
|
|
Re: Required Interface [message #624943 is a reply to message #476018] |
Mon, 24 September 2007 10:42 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
Hi,
I don't see dependency, or usage when I right click class x->new child.
I added Interface realization and it works because I can retrieve the
provided interface using ocl.
What am I doing wrong?
-nick
|
|
|
Re: Required Interface [message #624944 is a reply to message #476025] |
Mon, 24 September 2007 11:12 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
Hi,
I've got required working, I think, I craeted a component x instead of a
class x and then I see usage in the list from new child -> packaged
element.
i then type the port with x, same as in your explanation.
Is there any reason why I shouldn't use component instead of class like
you suggested?
regards,
Nick
|
|
|
Re: Required Interface [message #624945 is a reply to message #476026] |
Mon, 24 September 2007 11:43 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
One other thing.
When I validate the model it says that i have to set the port to an
composite aggregation kind. Is that because now I have a composite between
port and x?
-nick
|
|
| | |
Re: Required Interface [message #624950 is a reply to message #476192] |
Mon, 24 September 2007 21:20 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
hi,
Yeah but i don't see usage option for class, and i'd rather use a class,
but i suppose it doesn't really matter.
But I find it slightly 'overkill' to use a component for a port type.
regards,
Nick
|
|
|
Re: Required Interface [message #624997 is a reply to message #476200] |
Tue, 25 September 2007 09:25 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
hi,
Could you also explain what's going on when I type a port with a component.
The effect is that when component requires/provides interfaces then the
port does too, but what does typing actually mean?
regards,
nick
|
|
| |
Re: Required Interface [message #625013 is a reply to message #476224] |
Thu, 27 September 2007 10:41 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
hi,
I would prefer to use class as well, considering all it will do is
realize/use an interface. Using a class seems smaller/tidier.
However , I can't find the usage option for class, I've looked at all the
options when right clicking ->new child for a class. It works for
component but not for class.
You know what the problem is?
nick
|
|
|
Re: Required Interface [message #625024 is a reply to message #476225] |
Thu, 27 September 2007 13:51 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Nick,
Dependencies (including Usages) are owned by Packages, not by Classifiers.
The reason is that a dependency can have multiple clients, so none of them
can reasonably own it.
Try the new child menu of the containing package.
HTH,
Christian
nick kirtley wrote:
> hi,
>
> I would prefer to use class as well, considering all it will do is
> realize/use an interface. Using a class seems smaller/tidier.
>
> However , I can't find the usage option for class, I've looked at all the
> options when right clicking ->new child for a class. It works for
> component but not for class.
>
> You know what the problem is?
>
> nick
|
|
|
Re: Required Interface [message #625026 is a reply to message #476227] |
Thu, 27 September 2007 14:03 |
Eclipse User |
|
|
|
Originally posted by: nickkirtley.gmail.com
yes I can see usage within package and component.
I can't type a port with a package though.
You said in one of the earlier posts to create usage within class x and
then to type port with x. Not to type port with package.
nick
|
|
|
Re: Required Interface [message #625030 is a reply to message #476228] |
Thu, 27 September 2007 16:48 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Nick,
Sorry, I guess I used some loose terminology. I should have said "create a
clientDependency of type Usage on Class X supplied by Interface Y."
Packages are not Types; you don't want to use a package as the type of your
port. The Usage that has X as a client and Y as a supplier indicates that
X uses Y, i.e., that X "requires" Y in the component terminology.
So, create in your package a Usage whose client is the Class that types your
Port and whose supplier is the Interface that you want your Port to
require. That's it. I don't think I'll be able to spell it out more
clearly.
This is all, incidentally, described fairly clearly in the UML
specification. The description of Usage even uses the word "require":
A usage is a relationship in which one element requires
another element (or set of elements) for its full
implementation or operation. In the metamodel, a Usage is
a Dependency in which the client requires the presence of
the supplier.
Cheers,
Christian
nick kirtley wrote:
> yes I can see usage within package and component.
> I can't type a port with a package though.
>
> You said in one of the earlier posts to create usage within class x and
> then to type port with x. Not to type port with package.
>
> nick
|
|
|
Goto Forum:
Current Time: Thu Apr 25 19:36:23 GMT 2024
Powered by FUDForum. Page generated in 0.05931 seconds
|