Class Slice

  • All Implemented Interfaces:
    HasDescription, CanOverrideDescription<Slice>, java.lang.Iterable<JavaClass>, java.util.Collection<JavaClass>, java.util.Set<JavaClass>

    public final class Slice
    extends ForwardingSet<JavaClass>
    implements HasDescription, CanOverrideDescription<Slice>
    A collection of JavaClasses modelling some domain aspect of a code basis. This is conceptually a cut through a code base according to business logic. Take for example
    The top level packages under 'myapp' could be considered slices according to different domain aspects.
    Thus there could be a slice 'Order' housing all the classes from the order package, a slice 'Customer' housing all the classes from the customer package and so on.
    • Method Detail

      • as

        public Slice as​(java.lang.String pattern)
        The pattern can be a description with references to the matching groups by '$' and position. E.g. slices are created by 'some.svc.(*).sub.(*)', and the pattern is "the module $2 of service $1", and we match '', then the resulting description will be "the module bar of service foo".
        Specified by:
        as in interface CanOverrideDescription<Slice>
        pattern - The description pattern with numbered references of the form $i
        Same slice with different description
      • getDependenciesFromSelf

        public java.util.Set<Dependency> getDependenciesFromSelf()
        All dependencies that originate from a class within this Slice and target a class outside of this Slice
      • getDependenciesToSelf

        public java.util.Set<Dependency> getDependenciesToSelf()
        All dependencies that originate from outside of this Slice and target a class within this Slice
      • getNamePart

        public java.lang.String getNamePart​(int index)
        Returns a matching part of this slice. E.g. if the slice was created by matching '..(*).controller.(*)..', against '', then name part '1' would be 'other' and name part '2' would be 'here'.
        index - The index of the matched group
        The part of the matched package name.