C4Context 是最宽的视图:周围的人和系统。Rel 把其中两个连起来,动词写在中间。
C4Context
title System context for the banking app
Person(customerA, "Banking customer", "A customer of the bank.")
System(SystemAA, "Internet banking", "Allows customers to see accounts and pay bills.")
Rel(customerA, SystemAA, "Uses", "HTTPS")C4Container 是再放大一级。System_Boundary 是容器所在的框。
C4Container
title Container diagram for the banking app
Person(customerA, "Banking customer")
System_Boundary(b1, "Internet banking") {
System(SystemA, "Banking system", "Handles accounts and payments.")
SystemDb(SystemD, "Database", "Stores accounts and payments.")
}
Rel(customerA, SystemA, "Uses", "HTTPS")
Rel(SystemA, SystemD, "Reads and writes")Enterprise_Boundary 把人和系统归到同一个组织下面。
C4Context
title Enterprise boundary
Enterprise_Boundary(b0, "Bank") {
Person(customerA, "Customer")
System(SystemAA, "Internet banking")
}
Rel(customerA, SystemAA, "Uses")