Class RefactoringHelper

java.lang.Object
org.contextmapper.dsl.refactoring.RefactoringHelper

public class RefactoringHelper extends Object
Some common logic that is used in multiple ARs to ensure model validity.
  • Constructor Details

  • Method Details

    • adjustAggregateAndModuleNames

      public void adjustAggregateAndModuleNames(BoundedContext bc, 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(List<SimpleDomainObject> domainObjects, 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 Set<String> collectAllAggregateNames()
      Collects all Aggregate names of the current model.
    • collectAggregates

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

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

      public String getUniqueName(String initialName, Set<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).