Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend user guide's domain model overview #1221

Merged
merged 5 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ asciidoctor {
asciidoctorj {
modules {
diagram.use()
diagram.version '2.2.4'
diagram.version '2.2.14' // https://github.com/asciidoctor/asciidoctorj-diagram/releases/
}
}
}
Expand All @@ -34,7 +34,7 @@ asciidoctor.doFirst {
}

asciidoctorj {
version = '2.3.0'
version = '2.5.11' // https://github.com/asciidoctor/asciidoctorj/releases
}

asciidoctor.dependsOn cleanUserGuide
Expand Down
43 changes: 34 additions & 9 deletions docs/userguide/004_What_to_Check.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The following section illustrates some typical checks you could do with ArchUnit

=== Package Dependency Checks

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

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

=== Class Dependency Checks

[plantuml, "class-naming-deps"]
[plantuml, "class-naming-deps", svg, opts=interactive]
----
@startuml
hide empty members
skinparam componentStyle uml2

skinparam component {
Expand All @@ -69,6 +71,7 @@ note top on link #crimson: forbidden

Bar --> FooBar #green
note left on link #green: allowed
@enduml
----

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

=== Class and Package Containment Checks

[plantuml, "class-package-contain"]
[plantuml, "class-package-contain", svg, opts=interactive]
----
@startuml
hide empty members
set separator none
skinparam componentStyle uml2

skinparam component {
Expand All @@ -103,6 +109,7 @@ package com.wrong {

note "resides in wrong package" as WrongPackage #crimson
FooController .. WrongPackage
@enduml
----

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

=== Inheritance Checks

[plantuml, "inheritance-naming-check"]
[plantuml, "inheritance-naming-check", svg, opts=interactive]
----
@startuml
hide empty members
skinparam componentStyle uml2

skinparam component {
Expand All @@ -137,6 +146,7 @@ FtpConnection --|> Connection #green
SshThing --|> Connection #crimson

note right on link #crimson: Has wrong name
@enduml
----

[source,java]
Expand All @@ -145,8 +155,11 @@ classes().that().implement(Connection.class)
.should().haveSimpleNameEndingWith("Connection")
----

[plantuml, "inheritance-access-check"]
[plantuml, "inheritance-access-check", svg, opts=interactive]
----
@startuml
hide empty members
set separator none
skinparam componentStyle uml2

skinparam component {
Expand All @@ -173,6 +186,7 @@ ValidPersistenceUser --> EntityManager #green
IllegalPersistenceUser --> EntityManager #crimson

note right on link #crimson: Accessor resides in wrong package
@enduml
----

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

=== Annotation Checks

[plantuml, "inheritance-annotation-check"]
[plantuml, "inheritance-annotation-check", svg, opts=interactive]
----
@startuml
hide empty members
skinparam componentStyle uml2

skinparam component {
Expand All @@ -206,6 +222,7 @@ ValidPersistenceUser --> EntityManager #green
IllegalPersistenceUser --> EntityManager #crimson

note right on link #crimson: Accessor is not annotated with @Transactional
@enduml
----

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

=== Layer Checks

[plantuml, "layer-check"]
[plantuml, "layer-check", svg, opts=interactive]
----
@startuml
hide empty members
set separator none
skinparam componentStyle uml2

skinparam component {
Expand Down Expand Up @@ -253,6 +273,7 @@ note right on link #crimson: Access goes against layers

SomePersistenceManager -up--> SomeServiceOne #crimson
note right on link #crimson: Access goes against layers
@enduml
----

[source,java]
Expand All @@ -270,8 +291,11 @@ layeredArchitecture()

=== Cycle Checks

[plantuml, "cycle-check"]
[plantuml, "cycle-check", svg, opts=interactive]
----
@startuml
hide empty members
set separator none
skinparam componentStyle uml2

skinparam component {
Expand Down Expand Up @@ -301,6 +325,7 @@ ClassOneInModuleOne --> ClassTwoInModuleTwo #crimson
ClassOneInModuleTwo --> ClassOneInModuleThree #crimson
ClassTwoInModuleThree --> ClassOneInModuleOne #crimson
note right on link #crimson: Combination of accesses forms cycle
@enduml
----

[source,java]
Expand Down
Loading