Design Patterns Sidebar
There are two ways how to show Design Patterns sidebar:
- Clicking on Design Patterns button ( ) in the sidebar.
- Using menu View / Sidebars / Design Patterns
Software Ideas Modeler allows you to use design patterns - you can insert generic pre-defined blocks of elements to your diagram. You can also create your own design patterns, which can be reused in other diagrams later.
The main part of Design Pattern sidebar is a list of all design patterns defined in the design pattern library in user profile. Above the list there is toolbar with these buttons:
- Apply - applies the selected design pattern.
- New Pattern - creates a new design pattern.
- Delete Pattern - deletes the selected design pattern.
If you want to apply a design pattern, open the diagram, where you want to insert elements of design pattern, choose the design pattern, you want to use and click on Apply button in toolbar above the list of design pattenrs. Apply Design Pattern dialog will show. It contains the table of design pattern roles. Role names are in the first column (1) and names of creating elements are in the second column (2). These names can be changed to your own ones. There are two buttons in the left bottom corner of the window - Add (3) and Remove (4). Add button allows you to add a new element in role, which supports multiple occurrence. Remove button allows you to remove the selected role element. Program checks the minimal number of elements in the role and if there cannot be less number of such elements, the selected element will be not deleted.
Elements of design patterns will be added to the active diagram after clicking OK button (7). If you click on Cancel button (8), dialog will be closed and nothing will happen.
Software Ideas Modeler allows you to define your own design patterns. In the diagram editor, select the elements which you want to create a design pattern from. Then click on New Pattern button. Role Assignment dialog will show.
Role Assignment dialog contains a grid with all sected elements. The first column (1) shows element names, the second column (2) shows element types and the last third column (3) allows you to specify role for each element. You can set the same role name to multiple elements in the grid. The elements for which you leave the Role field blank, will be present in the design pattern, but you will not be able to change their names and adds their new instances using Apply Design Pattern dialog.
Design pattern definition will continue after clicking on OK button, or can be cancelled using Cancel button. If you click on OK button, Design Pattern editor will show.
Design Pattern Editor window contains two tabs - General (1) and Elements (2). General tab includes fields, which describe the edited design pattern:
- Name (3) - defines the name of the edited design pattern.
- Description (4) - optionally you can describe the edited design pattern.
- Catalog (5) - optionally you can set the catalog of the edited design pattern.
Elements - the second tab of Design Pattern Editor contains the list of all elements/roles of edited design patterns (1). After selecting an element in the list, you can adjust its settings in the Settings group.
These settings are available:
- Default name (2) - specifies the name which will be defaultly set for the element in this role.
- Role (3) - the name of the edited role.
- Minimum (4) - minimal number of instances of this role.
- Maximum (5) - maximal number of instances of this role.
- Editable (6) - allows you to disable changes of element name in Apply Design Pattern dialog.
The design pattern will be created and saved to design pattern library after clicking OK button (7). If you click on Cancel button (8) the dialog will close and the edited design pattern will be discarded.
Delete button allows you to delete the design patterns you don't need. Select the design pattern (you want to delete) in the list of design patterns and click on Delete button. Message box will show, where you have to confirm the delete action with Yes button.