Skip to content

Commit aaddf56

Browse files
Removes support for deprecated enterprise and location concepts.
1 parent f33f7ed commit aaddf56

File tree

11 files changed

+3
-147
lines changed

11 files changed

+3
-147
lines changed

changelog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## v5.0.0 (unreleased)
44

5-
- structurizr-java: Fixes https://github.com/structurizr/java/issues/437 (Make ComponentFinder.run() not fail on empty Set<DiscoveredComponent>).
5+
- structurizr-core: Removes support for deprecated enterprise and location concepts.
6+
- structurizr-component: Fixes https://github.com/structurizr/java/issues/437 (Make ComponentFinder.run() not fail on empty Set<DiscoveredComponent>).
67
- structurizr-dsl: Adds support for `iconPosition` on element styles (options are `Top`, `Bottom`, `Left`).
78
- structurizr-dsl: Adds support for defining element and relationship styles for light and dark mode.
89
- structurizr-dsl: Adds a `Bucket` shape.
@@ -16,6 +17,7 @@
1617
- structurizr-dsl: PlantUML, Mermaid, and Kroki image views can now be defined by an inline source block.
1718
- structurizr-dsl: Constants and variables are inherited when extending a DSL workspace.
1819
- structurizr-dsl: DSL source is only stored in the JSON workspace when the DSL is deemed as "portable" (i.e. no files, plugins, scripts).
20+
- structurizr-export: Removes support for deprecated enterprise and location concepts.
1921
- structurizr-import: Adds support for `plantuml.inline`, `mermaid.inline`, and `kroki.inline` properties to inline the resulting PNG/SVG file into the workspace.
2022
- structurizr-inspection: Adds a way to disable inspections via a workspace property named `structurizr.inspection` (`false` to disable).
2123
- structurizr-inspection: Default inspector adds a summary of error/warning/info/ignore counts as workspace properties.

structurizr-client/src/integrationTest/java/com/structurizr/api/BackwardsCompatibilityTests.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,6 @@ void test() throws Exception {
2222
}
2323
}
2424

