likec4 / likec4

Visualize, collaborate, and evolve the software architecture with always actual and live diagrams from your code
https://likec4.dev
MIT License
240 stars 19 forks source link

How to nest elements either in other model elements or multiple times in a view? (See also discussion "Add elements in Dynamic View") #1003

Open ilstephano opened 2 weeks ago

ilstephano commented 2 weeks ago

Hi all,

also from my side first of all many thanks for the LikeC4 dsl and toolsuite! In Structurizr I was missing higher level - customized - abstractions and thus came along to LikeC4.

But now I'm missing the 'instance' feature of Structurizr, as I want to show model elements multiple times in a view.

Pls excuse if I'm missing the clue so far - my question is simply: When deriving the following model from 'tutorial.c4' - how could I create a view like the next without having repeated the 'ui' component:

grafik

Many thanks in advance!

Discussed in https://github.com/likec4/likec4/discussions/967

Originally posted by **lloydfischer** September 6, 2024 First, my thanks for likeC4. I'm trying to emulate the deployment view in structurizr and it seems like a Dynamic view is what I want. The key to the deployment view is that is contains elements and (maybe) relationships that are not in the model but exist only in the view. The documentation for Dynamic Views hints at this with "with specific elements and interactions, defined only in the view" and I can create indeed create relationships. I get a parse error creating an element. Am I missing something, or is this not yet implemented? This particular feature is vital in my use case, otherwise all the infrastructure details get mixed in with the main architecture. I could create these infra elements in the model, but then something like an instanceof operator would be required. Again, I think likeC4 is a giant leap forward in this space, thanks so much
davydkov commented 4 days ago

Hi @ilstephano

Not possible at the moment, but i think correlates with this discussion https://github.com/likec4/likec4/discussions/533#discussioncomment-10668699

ilstephano commented 2 days ago

Yes, I agree, #533 will solve my issue. Thank you for investigating my thoughts!