Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Required Interface
Required Interface [message #475917] Tue, 18 September 2007 14:16 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #476191 is a reply to message #476187] Mon, 24 September 2007 15:37 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Constraint [2] in section 9.3.11 indicates that "Port.aggregation must be
composite" which seems to make sense since if the encapsulated classifier
owning the port is deleted, so should the port. The port is an interaction
point between the owing classifier instance and its environment so the port
could not exist on its own.

- James.


"nick kirtley" <nickkirtley@gmail.com> wrote in message
news:3710996e0564478522b8e197600f30f5$1@www.eclipse.org...
> 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 #476192 is a reply to message #476026] Mon, 24 September 2007 15:39 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
You can use either a component or a class.

- James.

"nick kirtley" <nickkirtley@gmail.com> wrote in message
news:3a2b985d04daa13890b8e96e9da2104b$1@www.eclipse.org...
> 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 #476200 is a reply to message #476192] Mon, 24 September 2007 21:20 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #476224 is a reply to message #476209] Wed, 26 September 2007 21:27 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
By typing the port you are specifying the kind of port that you are working
with.
It is a convenient way of using a similar port somewhere else ... you would
just set its type and presto, the port would know about the kinds of
required or provided interfaces that are supported. If the port did not
derive its required and provided interfaces from the type it might get
tedious to specify all requireds and provides all the time for different
ports. I believe that people at the OMG defining the spec wanted to reuse
Property concepts when talking about Ports which is why the spec has ports
as typeable items ( ports are properties ).

I would think that typing a port with a Component is open to interpretation
somewhat. According to the spec, Components "represent a modular part of a
system that encapsulates its contents .." ... so generating code from a port
typed by a component would be open to interpretation. For practical
purposes, I would tend to stick to typing ports by Class as opposed to
Component.

.... not sure if that helps :) ...

- James.



"nick kirtley" <nickkirtley@gmail.com> wrote in message
news:a6c9928f55e6007e8be041ade7c86cb0$1@www.eclipse.org...
> 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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
james bruck is currently offline james bruckFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 #624946 is a reply to message #476187] Mon, 24 September 2007 15:37 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Constraint [2] in section 9.3.11 indicates that "Port.aggregation must be
composite" which seems to make sense since if the encapsulated classifier
owning the port is deleted, so should the port. The port is an interaction
point between the owing classifier instance and its environment so the port
could not exist on its own.

- James.


"nick kirtley" <nickkirtley@gmail.com> wrote in message
news:3710996e0564478522b8e197600f30f5$1@www.eclipse.org...
> 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 #624947 is a reply to message #476026] Mon, 24 September 2007 15:39 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
You can use either a component or a class.

- James.

"nick kirtley" <nickkirtley@gmail.com> wrote in message
news:3a2b985d04daa13890b8e96e9da2104b$1@www.eclipse.org...
> 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 #624950 is a reply to message #476192] Mon, 24 September 2007 21:20 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 #625012 is a reply to message #476209] Wed, 26 September 2007 21:27 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
By typing the port you are specifying the kind of port that you are working
with.
It is a convenient way of using a similar port somewhere else ... you would
just set its type and presto, the port would know about the kinds of
required or provided interfaces that are supported. If the port did not
derive its required and provided interfaces from the type it might get
tedious to specify all requireds and provides all the time for different
ports. I believe that people at the OMG defining the spec wanted to reuse
Property concepts when talking about Ports which is why the spec has ports
as typeable items ( ports are properties ).

I would think that typing a port with a Component is open to interpretation
somewhat. According to the spec, Components "represent a modular part of a
system that encapsulates its contents .." ... so generating code from a port
typed by a component would be open to interpretation. For practical
purposes, I would tend to stick to typing ports by Class as opposed to
Component.

.... not sure if that helps :) ...

- James.



"nick kirtley" <nickkirtley@gmail.com> wrote in message
news:a6c9928f55e6007e8be041ade7c86cb0$1@www.eclipse.org...
> 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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Re: Stereotype creation
Next Topic:dynamic EMF profiles
Goto Forum:
  


Current Time: Thu Apr 25 20:02:36 GMT 2024

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

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

Back to the top