Book a Demo

Author Topic: Components, ports, interfaces in UML 2.0  (Read 14428 times)

irobot

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Components, ports, interfaces in UML 2.0
« on: September 09, 2004, 04:59:36 pm »
I need to describe a component-based architecture, communication patterns, etc. UML 2.0 is supposed to help with this, but information is surprisingly scarse, and examples are rare.

The best one I could find is in a white paper from Telelogic (July 2003). {http://www.telelogic.com/download/get_file.cfm?ID=3541}

In the example, they show:

1) a class diagram which defines a component 'RDP' with 3 ports (Figure 5):
1 port with 1 provided interface (incoming data)
2 ports with 1 provided and 1 required interfaces each (bi-directional data flow)

2) a composite diagram which defines an architecture connecting the component (or class?) above to two other components (Figure 8). Here an instance rdp:RDP is shown as a part (EA lets assign classifiers to parts but does not display them). Ports are linked by (I assume) connectors. Interfaces are not shown. The paper says that "UML 2.0 tools will enforce checking to ensure that the provided/required interfaces of all instances are correctly connected." So the tool they use correctly shows directional and bi-directional arrows on the connector elements. It looks good to me.

So here's my question: does this make sense? Have people seen this interpretation elsewhere? Does anyone know a good reference on the use of component/port/interface combo? Examples?

Cheers.

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Components, ports, interfaces in UML 2.0
« Reply #1 on: September 09, 2004, 07:48:16 pm »
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

irobot

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Components, ports, interfaces in UML 2.0
« Reply #2 on: September 10, 2004, 07:02:41 pm »
Thanks for the link. I've seen it before.

I agree it simpler and a bit more informal than the one I was referring to. The engineering application of the latter is closer to what I am doing: lots of objects being passed around and the lollylop notation quickly gets messy and requires lots of clicking.

...which brings an EA question:

I define a component with several ports, each with one or more interfaces.

Then drop it into another diagram: ports are not shown. Go to 'Embedded elements...", make all ports visible. Ports are now visible, the interfaces are not. Click on each one, go to 'Embedded elements...", make all interfaces visible.

Is there a global switch for this?

thanks

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Components, ports, interfaces in UML 2.0
« Reply #3 on: September 12, 2004, 04:06:45 pm »
Good question!

Unfortunately - not that I know of.
(and as I'm currently working with a model containing 56 components, 170 odd interfaces and over 300 dataflows ("connections") --- I wish!)

To get back to your original.  It seems to me that ports are a logical level feature allowing you to provide some strucure to the interfaces presented / required by components.  From Ambler's stuff it seems that they have a role in establishing options for implementation choices and don't have a "real" implementation.  The only other use I can see is to enable some sort of shorthand for pattern based exposure of a limited set of interfaces provided by a component - i.e. a subset of the total interface set of the implemented classifiers within the component.  If I am right then ports have IMO limited use in component level structural models.  Am I right?

Bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

irobot

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Components, ports, interfaces in UML 2.0
« Reply #4 on: September 13, 2004, 01:40:27 am »
> If I am right then ports have
> IMO limited use in component level structural models.  

I am starting to agree. And what do you do if you have a symmetric peer-to-peer comm. protocol represented by some interface? Do you draw two assempbly connections, one in each direction?

Ports do come in handy when drawing the internal structure of components, but that's different and you can always opt for a 1-to-1 mapping of interfaces and ports.

Interestingly, when you drag-n-drop a class onto a component in EA, it will ask if you want to convert it to a port, a part, or neither. Part is clear, but what happens if you choose 'port' I am not sure. it seems to just add a port. This would indicate some structural use of ports(?)


thomaskilian

  • Guest
Re: Components, ports, interfaces in UML 2.0
« Reply #5 on: September 20, 2004, 06:48:34 am »
Quote
Do you draw two assempbly connections, one in each direction?
I guess, yes. You need a socket/port respecively lollipop/socket connection on both sides.

On wiring diagrams I just started to show only the ports and to draw dependencies between the ports only. The difficulty there is that you have to know by heart which interface is behind the port.

armelle

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Components, ports, interfaces in UML 2.0
« Reply #6 on: October 29, 2004, 08:09:09 am »
Hi,

Reading through this discussion, it seems that you have been able to use "association" in component diagrams.
I am not able to create a clean ----C0----- line, neither to link such an association to the existing provided and required interfaces in my objects.

Didn't you have such issues?

Thanks !

thomaskilian

  • Guest
Re: Components, ports, interfaces in UML 2.0
« Reply #7 on: October 29, 2004, 08:19:13 am »
armelle,
you need to draw this assembly directly between two components. I myself did not find it very usefull so I stay with the socket/lollipop and draw dependencies (not associations!) between the latter.

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: Components, ports, interfaces in UML 2.0
« Reply #8 on: November 10, 2004, 02:21:52 am »
I have different components which "require" the same interface from a central "provider" - it's a database.

I wanted to drag-copy the "required interface" from the project browser onto each component, but EA won't let me do this.

Would be nice if I could select the 'ProvidedInterface' (lollipop) on the sourcing component in some way and Drag-drop onto components that 'Required' it, producing the matching 'RequiredInterface' (plunger/dalek) wherever wanted.
« Last Edit: November 10, 2004, 02:53:12 am by mikewhit »

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Components, ports, interfaces in UML 2.0
« Reply #9 on: November 10, 2004, 06:32:38 pm »
Mike,
How much information are you putting into the required's?  I have always just used them as a place marker to connect dependencies - rarley going beyond some type of indicative name ...
alien::dalek -( weapon
alien::cyborg -( weapon

FXdept:prop -o deathray
FXdept:prop - o midcontrol
then draw dependencies between the 'weapon" if's and the weapon of choice lollipop

Is there anything more powerful that I'm missing by just using them "generically"?

Bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.