25-
@Test
26-
void enterprise_and_location() throws Exception {
27-
File file = new File(PATH_TO_WORKSPACE_FILES, "structurizr-36141-workspace.json");
28-
Workspace workspace = WorkspaceUtils.loadWorkspaceFromJson(file);
29-
30-
assertEquals("Big Bank plc", workspace.getModel().getEnterprise().getName());
31-
assertEquals(Location.Internal, workspace.getModel().getPersonWithName("Back Office Staff").getLocation());
32-
assertEquals(Location.External, workspace.getModel().getPersonWithName("Personal Banking Customer").getLocation());
33-
34-
// make sure enterprise and location information is not lost when going to/from JSON
35-
workspace = WorkspaceUtils.fromJson(WorkspaceUtils.toJson(workspace, false));
36-
37-
assertEquals("Big Bank plc", workspace.getModel().getEnterprise().getName());
38-
assertEquals(Location.Internal, workspace.getModel().getPersonWithName("Back Office Staff").getLocation());
39-
assertEquals(Location.External, workspace.getModel().getPersonWithName("Personal Banking Customer").getLocation());
40-
}
41-
4225
@Test
4326
void documentation() throws Exception {
4427
Workspace workspace = new Workspace("Name", "Description");

structurizr-core/src/main/java/com/structurizr/model/Model.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ public final class Model implements PropertyHolder {
2323
private final Set<Relationship> relationships = new TreeSet<>();
2424
private final Map<String, Relationship> relationshipsById = new HashMap<>();
2525

26-
private Enterprise enterprise;
27-
2826
private Set<Person> people = new TreeSet<>();
2927
private Set<SoftwareSystem> softwareSystems = new TreeSet<>();
3028
private Set<DeploymentNode> deploymentNodes = new TreeSet<>();
@@ -37,16 +35,6 @@ public final class Model implements PropertyHolder {
3735
Model() {
3836
}
3937

40-
@Deprecated
41-
public Enterprise getEnterprise() {
42-
return enterprise;
43-
}
44-
45-
@Deprecated
46-
void setEnterprise(Enterprise enterprise) {
47-
this.enterprise = enterprise;
48-
}
49-
5038
/**
5139
* Creates a software system (with an unspecified location) and adds it to the model.
5240
*

structurizr-core/src/main/java/com/structurizr/model/Person.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
*/
1313
public final class Person extends StaticStructureElement {
1414

15-
private Location location = Location.Unspecified;
16-
1715
@Override
1816
@JsonIgnore
1917
public Element getParent() {
@@ -23,20 +21,6 @@ public Element getParent() {
2321
Person() {
2422
}
2523

26-
@Deprecated
27-
public Location getLocation() {
28-
return location;
29-
}
30-
31-
@Deprecated
32-
void setLocation(Location location) {
33-
if (location != null) {
34-
this.location = location;
35-
} else {
36-
this.location = Location.Unspecified;
37-
}
38-
}
39-
4024
@Override
4125
public String getCanonicalName() {
4226
return new CanonicalNameGenerator().generate(this);

structurizr-core/src/main/java/com/structurizr/model/SoftwareSystem.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
*/
1717
public final class SoftwareSystem extends StaticStructureElement implements Documentable {
1818

19-
private Location location = Location.Unspecified;
20-
2119
private Set<Container> containers = new TreeSet<>();
2220

2321
private Documentation documentation = new Documentation();
@@ -36,25 +34,6 @@ public Element getParent() {
3634
SoftwareSystem() {
3735
}
3836

39-
@Deprecated
40-
public Location getLocation() {
41-
return location;
42-
}
43-
44-
/**
45-
* Sets the location of this software system.
46-
*
47-
* @param location a Location instance
48-
*/
49-
@Deprecated
50-
void setLocation(Location location) {
51-
if (location != null) {
52-
this.location = location;
53-
} else {
54-
this.location = Location.Unspecified;
55-
}
56-
}
57-
5837
void add(Container container) {
5938
containers.add(container);
6039
}

structurizr-export/src/main/java/com/structurizr/export/AbstractDiagramExporter.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,6 @@ protected void writeRelationships(ModelView view, IndentingWriter writer) {
602602
protected abstract void writeHeader(ModelView view, IndentingWriter writer);
603603
protected abstract void writeFooter(ModelView view, IndentingWriter writer);
604604

605-
protected abstract void startEnterpriseBoundary(ModelView view, String enterpriseName, IndentingWriter writer);
606-
protected abstract void endEnterpriseBoundary(ModelView view, IndentingWriter writer);
607-
608605
protected abstract void startGroupBoundary(ModelView view, String group, IndentingWriter writer);
609606
protected abstract void endGroupBoundary(ModelView view, IndentingWriter writer);
610607

structurizr-export/src/main/java/com/structurizr/export/dot/DOTExporter.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,6 @@ protected void writeFooter(ModelView view, IndentingWriter writer) {
7878
writer.writeLine("}");
7979
}
8080

81-
@Override
82-
protected void startEnterpriseBoundary(ModelView view, String enterpriseName, IndentingWriter writer) {
83-
writer.writeLine("subgraph cluster_enterprise {");
84-
85-
writer.indent();
86-
writer.writeLine("margin=" + clusterInternalMargin);
87-
writer.writeLine(String.format("label=<<font point-size=\"24\"><br />%s</font><br /><font point-size=\"19\">[Enterprise]</font>>", enterpriseName));
88-
writer.writeLine("labelloc=b");
89-
writer.writeLine("color=\"#444444\"");
90-
writer.writeLine("fontcolor=\"#444444\"");
91-
writer.writeLine("fillcolor=\"#ffffff\"");
92-
writer.writeLine();
93-
}
94-
95-
@Override
96-
protected void endEnterpriseBoundary(ModelView view, IndentingWriter writer) {
97-
writer.outdent();
98-
writer.writeLine("}");
99-
writer.writeLine();
100-
}
101-
10281
@Override
10382
protected void startGroupBoundary(ModelView view, String group, IndentingWriter writer) {
10483
String color = "#cccccc";

structurizr-export/src/main/java/com/structurizr/export/mermaid/MermaidDiagramExporter.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,6 @@ protected void writeFooter(ModelView view, IndentingWriter writer) {
7878
writer.outdent();
7979
}
8080

81-
@Override
82-
protected void startEnterpriseBoundary(ModelView view, String enterpriseName, IndentingWriter writer) {
83-
writer.writeLine("subgraph enterprise [\"" + enterpriseName + "\"]");
84-
writer.indent();
85-
writer.writeLine("style enterprise fill:#ffffff,stroke:#444444,color:#444444");
86-
writer.writeLine();
87-
}
88-
89-
@Override
90-
protected void endEnterpriseBoundary(ModelView view, IndentingWriter writer) {
91-
writer.outdent();
92-
writer.writeLine("end");
93-
writer.writeLine();
94-
}
95-
9681
@Override
9782
protected void startGroupBoundary(ModelView view, String group, IndentingWriter writer) {
9883
groupId++;

structurizr-export/src/main/java/com/structurizr/export/plantuml/C4PlantUMLExporter.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -270,19 +270,6 @@ protected void writeFooter(ModelView view, IndentingWriter writer) {
270270
super.writeFooter(view, writer);
271271
}
272272

273-
@Override
274-
protected void startEnterpriseBoundary(ModelView view, String enterpriseName, IndentingWriter writer) {
275-
writer.writeLine(String.format("Enterprise_Boundary(enterprise, \"%s\") {", enterpriseName));
276-
writer.indent();
277-
}
278-
279-
@Override
280-
protected void endEnterpriseBoundary(ModelView view, IndentingWriter writer) {
281-
writer.outdent();
282-
writer.writeLine("}");
283-
writer.writeLine();
284-
}
285-
286273
@Override
287274
protected void startGroupBoundary(ModelView view, String group, IndentingWriter writer) {
288275
groupId++;

structurizr-export/src/main/java/com/structurizr/export/plantuml/StructurizrPlantUMLExporter.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -146,26 +146,6 @@ protected void writeHeader(ModelView view, IndentingWriter writer) {
146146
writer.writeLine();
147147
}
148148

149-
@Override
150-
protected void startEnterpriseBoundary(ModelView view, String enterpriseName, IndentingWriter writer) {
151-
if (!renderAsSequenceDiagram(view)) {
152-
writer.writeLine(String.format("rectangle \"%s\" <<enterprise>> {", enterpriseName));
153-
writer.indent();
154-
writer.writeLine("skinparam RectangleBorderColor<<enterprise>> #444444");
155-
writer.writeLine("skinparam RectangleFontColor<<enterprise>> #444444");
156-
writer.writeLine();
157-
}
158-
}
159-
160-
@Override
161-
protected void endEnterpriseBoundary(ModelView view, IndentingWriter writer) {
162-
if (!renderAsSequenceDiagram(view)) {
163-
writer.outdent();
164-
writer.writeLine("}");
165-
writer.writeLine();
166-
}
167-
}
168-
169149
@Override
170150
protected void startGroupBoundary(ModelView view, String group, IndentingWriter writer) {
171151
groupId++;

0 commit comments

Comments
 (0)