Create a Pattern

To create a pattern you first must model the pattern as a standard UML Diagram within EA. The following diagram was created from an example in the GoF book Design Patterns - Elements of Reusable Object-Oriented Software by Gamma et al.

Pattern Diagram

Save a Diagram as a Pattern
To save a diagram as a pattern, follow the steps below:

  1. Select the Diagram | Save as Pattern menu option. The Save Diagram as Pattern dialog displays.
    Save Diagram as Pattern
  2. In the Pattern Name field, type the pattern name.
  3. In the Filename field, type a .XML filename into which to save the pattern.
  4. In the Category field, type the Category under which the pattern should be listed in Patterns (required).
  5. In the Version field, type the pattern version number, and in the Notes field type any notes on the pattern.
  6. Select the actions for the elements that are contained in the pattern by selecting the appropriate checkboxes. These actions are performed when the pattern is used (for more detail see the Use a Pattern topic). The available actions are:

    • Create: Creates the pattern element directly without modification
    • Merge: Merges the pattern element with an existing element, enabling the existing element to take on the role of the selected pattern element
    • Instance: Creates the pattern element as an instance of an existing element. (this option is available if the pattern element supports this action)
    • Type: Creates the pattern element types as an existing element (this option is available if the pattern element supports this action).

  7. To change the name of one of the elements, double-click on the element to display the Edit dialog. From this dialog you can also add comments detailing the element's purpose.
  8. Click on the OK button to save the pattern. Once saved you can load it into EA as a pattern in the Resources window.