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:
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).
-
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– Rire19792016年02月02日 16:52:56 +00:00Commented Feb 2, 2016 at 16:52
1 Answer 1
In fact, at the type level, I would only define one Component providing and comsuming the IPC Interface as below.
The connections between Component isntances would be defined in another diagram ( Composite structure or Object diagram).
-
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– Rire19792016年02月02日 16:57:49 +00:00Commented 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– Red Beard2016年02月03日 09:10:39 +00:00Commented 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– timB332017年01月13日 13:49:39 +00:00Commented Jan 13, 2017 at 13:49