Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a option that draws 'Composition' as uml? #37

Open
kickbell opened this issue Dec 1, 2022 · 4 comments
Open

Is there a option that draws 'Composition' as uml? #37

kickbell opened this issue Dec 1, 2022 · 4 comments
Labels
enhancement New feature or request workaround-possible This issue can be mitigated by a workaround

Comments

@kickbell
Copy link

kickbell commented Dec 1, 2022

Is there a option that draws 'Composition' as uml?

@MarcoEidinger
Copy link
Owner

You can modify the output of this command-line tool to add compositions as PlantUML supports this notation.

@startuml
Foo *-- Bar
@enduml

would result in

SoWkIImgAStDuNBBprVGqjLLS4eiud98pKi1YW40

But SwiftPlantUML will not auto-generate this for you because I did not implement the composition (or association) detection in Swift code.

This Swift code

public class Foo {
    private Bar bar = new Bar(); 
}

would result in the following PlantUML script generated by SwiftPlantUML command-line tool

@startuml
' STYLE START
hide empty members
skinparam shadowing false
' STYLE END

class "Foo" as Foo << (C, DarkSeaGreen) >> { 
  -Bar() 
}
class "Bar" as Bar << (C, DarkSeaGreen) >> {  
}

@enduml

And you want

@startuml
' STYLE START
hide empty members
skinparam shadowing false
' STYLE END

class "Foo" as Foo << (C, DarkSeaGreen) >> { 
  -Bar() 
}
class "Bar" as Bar << (C, DarkSeaGreen) >> {  
}

Foo *-- Bar

@enduml

Does this answer your question?

@kickbell
Copy link
Author

kickbell commented Dec 2, 2022

yes, that's a really good answer. I'll try it out! 👍🏻

@MarcoEidinger MarcoEidinger added enhancement New feature or request workaround-possible This issue can be mitigated by a workaround labels Dec 2, 2022
@AlexPerathoner
Copy link

Hi, are you planning on adding an option to detect Composition automatically? It'd be great to get insights regarding the coupling of the system, too

@MarcoEidinger
Copy link
Owner

Hi @AlexPerathoner, it's not on my short-term list as I am worried about performance & cluttering the diagram. If you wanna take a shot and prepare a PR then I am happy to reviewing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request workaround-possible This issue can be mitigated by a workaround
Projects
None yet
Development

No branches or pull requests

3 participants