What are Designers?
Designers are visual interfaces that allow users to:- Create and organize elements
- Define relationships between elements
- Configure element properties using stereotypes
- Model domain-specific concepts
- Provide metadata for code generation
Designer Files
A designer consists of two main files:- .designer.config
- .designer.settings
Defines the designer structure:
Module Builder.designer.config
Creating a Custom Designer
- Name: Your designer name (e.g.,
My Custom Designer) - ID: Unique identifier (auto-generated)
<elementSetting type="Entity" typeId="entity-element">
<icon type="UrlImagePath" source="data:image/svg+xml;base64,..."/>
<saveMode>OwnFile</saveMode>
<allowRename>true</allowRename>
<allowAbstract>true</allowAbstract>
<allowGenericTypes>false</allowGenericTypes>
<creationOptions>
<option order="0" type="element" typeId="entity-element">
<text>New Entity</text>
<shortcut>ctrl + shift + e</shortcut>
<defaultName>NewEntity</defaultName>
</option>
</creationOptions>
<childElementSettings>
<childElementSetting typeId="attribute-element">
<text>Attribute</text>
<allowMultiple>true</allowMultiple>
<autoSelectOnCreate>true</autoSelectOnCreate>
<creationOptions>
<option order="0" type="element" typeId="attribute-element">
<text>Add Attribute</text>
<shortcut>ctrl + shift + a</shortcut>
</option>
</creationOptions>
</childElementSetting>
</childElementSettings>
</elementSetting>
<associationSetting type="Association" typeId="association-type">
<icon type="UrlImagePath" source="data:image/svg+xml;base64,..."/>
<defaultDisplayText>${Name}: ${TargetElement.Name}</defaultDisplayText>
<sourceEnd>
<allowMultiple>true</allowMultiple>
<typeReferenceSetting>
<isRequired>false</isRequired>
<targetTypes>
<type>entity-element</type>
</targetTypes>
</typeReferenceSetting>
</sourceEnd>
<targetEnd>
<allowMultiple>true</allowMultiple>
<navigable>true</navigable>
<typeReferenceSetting>
<isRequired>true</isRequired>
<targetTypes>
<type>entity-element</type>
<type>value-object-element</type>
</targetTypes>
</typeReferenceSetting>
</targetEnd>
<creationOptions>
<option order="0" type="association" typeId="association-type">
<text>Add Association</text>
<shortcut>ctrl + shift + r</shortcut>
</option>
</creationOptions>
</associationSetting>
<stereotypeSetting name="Primary Key" typeId="primary-key-stereotype">
<applicableToType>attribute-element</applicableToType>
<properties>
<property name="Auto-generate" type="bool" defaultValue="true">
<display>Auto Generate</display>
<hint>Whether to automatically generate the key value</hint>
</property>
<property name="Generator" type="select" defaultValue="identity">
<options>
<option>identity</option>
<option>sequence</option>
<option>guid</option>
</options>
</property>
</properties>
</stereotypeSetting>
<elementSetting type="Entity" typeId="entity-element">
<visualSettings>
<elementVisualSettings>
<defaultSize width="200" height="100"/>
<minimumSize width="150" height="80"/>
<fillColor>#E8F5E9</fillColor>
<fontColor>#000000</fontColor>
<border width="2" color="#4CAF50"/>
</elementVisualSettings>
</visualSettings>
</elementSetting>
Element Configuration
Save Modes
Control how elements are persisted:Element Properties
Child Elements
Define parent-child relationships:Stereotype Configuration
Property Types
- String
- Bool
- Select
- Number
Stereotype Applicability
Association Configuration
Basic Association
Bidirectional Association
Visual Customization
Element Appearance
Association Appearance
Icons
Add custom icons:Context Menus and Shortcuts
Creation Options
Custom Menu Items
Designer Scripts
Add custom scripting behavior:Mapping Configuration
Enable mapping between designers:Package References
Include metadata from other modules:Best Practices
Consistent Naming
- Use descriptive element type names
- Follow consistent naming patterns
- Use proper capitalization
- Avoid technical jargon where possible
Clear Icons
- Use recognizable, distinct icons
- Maintain consistent icon style
- Ensure icons are visible at small sizes
- Use color meaningfully
Intuitive Shortcuts
Helpful Hints
Testing Designers
Troubleshooting
Designer not appearing
Designer not appearing
- Check designer is registered in
.imodspec - Verify designer files are included in module build
- Ensure
<designer>entry is correct - Check for XML syntax errors
Elements not creating
Elements not creating
- Verify
creationOptionsare defined - Check
typeIdmatches element definition - Ensure parent-child relationships allow creation
- Review Software Factory output for errors
Stereotypes not available
Stereotypes not available
- Check
applicableToTypematches element - Verify stereotype
typeIdis unique - Ensure stereotype is in correct
.designer.settingsfile - Check for duplicate stereotype definitions
Next Steps
Creating Modules
Complete module creation guide
Creating Templates
Generate code from designer metadata
Module Builder
Module Builder module reference
Testing Modules
Test your custom designers