Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Relationships going "through" an element #348

telune started this conversation in Ideas
Discussion options

When modeling a rather big and complex Software System, I often found that I model in my head a relationship between element A and element B as "going through" element C. This comes natural when I have to model services like API gateways or reverse proxies: e.g. I want to model the fact that a GUI (deployed in a browser) is in relationship with a back-end service (deployed on server X), but in some cases it is also important to communicate that the relationship "passes through" a reverse proxy that may be deployed on server Y.

I know that I can model this creating a relationship A -> C and another C -> B, but this quickly becomes cumbersome as C is typically used as gateway for a lot of different communications, and the original relationship A -> B (which is the actual "semantic" relationship) gets lost.

Are there plans to support this kind of "going through" relationship feature?

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

Hello, I created a minimal workspace to explain how I work around this problem for now.

workspace {
 !identifiers hierarchical
 
 model {
 a = softwareSystem "A" {
 x = container "X App"
 }
 
 b = softwareSystem "B" {
 o = container "O Backoffice"
 y = container "Y Api"
 Z = container "Z App"
 o -> y
 y -> z
 }
 a.x -> b.y
 
 prod = deploymentEnvironment "Production" {
 apiManager = deploymentNode "Api Manager" {
 y = infrastructureNode "Y Managed Api"
 }
 
 srv = deploymentNode "Srv" {
 reverseProxyO = infrastructureNode "Reverse Proxy O"
 reverseProxyZ = infrastructureNode "Reverse Proxy Z"
 
 o = containerInstance b.o
 y = containerInstance b.y
 z = containerInstance b.Z
 
 reverseProxyO -> o
 reverseProxyZ -> z
 }
 
 // exposed through api manager
 apiManager.y -> srv.y
 // call through reverse proxy
 srv.o -> apiManager.y
 srv.y -> srv.reverseProxyZ
 }
 }
 views {
 container b "B" {
 include element.type==Container
 autolayout lr
 }
 
 deployment * prod "Production" {
 include *
 // prefer deployment relationship
 exclude *->b.y
 exclude *->b.z 
 autolayout lr
 }
 } 
}

Container view

Sans titre

Deployment view

Sans titre

The idea

In deployment model, I create additionnal relationships for the "through" elements : "to" and "from" the api manager or reverse proxy.
In deployment view, I exclude relationships from containers exposed through the api manager or reverse proxy.

What I would prefer

Below is an example of what syntax I would prefer to use. I have no idea if it's a good idea (will it work for lots of people ?) or the complexity to add this to Structurizr. It's just my current state of mind about this problem 😄

workspace {
 !identifiers hierarchical
 
 model {
 a = softwareSystem "A" {
 x = container "X App"
 }
 
 b = softwareSystem "B" {
 o = container "O Backoffice"
 y = container "Y Api"
 Z = container "Z App"
 o -> y
 y -> z
 }
 a.x -> b.y
 
 prod = deploymentEnvironment "Production" {
 apiManager = deploymentNode "Api Manager" {
 y = infrastructureNode "Y Managed Api"
 }
 
 srv = deploymentNode "Srv" {
 reverseProxyO = infrastructureNode "Reverse Proxy O"
 reverseProxyZ = infrastructureNode "Reverse Proxy Z"
 
 o = containerInstance b.o
 y = containerInstance b.y
 z = containerInstance b.Z
 
 
 reverseProxyO -> o
 reverseProxyZ -> z
 }
 
 // exposed through api manager
 apiManager.y -> srv.y
 
 // replace relationships to pass through an infrastructure node
 !relationship "b.o->b.y" {
 replaceWith {
 srv.o -> apiManager.y
 }
 }
 
 !relationship "b.y->b.z" {
 replaceWith {
 srv.y -> reverseProxy.Z
 }
 }
 }
 }
 views {
 container b "B" {
 include element.type==Container
 autolayout lr
 }
 
 deployment * prod "Production" {
 include *
 // no need to exclude relationship
 // they were overwritten in deployment model
 autolayout lr
 }
 }
 
}

I went with this syntax to allow to replace a single relationship with multiple one if you pass through multiple infrastructureNodes :

!relationship "a->b" {
 replaceWith {
 srv.a -> firewall
 firewall -> reverseProxy.b
 }
}

Feedback ? 👂

You must be logged in to vote
2 replies
Comment options

@simonbrowndotje it seems like support for this feature is coming soon, am I wrong ?

I saw this commit c527e09#diff-36e346c531a0be429bfc1eee4e837e3f463fb0625ba8f0ae045ca9eaf891fb92

Comment options

Yes; details of how this works are available at https://www.patreon.com/posts/136924690

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

AltStyle によって変換されたページ (->オリジナル) /