Class 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.