Weird ordering with complex components and horizontalLineBetweenDifferentPackageAllowed

+2 votes
asked Mar 13, 2015 by anonymous

Hi,

I thought I'd asked about this before, but I can't seem to find the question when searching now, so I'll try again; please forgive me if there is a duplicate:

I find that the location of components and direction of lines are not quite as expected when:

  1. Horizontal positioning is enabled via !pragma horizontalLineBetweenDifferentPackageAllowed.
  2. Complex components are used, i.e. there are components within components.
  3. A "lollipop" interface outside the "super" component lis linked to a sub component.
  4. A sub component from a different complex component connects to the interface.

Consider for instance the following:

@startuml
!pragma horizontalLineBetweenDifferentPackageAllowed

component "A System" as sys {
  database "Configuration" as aConfigDb
  database "Observations" as aDataDb
  database "Data" as aStateDb

  [Inversion] as aNetwork

  aDataDb -up-> aNetwork
  aNetwork -left-> aStateDb
  aConfigDb --> aNetwork
}

() "Spread\nconfiguration" as config
aConfigDb -left- config
() "Output\nData" as data
aStateDb -left- data

component "Another System" as sys2 {
  [Config\nReceiver] as receiver1
  [Config\nReceiver] as receiver2
  receiver1 -[hidden]- receiver2
}

receiver1 -right-( config
receiver2 -right-( data

@enduml
 

Which produces the output included below. The main question is of  course, why isn't "Another System" placed to on the left-hand-side of "A System"??


 

1 Answer

0 votes
answered Feb 11 by hukameniz (5,510 points)
edited Feb 11 by hukameniz

This one looks better:

@startuml
!pragma horizontalLineBetweenDifferentPackageAllowed

component "A System" as sys {
  database "Configuration" as aConfigDb
  database "Observations" as aDataDb
  database "Data" as aStateDb

  [Inversion] as aNetwork

  aDataDb --> aNetwork
  aNetwork -> aStateDb
  aConfigDb --> aNetwork
}

() "Spread\nconfiguration" as config
aConfigDb - config
() "Output\nData" as data
aStateDb - data

component "Another System" as sys2 {
  [Config\nReceiver] as receiver1
  [Config\nReceiver] as receiver2
  receiver1 -[hidden]- receiver2
}

receiver1 -( config
receiver2 -( data
@enduml

Or:

@startuml

component "A System" as sys {
  database "Configuration" as aConfigDb
  database "Observations" as aDataDb
  database "Data" as aStateDb

  [Inversion] as aNetwork

  aDataDb -up-> aNetwork
  aNetwork -> aStateDb
  aConfigDb --> aNetwork
}

() "Spread\nconfiguration" as config
aConfigDb - config
() "Output\nData" as data
aStateDb - data

component "Another System" as sys2 {
  [Config\nReceiver] as receiver1
  [Config\nReceiver] as receiver2
  receiver1 -[hidden]- receiver2
}

receiver1 -( config
receiver2 -( data
@enduml

...