Skip to content

Commit 6e20006

Browse files
authored
Extend user guide's domain model overview (#1221)
2 parents 6fda869 + fe1ef05 commit 6e20006

File tree

5 files changed

+157
-64
lines changed

5 files changed

+157
-64
lines changed

docs/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ asciidoctor {
2424
asciidoctorj {
2525
modules {
2626
diagram.use()
27-
diagram.version '2.2.4'
27+
diagram.version '2.2.14' // https://github.com/asciidoctor/asciidoctorj-diagram/releases/
2828
}
2929
}
3030
}
@@ -34,7 +34,7 @@ asciidoctor.doFirst {
3434
}
3535

3636
asciidoctorj {
37-
version = '2.3.0'
37+
version = '2.5.11' // https://github.com/asciidoctor/asciidoctorj/releases
3838
}
3939

4040
asciidoctor.dependsOn cleanUserGuide

docs/userguide/004_What_to_Check.adoc

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The following section illustrates some typical checks you could do with ArchUnit
44

55
=== Package Dependency Checks
66

7-
[plantuml, "package-deps-no-access"]
7+
[plantuml, "package-deps-no-access", svg, opts=interactive]
88
----
99
skinparam componentStyle uml2
1010
skinparam component {
@@ -23,7 +23,7 @@ noClasses().that().resideInAPackage("..source..")
2323
.should().dependOnClassesThat().resideInAPackage("..foo..")
2424
----
2525

26-
[plantuml, "package-deps-only-access"]
26+
[plantuml, "package-deps-only-access", svg, opts=interactive]
2727
----
2828
skinparam componentStyle uml2
2929
skinparam component {
@@ -47,8 +47,10 @@ classes().that().resideInAPackage("..foo..")
4747

4848
=== Class Dependency Checks
4949

50-
[plantuml, "class-naming-deps"]
50+
[plantuml, "class-naming-deps", svg, opts=interactive]
5151
----
52+
@startuml
53+
hide empty members
5254
skinparam componentStyle uml2
5355
5456
skinparam component {
@@ -69,6 +71,7 @@ note top on link #crimson: forbidden
6971
7072
Bar --> FooBar #green
7173
note left on link #green: allowed
74+
@enduml
7275
----
7376

7477
[source,java]
@@ -79,8 +82,11 @@ classes().that().haveNameMatching(".*Bar")
7982

8083
=== Class and Package Containment Checks
8184

82-
[plantuml, "class-package-contain"]
85+
[plantuml, "class-package-contain", svg, opts=interactive]
8386
----
87+
@startuml
88+
hide empty members
89+
set separator none
8490
skinparam componentStyle uml2
8591
8692
skinparam component {
@@ -103,6 +109,7 @@ package com.wrong {
103109
104110
note "resides in wrong package" as WrongPackage #crimson
105111
FooController .. WrongPackage
112+
@enduml
106113
----
107114

108115
[source,java]
@@ -113,8 +120,10 @@ classes().that().haveSimpleNameStartingWith("Foo")
113120

114121
=== Inheritance Checks
115122

116-
[plantuml, "inheritance-naming-check"]
123+
[plantuml, "inheritance-naming-check", svg, opts=interactive]
117124
----
125+
@startuml
126+
hide empty members
118127
skinparam componentStyle uml2
119128
120129
skinparam component {
@@ -137,6 +146,7 @@ FtpConnection --|> Connection #green
137146
SshThing --|> Connection #crimson
138147
139148
note right on link #crimson: Has wrong name
149+
@enduml
140150
----
141151

142152
[source,java]
@@ -145,8 +155,11 @@ classes().that().implement(Connection.class)
145155
.should().haveSimpleNameEndingWith("Connection")
146156
----
147157

148-
[plantuml, "inheritance-access-check"]
158+
[plantuml, "inheritance-access-check", svg, opts=interactive]
149159
----
160+
@startuml
161+
hide empty members
162+
set separator none
150163
skinparam componentStyle uml2
151164
152165
skinparam component {
@@ -173,6 +186,7 @@ ValidPersistenceUser --> EntityManager #green
173186
IllegalPersistenceUser --> EntityManager #crimson
174187
175188
note right on link #crimson: Accessor resides in wrong package
189+
@enduml
176190
----
177191

178192
[source,java]
@@ -183,8 +197,10 @@ classes().that().areAssignableTo(EntityManager.class)
183197

184198
=== Annotation Checks
185199

186-
[plantuml, "inheritance-annotation-check"]
200+
[plantuml, "inheritance-annotation-check", svg, opts=interactive]
187201
----
202+
@startuml
203+
hide empty members
188204
skinparam componentStyle uml2
189205
190206
skinparam component {
@@ -206,6 +222,7 @@ ValidPersistenceUser --> EntityManager #green
206222
IllegalPersistenceUser --> EntityManager #crimson
207223
208224
note right on link #crimson: Accessor is not annotated with @Transactional
225+
@enduml
209226
----
210227

211228
[source,java]
@@ -216,8 +233,11 @@ classes().that().areAssignableTo(EntityManager.class)
216233

217234
=== Layer Checks
218235

219-
[plantuml, "layer-check"]
236+
[plantuml, "layer-check", svg, opts=interactive]
220237
----
238+
@startuml
239+
hide empty members
240+
set separator none
221241
skinparam componentStyle uml2
222242
223243
skinparam component {
@@ -253,6 +273,7 @@ note right on link #crimson: Access goes against layers
253273
254274
SomePersistenceManager -up--> SomeServiceOne #crimson
255275
note right on link #crimson: Access goes against layers
276+
@enduml
256277
----
257278

258279
[source,java]
@@ -270,8 +291,11 @@ layeredArchitecture()
270291

271292
=== Cycle Checks
272293

273-
[plantuml, "cycle-check"]
294+
[plantuml, "cycle-check", svg, opts=interactive]
274295
----
296+
@startuml
297+
hide empty members
298+
set separator none
275299
skinparam componentStyle uml2
276300
277301
skinparam component {
@@ -301,6 +325,7 @@ ClassOneInModuleOne --> ClassTwoInModuleTwo #crimson
301325
ClassOneInModuleTwo --> ClassOneInModuleThree #crimson
302326
ClassTwoInModuleThree --> ClassOneInModuleOne #crimson
303327
note right on link #crimson: Combination of accesses forms cycle
328+
@enduml
304329
----
305330

306331
[source,java]

0 commit comments

Comments
 (0)