Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Alias of interfaces in component diagrams

0 votes

is there a way to define a set of interfaces as aliases?

such as in the example below i want to define interfaces a1, a2, a3 as aliases of interface A so that only A will be rendered instead of a1, a2, a3 and the arrows will be from A to d, e and f

 

@startuml
 
 
component comp as comp {
interface a1 as a1
interface a2 as a2
interface a3 as a3
/'
now I want to declare a1, a2, and a3 as aliases of a new interface A that will be used instead of those 3 when rendering
'/
}
 
interface d as d 
interface e as e
interface f as f
 
a1->d
a2->e
a3->f
 
@enduml
 
 
so, that after that redefinition the code would virtually become as follows:
 
@startuml
 
 
component comp as comp {
interface A as A
}
 
interface d as d 
interface e as e
interface f as f
 
A->d
A->e
A->f
 
@enduml
 
asked Aug 16 in Wanted features by boshka (1,150 points)

1 Answer

0 votes
 
Best answer

Hello,

Cou can use !define

@startuml
!define a1 A 
!define a2 A 
!define a3 A 
 
component comp as comp {
interface a1 as a1
interface a2 as a2
interface a3 as a3
/'
now I want to declare a1, a2, and a3 as aliases of a new interface A that will be used instead of those 3 when rendering
'/
}
 
interface d as d 
interface e as e
interface f as f
 
a1->d
a2->e
a3->f
@enduml
answered Aug 17 by Serge Wenger Work (5,150 points)
selected Aug 19 by boshka
many thanks! I should have seen this way myself :)
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...