You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 23, 2023. It is now read-only.
Workspaceworkspace=newWorkspace("Big Bank plc","This is an example workspace to illustrate the key features of Structurizr, based around a fictional online banking system.");
28
+
Modelmodel=workspace.Model;
29
+
ViewSetviews=workspace.Views;
30
+
31
+
model.Enterprise=newEnterprise("Big Bank plc");
32
+
33
+
// people and software systems
34
+
Personcustomer=model.AddPerson(Location.External,"Customer","A customer of the bank.");
35
+
36
+
SoftwareSysteminternetBankingSystem=model.AddSoftwareSystem(Location.Internal,"Internet Banking System","Allows customers to view information about their bank accounts and make payments.");
37
+
customer.Uses(internetBankingSystem,"Uses");
38
+
39
+
SoftwareSystemmainframeBankingSystem=model.AddSoftwareSystem(Location.Internal,"Mainframe Banking System","Stores all of the core banking information about customers, accounts, transactions, etc.");
SoftwareSystematm=model.AddSoftwareSystem(Location.Internal,"ATM","Allows customers to withdraw cash.");
43
+
atm.Uses(mainframeBankingSystem,"Uses");
44
+
customer.Uses(atm,"Withdraws cash using");
45
+
46
+
PersonbankStaff=model.AddPerson(Location.Internal,"Bank Staff","Staff within the bank.");
47
+
bankStaff.Uses(mainframeBankingSystem,"Uses");
48
+
49
+
// containers
50
+
ContainerwebApplication=internetBankingSystem.AddContainer("Web Application","Provides all of the Internet banking functionality to customers.","Java and Spring MVC");
// - for a real-world software system, you would probably want to extract the components using
60
+
// - static analysis/reflection rather than manually specifying them all
61
+
ComponenthomePageController=webApplication.AddComponent("Home Page Controller","Serves up the home page.","Spring MVC Controller");
62
+
ComponentsigninController=webApplication.AddComponent("Sign In Controller","Allows users to sign in to the Internet Banking System.","Spring MVC Controller");
63
+
ComponentaccountsSummaryController=webApplication.AddComponent("Accounts Summary Controller","Provides customers with an summary of their bank accounts.","Spring MVC Controller");
64
+
ComponentsecurityComponent=webApplication.AddComponent("Security Component","Provides functionality related to signing in, changing passwords, etc.","Spring Bean");
65
+
ComponentmainframeBankingSystemFacade=webApplication.AddComponent("Mainframe Banking System Facade","A facade onto the mainframe banking system.","Spring Bean");
// DeploymentNode developerLaptop = model.AddDeploymentNode("Developer Laptop", "A developer laptop.", "Windows 7 or 10");
76
+
// developerLaptop.AddDeploymentNode("Docker Container - Web Server", "A Docker container.", "Docker")
77
+
// .AddDeploymentNode("Apache Tomcat", "An open source Java EE web server.", "Apache Tomcat 8.x", 1, MapUtils.Create("Xmx=512M", "Xms=1024M", "Java Version=8"))
78
+
// .Add(webApplication);
79
+
//
80
+
// developerLaptop.AddDeploymentNode("Docker Container - Database Server", "A Docker container.", "Docker")
81
+
// .AddDeploymentNode("Database Server", "A development database.", "Oracle 12c")
82
+
// .Add(database);
83
+
//
84
+
// DeploymentNode liveWebServer = model.AddDeploymentNode("bigbank-web***", "A web server residing in the web server farm, accessed via F5 BIG-IP LTMs.", "Ubuntu 16.04 LTS", 8, MapUtils.Create("Location=London"));
85
+
// liveWebServer.AddDeploymentNode("Apache Tomcat", "An open source Java EE web server.", "Apache Tomcat 8.x", 1, MapUtils.Create("Xmx=512M", "Xms=1024M", "Java Version=8"))
// Relationship dataReplicationRelationship = primaryDatabaseServer.Uses(secondaryDatabaseServer, "Replicates data to", "");
98
+
// secondaryDatabase.AddTags("Failover");
99
+
100
+
// views/diagrams
101
+
EnterpriseContextViewenterpriseContextView=views.CreateEnterpriseContextView("EnterpriseContext","The system context diagram for the Internet Banking System.");
SystemContextViewsystemContextView=views.CreateSystemContextView(internetBankingSystem,"SystemContext","The system context diagram for the Internet Banking System.");
dynamicView.Add(securityComponent,"select * from users u where username = ?",database);
129
+
dynamicView.PaperSize=PaperSize.A5_Landscape;
130
+
131
+
// todo
132
+
// DeploymentView developmentDeploymentView = views.CreateDeploymentView(internetBankingSystem, "DevelopmentDeployment", "An example development deployment scenario for the Internet Banking System.");
// DeploymentView liveDeploymentView = views.CreateDeploymentView(internetBankingSystem, "LiveDeployment", "An example live deployment scenario for the Internet Banking System.");
/// A simple example of what a microservices architecture might look like. This workspace also
8
+
/// includes a dynamic view that demonstrates parallel sequences of events.
9
+
///
10
+
/// The live version of the diagrams can be found at https://structurizr.com/public/4241
11
+
/// </summary>
12
+
publicclassMicroservicesExample
13
+
{
14
+
15
+
privateconstlongWorkspaceId=4241;
16
+
privateconststringApiKey="key";
17
+
privateconststringApiSecret="secret";
18
+
19
+
privateconststringMicroserviceTag="Microservice";
20
+
privateconststringMessageBusTag="Message Bus";
21
+
privateconststringDataStoreTag="Database";
22
+
23
+
staticvoidMain()
24
+
{
25
+
Workspaceworkspace=newWorkspace("Microservices example","An example of a microservices architecture, which includes asynchronous and parallel behaviour.");
26
+
Modelmodel=workspace.Model;
27
+
28
+
SoftwareSystemmySoftwareSystem=model.AddSoftwareSystem("Customer Information System","Stores information ");
ContainerreportingService=mySoftwareSystem.AddContainer("Reporting Service","Creates normalised data for reporting purposes.","Ruby");
38
+
reportingService.AddTags(MicroserviceTag);
39
+
ContainerreportingDatabase=mySoftwareSystem.AddContainer("Reporting Database","Stores a normalised version of all business data for ad hoc reporting purposes.","MySQL");
DynamicViewdynamicView=views.CreateDynamicView(mySoftwareSystem,"CustomerUpdateEvent","This diagram shows what happens when a customer updates their details.");
0 commit comments