plantuml-stdlib / C4-PlantUML

C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Separating model and view

NathanDotTo opened this issue · comments

Hi

I would like to achieve an outcome such that I can define common model elements - systems, containers, components - in a model.puml file and reuse those model elements in other model files, but not have the reusable model elements rendered unless I explicitly want them to be.

This is intended to allow model elements to be defined in one place, and used in other parts of the overall system model in a way that is consistent.

I can create model elements in a file, and include that file in other files. That is fine. But, the model elements from the included file are all rendered. This is as expected given current functionality.

It is conceivable, I think, that there are other possibilities.

For example, there could be a form of !includeInvisible such that the included elements are not rendered by default, but are rendered when used in a Rel of some sort. I haven't found documentation that descried the !include functionality, so I have not been able to check whether this exists already.

What do others think please? I realise that there might be a better forum for such questions, so please feel free to direct me elsewhere with this question as appropriate.

Thanks

Nathan

Hi @NathanDotTo,

I think PlantUML Q&A is the best place if you have PlantUML specific questions, findings, ...

In concrete I found remove @unlinked which could solve your problems. But during some fast checks I found following problems

  • it produces sometimes internal exceptions
  • if an element (like System) has a sub element (like component) then the referenced System remains invisible as long the component is not referenced too. I added some combinations that you see the current state

Best regards
Helmut

I have built developed something similar using a collection json files..
See https://github.com/gobravedave/C4-Plantuml-Helper for reference.

For future reference: It is also possible to use the Subpart feature to only include part(s) of the central reference file.