Prev Next

Initial Code

The 'Code' tab is used to enter the code that is inserted into an operation Body when that operation is initially generated to file. After this point, the initial code is no longer referenced during forward code generation and synchronization. This code is most useful when combined with Design Patterns; elements within a Pattern often require the same stub code. The initial code is also useful for ensuring that the generated code can be directly compiled. The language-specific Patterns available from the web site resources include initial code for some of the defined operations; this helps speed up the process of applying Patterns from model to implementation.

By default, the initial code also is not imported into the model during reverse engineering, but you can select to import the code by ticking the 'Include method bodies in model when reverse engineering' checkbox on the 'Source Code Engineering > Attribute/Operations' page of the 'Preferences' dialog.

Access

Before displaying the Properties window, click on the required operation in the Project Browser or a diagram.

Ribbon

Start > Explore > Properties > Properties > Code

Design > Element > Properties > Properties > Code

Keyboard Shortcuts

Alt+1 > Code

Learn more