6

For an interface that can be used symetrically like for example

interface **ipc**
   send()
   receive() 

Both components receive and send. How do I represent this in UML?

Currently I am doing this:

Component diagram

Is this how it's done in a component diagram? If not, what's a better approach? (Please ignore the ports, the real components contain internal details).

1
  • EDIT: To clarify Comp 1 and Comp 2 are distinct components that communicate using the interface definition ipc. They do not represent two instances of the same component.
    – Rire1979
    Feb 2, 2016 at 16:52

1 Answer 1

2

In fact, at the type level, I would only define one Component providing and comsuming the IPC Interface as below.

enter image description here

The connections between Component isntances would be defined in another diagram ( Composite structure or Object diagram).

enter image description here

3
  • Edited the question to clarify that Comp 1 and Comp 2 are distinct components. If I understand correctly you assume they are instances of the same component. Based on this assumption, it looks like your solution is identical to what I am doing: each component definition provides and requires an ipc. Then the relationship between the two is that they use delegation between the inputs and outputs. You seem to be using assembly (insted of delegation) I believe to represent this relationship. Am I correct?
    – Rire1979
    Feb 2, 2016 at 16:57
  • To be clear I defined one and only one component named Component providing and requiring the same IPC interface (you can create two components but if they do not have any difference it does not make so much sense). The conenction must be done between two instances of the component not between two components. And you are right I created assembly connectors between the two instances names comp1 and comp2.
    – Red Beard
    Feb 3, 2016 at 9:10
  • if this were tcp or a message pipe, one of your components would be listening (waiting) for a connection. I'd mark that as the 'lollipop' and only have the one (bi-directional) connection between the two components.
    – timB33
    Jan 13, 2017 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.