Slide 59
Slide 59 text
59
@Test
void DIP_依存性逆転の原則_を適用したレイヤードアーキテクチャ () {
layeredArchitecture()
.layer("ui").definedBy("com.example.presentation..")
.layer("app").definedBy("com.example.application..")
.layer("domain").definedBy("com.example.domain..")
.layer("infra").definedBy("com.example.infrastructure..")
.whereLayer("ui").mayOnlyBeAccessedByLayers("infra")
.whereLayer("app").mayOnlyBeAccessedByLayers("infra", "ui")
.whereLayer("domain").mayOnlyBeAccessedByLayers("infra", "app")
.whereLayer("infra").mayNotBeAccessedByAnyLayer()
.check(CLASSES);
}