-
-
Notifications
You must be signed in to change notification settings - Fork 317
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 2 replies
-
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 titreDeployment view
Sans titreThe 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 ? 👂
Beta Was this translation helpful? Give feedback.
All reactions
-
@simonbrowndotje it seems like support for this feature is coming soon, am I wrong ?
I saw this commit c527e09#diff-36e346c531a0be429bfc1eee4e837e3f463fb0625ba8f0ae045ca9eaf891fb92
Beta Was this translation helpful? Give feedback.
All reactions
-
Yes; details of how this works are available at https://www.patreon.com/posts/136924690
Beta Was this translation helpful? Give feedback.