Class RefactoringHelper


  • public class RefactoringHelper
    extends java.lang.Object
    Some common logic that is used in multiple ARs to ensure model validity.
    • Method Detail

      • adjustAggregateAndModuleNames

        public void adjustAggregateAndModuleNames​(BoundedContext bc,
                                                  java.lang.String suffix)
        If we create a deep-copy of a Bounded Context, we have to rename all Aggregates, Modules, and domain objects. (to avoid validation errors regarding uniqueness)
      • adjustDomainObjectNames

        public void adjustDomainObjectNames​(java.util.List<SimpleDomainObject> domainObjects,
                                            java.lang.String suffix)
        If we create a deep-copy of a Bounded Context, we have to rename all domain objects. (to avoid validation errors regarding uniqueness)
      • collectAllAggregateNames

        public java.util.Set<java.lang.String> collectAllAggregateNames()
        Collects all Aggregate names of the current model.
      • collectAggregates

        public java.util.List<Aggregate> collectAggregates​(BoundedContext bc)
        Collects all Aggregates in the current CML model.
      • collectAllModuleNames

        public java.util.Set<java.lang.String> collectAllModuleNames()
        Collects all module names of the current CML model.
      • getUniqueName

        public java.lang.String getUniqueName​(java.lang.String initialName,
                                              java.util.Set<java.lang.String> givenNames)
        Creates a unique name using a counter. Given a set of already existing domain object names, this method searches for a name that is not already used (simple method with counter as suffix).