How to connect an arrow to a single interface (lollypop type) in a class diagram?

0 votes
asked Dec 5, 2022 in Question / help by michelkeijzers (120 points)
edited Dec 5, 2022 by michelkeijzers

I have the following code:

@startuml
class A
class B
class X

A  -(0-- X : IF1
B -(0-- X : IF1

@enduml

This shows a diagram with two interfaces, but I want both classes A and B to connect to a single lollypop interface (not two).

Is this possible, and if yes, what should I change in the code?

Thanks in advance

1 Answer

+1 vote
answered Dec 5, 2022 by The-Lu (89,080 points)
selected Dec 6, 2022 by michelkeijzers
 
Best answer

Hello M.,

From your example:

@startuml
class A
class B
class X

A  -(0-- X : IF1
B -(0-- X : IF1

@enduml

Here is a proposal:

@startuml
class A
class B
class X

() IF1
IF1 -- X
A --( IF1
B --( IF1

@enduml

If that can help,
Regards.
Th.

commented Dec 6, 2022 by michelkeijzers (120 points)
Yes, this really helped, thank you very much The-Lu.
...