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

Add possibility to represent modules as C4 Components #153

Open
OLibutzki opened this issue Oct 26, 2022 · 3 comments
Open

Add possibility to represent modules as C4 Components #153

OLibutzki opened this issue Oct 26, 2022 · 3 comments

Comments

@OLibutzki
Copy link
Contributor

OLibutzki commented Oct 26, 2022

archifacts models modules of a monolith as containers. Due to this converation with @simonbrowndotje they should be modelled as components.

Unfortunately, the Structurizr Java API is limited and does not provide all the features we need to model modules as components appropriately.

As an alternative we could think about generating PlantUML directly using the C4-PlantUML-Stdlib or generating Structurizr DSL Code.

At first glance the DSL approach seems to be the better choice as it abstracts from the concrete technology (PlantUML).

It seems to be possible to parse the generated DSL files using StructurizrDslParser.

As part of this issue it should be possible to decide how modules should be represented in the C4 model.
archifacts should support representing them as containers (distributed system) or components (modular monolith).

@simonbrowndotje
Copy link

Unfortunately, the Structurizr Java API is limited and does not provide all the features we need to model modules as components appropriately.

At first glance the DSL approach seems to be the better choice as it abstracts from the concrete technology (PlantUML).

The DSL parser uses the Java API, so anything you can do with the DSL is possible with the Java API. As an example, the parser for the component DSL keyword just calls container.addComponent() -> https://github.com/structurizr/dsl/blob/master/src/main/java/com/structurizr/dsl/ComponentParser.java

@OLibutzki
Copy link
Contributor Author

OLibutzki commented Oct 26, 2022

Thanks for clarifying, @simonbrowndotje.

Well, after investigating the PlantUML-Stdlib I realized that code elements are not part of the lib, too. So it feels like both of my ideas don't work.

So there is no specific visual C4 representation for code elements and the relationships between them, right? A classic UML class diagram for the rescue?

@simonbrowndotje
Copy link

So there is no specific visual C4 representation for code elements and the relationships between them, right? A classic UML class diagram for the rescue?

There is no "specific visual C4 representation" for any of the C4 model diagrams (the C4 model is notation independent), so yes, a UML class diagram is a good approach for level 4 -> https://c4model.com/#CodeDiagram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants