structurizr / dsl

Structurizr DSL
https://docs.structurizr.com/dsl
Apache License 2.0
1.41k stars 266 forks source link

cardinality in relationships #164

Closed dgutson closed 1 year ago

dgutson commented 1 year ago

How should I model a one-to-many relationship? For example, I want to show that a server can be accessed by multiple clients. Now it would be client -> server

How to denote that many clients can access one server?

simonbrowndotje commented 1 year ago

There's no support for relationship cardinality in Structurizr, but you could do something like the following:

dgutson commented 1 year ago

Good ideas for now. Feature request? BTW i think that versioning the DSL would be a good idea, so this feature could fit in 2.0? :)

simonbrowndotje commented 1 year ago

Good ideas for now.

Thanks.

Feature request?

It's not something I'm particularly keen on adding to be honest. Once you start getting to this level of detail, I'd probably steer people towards UML, which has much more specific semantics.

BTW i think that versioning the DSL would be a good idea

Unless I'm misunderstanding what you're saying here, the DSL is already versioned; see https://github.com/structurizr/dsl/blob/master/docs/changelog.md

dgutson commented 1 year ago

I finally "solved" by exporting to C4-Plantuml, and using the shadow for denoting "multiple", the best I could instead of "overlapped" squares (to denote many)

AddElementTag("multi", $shadowing="true")

I would like to change the arrow type, but AddRelTag doesn't support it as far as I know, only the lineStyle, not arrowhead style.