See example code here
object PersonalBankingCustomer extends Person("personal customer of the bank")
object EMailSystem extends System("microsoft exchange", external = true)
object MainframeBankingSystem extends System("old", external = true)
object InternetBankingSystem extends System {
object WebApplication extends Container(
"Java and Spring MVC", "delivers the static content"
)
object SinglePageApplication extends Container("Javascript and Angular")
object MobileApp extends Container("Xamarin", "subset of web functionality")
object Database extends Container("Oracle", "user info", true)
object APIApplication extends Container("Java and Spring MVC") {
object PasswordResetController extends Component("Spring MVC Rest controller")
object SignInComponent extends Component(
"Spring MVC Rest controller", "lets users sign in"
)
object AccountsSummaryController extends Component(
"Spring MVC Rest controller",
"gives customers summaries of their accounts"
)
object SecurityComponent extends Component(
"Spring Bean", "functions related to sign in, password change, etc"
)
object EMailComponent extends Component(
"Spring Bean", "sends emails to users"
)
object MainframeBankingSystemFacade extends Component(
"Spring Bean", "facade to mainframe bank system"
)
}
}
render(
PersonalBankingCustomer-
"visits website"-->InternetBankingSystem.WebApplication,
PersonalBankingCustomer-
"views account balances"-->InternetBankingSystem.SinglePageApplication,
PersonalBankingCustomer-
"views account balances"-->InternetBankingSystem.MobileApp,
InternetBankingSystem.WebApplication-
"delivers to browser"-->InternetBankingSystem.SinglePageApplication,
InternetBankingSystem.MobileApp-
"makes api calls"-->InternetBankingSystem.APIApplication,
InternetBankingSystem.SinglePageApplication-
"makes api calls"-->InternetBankingSystem.APIApplication,
InternetBankingSystem.APIApplication-
"r/w"-->InternetBankingSystem.Database,
InternetBankingSystem.APIApplication-
"sends email using"-->EMailSystem,
InternetBankingSystem.APIApplication-
"makes api calls to"-->MainframeBankingSystem
)
Render diagrams using plantUML
$ ./big-bank-plc-containers.sc | java -jar plantuml.jar -pipe > big-bank-plc-containers.png
$ ./big-bank-plc-containers.sc > big-bank-plc-containers.puml
- Install ammonite
- Download the modeling script
wget https://raw.githubusercontent.com/kag0/c4-modeling/main/c4.sc
- Reference from your modeling and diagram code
import $file.^.c4 import c4._