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.
Save a Diagram as a Pattern
To save a diagram as a pattern, follow the steps below:
- Select the Diagram | Save as Pattern menu option. The Save Diagram as Pattern dialog displays.
- In the Pattern Name field, type the pattern name.
- In the Filename field, type a .XML filename into which to save the pattern.
- In the Category field, type the Category under which the pattern should be listed in Patterns (required).
- In the Version field, type the pattern version number, and in the Notes field type any notes on the pattern.
- 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).
- 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.
- Click on the OK button to save the pattern. Once saved you can load it into EA as a pattern in the Resources window.