A Domain within a Project is a template that contains specified Attributes, Generators, and Parent/Child/Sibling Relationships. When a Scenario is created, it is a copy of the Template Domain with the same Attributes, Generators, and Relationships. 

GenRocket Domains control their own referential integrity via parent, child, and sibling relationships irrespective of the data model. When a change is made to the Template Domain or the Domain relationship, GenRocket will automatically refactor all the Scenarios associated to the Domain. 

This is referred to as Domain Auto-Refactoring, which is the process of restructuring the existing Scenarios to match the re-defined Domain Relationships.

What is a Template Domain?

  • A preset (i.e. template) consisting of Attributes, Generators, Parameter Configurations, and Parent/Child/Sibling Relationships within a Test Data Project.

What is a Scenario Domain? 

  • A copy of the Template Domain. A Scenario Domain can be modified without impacting the Template Domain configuration.

In This Article

What is G-Refactor?

G-Refactor is the GenRocket tool that performs auto-refactoring for all Domains, Attributes and impacted Scenarios when changes are made to the Template Domain or Domain Relationships.

This GenRocket feature is very helpful to users who are creating and changing their database models, as it does not require the user to perform an extensive amount of steps to accommodate the change. When the change is made, all impacted Scenarios are updated automatically.

How does G-Refactor work for Scenarios?

Any time a change is made to the Template Domain or the Domain Relationships, the change cascades down to all Scenarios where the Domain is used. 

Template Domain Changes

For example, if an Attribute is removed from the Template Domain, then GenRocket will traverse down all the Scenarios and remove the Attribute from them as well. A change can be any of the following: 

  • Removing an Attribute
  • Adding an Attribute
  • Modifying a Generator (Adding, Remove, Replacing, etc.)
  • Adding or Changing the Domain Relationship

Domain Relationship Changes

For Domain Relationship Changes, GenRocket will cascade down and apply the change to all Scenarios automatically. Based on the defined ancestry, regardless of how deep it goes, all of the Scenarios will be updated to reflect the change made at the Template Level. 

For example, let's say a Department Domain is the only root with a User Domain as a child. The Domain Relationship is changed by adding an Organization Domain above the Department Domain. When this change is made, GenRocket will do the following: 

  1. Cascade down and add the Organization to all Scenarios that use the Department Domain. 
  2. If a User Scenario is associated with the Department Scenario, the change will cascade down to it as well.

Alternatively, if a Parent Domain is removed, then GenRocket will traverse down and also remove the Parent Domain from all applicable Scenarios. 

Use Case Diagram 1: Add Root Parent

Use Case Diagram 2: Insert Parent

Use Case Diagram 3: Remove Root Parent

How to Lock a Scenario, Scenario Domain, or Attribute

Within a Scenario, a user has the ability to lock a Scenario, Scenario Domain, or Attribute. When locked, G-Refactor will ignore the locked Scenario, Scenario Domain, or Attribute. This means that the item will not be refactored to reflect the change made to the Template Domain or the Domain Relationship change.

The Lock Icon can be used to lock a Scenario Domain or Attribute. 

A user can also click on the Lock Button to lock a Scenario. 

At any time, the Scenario, Scenario Domain, or Attribute can be unlocked and resynced to reflect what has been configured above it at the Template Level.  This is accomplished by unlocking the item and then clicking on the Sync button.

Note: For more information about GenRocket Domains and knowing the Database Schema, please click here.