Code Blocks

In a pattern implementation, entire code sections can be marked as code blocks (context menu /Mark Code Block); through them, dependencies of static code sections to slots are defined. There are optional code blocks and repeatable code blocks.

Optional Code Blocks

An optional code block is only expanded if all slots contained within it are filled with values.
In our example, we want to be able to pre-define the possibility of deriving further classes from the Singleton class through a parameter. This parameter controls two optional code blocks, which cover the "protected" attribute and the "virtual" attribute in the source.

Repeatable Blocks

A repeatable block is a code block of the “repeatable” type; its central property is that it may occur several times one after another in the expanded code. A repeatable block also has all the properties of an optional code block.