Class SlicesRuleDefinition

java.lang.Object
com.tngtech.archunit.library.dependencies.SlicesRuleDefinition

public final class SlicesRuleDefinition
extends java.lang.Object
Allows to specify ArchRules for "slices" of a code base. A slice is conceptually a cut through a code base according to business logic. Take for example

 com.mycompany.myapp.order
 com.mycompany.myapp.customer
 com.mycompany.myapp.user
 com.mycompany.myapp.authorization
 
The top level packages under 'myapp' are composed according to different domain aspects. It is good practice, to keep such packages free of cycles, which is one capability that this class provides.
Consider

 slices().matching("..myapp.(*)..").should().beFreeOfCycles()
 
Then this rule will assert, that the four slices of 'myapp' are free of cycles.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  SlicesRuleDefinition.Creator  
  • Method Summary

    Modifier and Type Method Description
    static SlicesRuleDefinition.Creator slices()
    Entry point into SlicesRuleDefinition

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait