Component diagram is ugly as a nightmare :( What am I doing wrong?

0 votes
asked Oct 13, 2023 in Question / help by iamhere2 (120 points)

Hello everyone!

I'm trying to use PlantUML for automatic component diagram generation. I need to depict interfaces, delegated connections (or something as a replacement), outer and nested components (just one level of parent-child). Not much, as I believe. But the result is awful for some reason. Could you please hint me what I am doing wrong?

That's the code:

@startuml SimpleChess

component "SimpleChess Application" as Application {


    portin "IConsoleApplication" as InPort_IConsoleApplication

    portout "IFileIO" as OutPort_IFileIO

    portout "IConsoleInput" as OutPort_IConsoleInput

    portout "IConsoleOutput" as OutPort_IConsoleOutput


    component ChessEngine

    component GameController


    interface "IChessEngine" as ChessEngine_IChessEngine

    ChessEngine_IChessEngine - [ChessEngine]

    interface "IGameController" as GameController_IGameController

    GameController_IGameController - [GameController]


    [GameController] --( ChessEngine_IChessEngine


    [GameController] --(0- OutPort_IFileIO

    [GameController] --(0- OutPort_IConsoleInput

    [GameController] --(0- OutPort_IConsoleOutput

    GameController_IGameController -0- InPort_IConsoleApplication

}


interface "IConsoleApplication" as Env_IConsoleApplication

InPort_IConsoleApplication -- Env_IConsoleApplication


interface "IFileIO" as Env_IFileIO

OutPort_IFileIO --( Env_IFileIO


interface "IConsoleInput" as Env_IConsoleInput

OutPort_IConsoleInput --( Env_IConsoleInput


interface "IConsoleOutput" as Env_IConsoleOutput

OutPort_IConsoleOutput --( Env_IConsoleOutput


@enduml

1 Answer

0 votes
answered Mar 12 by dickmaley (4,120 points)

image

@startuml SimpleChess
skinparam linetype ortho

component "SimpleChess Application" as Application {


    portin "IConsoleApplication" as InPort_IConsoleApplication

    portout "IFileIO" as OutPort_IFileIO

    portout "IConsoleInput" as OutPort_IConsoleInput

    portout "IConsoleOutput" as OutPort_IConsoleOutput


    component ChessEngine

    component GameController


    interface "IChessEngine" as ChessEngine_IChessEngine

    ChessEngine_IChessEngine - [ChessEngine]

    interface "IGameController" as GameController_IGameController

    GameController_IGameController - [GameController]


    [GameController] --( ChessEngine_IChessEngine


    [GameController] --(0- OutPort_IFileIO

    [GameController] --(0- OutPort_IConsoleInput

    [GameController] --(0- OutPort_IConsoleOutput

    GameController_IGameController -0- InPort_IConsoleApplication

}


interface "IConsoleApplication" as Env_IConsoleApplication

InPort_IConsoleApplication -- Env_IConsoleApplication


interface "IFileIO" as Env_IFileIO

OutPort_IFileIO --( Env_IFileIO


interface "IConsoleInput" as Env_IConsoleInput

OutPort_IConsoleInput --( Env_IConsoleInput


interface "IConsoleOutput" as Env_IConsoleOutput

OutPort_IConsoleOutput --( Env_IConsoleOutput


@enduml

...