• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UML 2.0 component question

 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

If a UML 2.0 component has a port, does that imply that the component has sub components? If this is not true, then what is the reason for the port.

Thanks in advance.

-Saha
 
Ricardo Ferreira
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Saha Kumar:
Hello All,

If a UML 2.0 component has a port, does that imply that the component has sub components? If this is not true, then what is the reason for the port.

Thanks in advance.

-Saha


Hey Saha,

The 'Port' feature available in UML 2.0 represents a point of interaction between an component and it�s environment. This means that the port acts as the classifier that makes possible the comunication.

Ports can be unidirectionals and bi-directionals. So, if you define an port in an component, this means that your component can expose something more that the services described in the interface, or, it should receive a piece of data or protocol by another component or subsystem.
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Saha,
Originally posted by Saha Kumar:
If a UML 2.0 component has a port, does that imply that the component has sub components?

I would say, not only:

1. A port may be attached to a Composite Structure, then what you say is half true.

2. But a port may be attached to a unstructured Component as well. Then

a) an arrow from the port to a class means that
- - a message goes from an interface of that port to that class
- - and in my oppinion implies that this interface is a provided interface of the class, so it makes sense that others call something on the provided interface

b) an arrow from the class to the port means that
- - a message goes from that class to an interface that is part of that port
- - and in my oppinion implies that this interface is a required interface for the class, so it makes sense to call something on the required interface

Thomas
[ May 03, 2006: Message edited by: Thomas Taeger ]
 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ricardo, Thomas, All,

Thanks for your replies. These are helpful.

My question is: for the part II component diagram (and in future design projects), when would the assembly connector be used and when would a port be used? I have looked at many examples online, and have seen that either a port is always used in the component diagrams, or the assembly connector is always used in the component diagrams.

So, I have one question:
When would the assembly connector be used and when would a component with a port be used? For example, if an EJB entity is a component, would it have a port or a assembly connector.

Thanks in advance for your valuable contribution.

-Saha
 
Thomas Taeger
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Saha Kumar:
... when would the assembly connector be used and when would a port be used?


The Assembly Connector is an INTER-component connector:
- an edge from a component to a ball, then
- a ball ...
- ... in a socket, then
- an edge from the socket to the other component


A Port AND one or more connectors are INTRA-component connectors:

- from a provided interface outside the component
- to a port on the border
- to a realizing classifier WITHIN a component,

or:

- from a classifier WITHIN a component
- to a port on the border
- to a required interface outside the component

or:
a bidirectional port with
- provided AND required interfaces at the same port, and connectors ...

Thomas
[ May 04, 2006: Message edited by: Thomas Taeger ]
 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Thomas!

-Saha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic