Inserting code with micropatterns and snippets
The insertion of code in the COBOL code of the generated instances is made easy by the use of micropatterns or snippets.
There are two types of micropatterns:
- Some micropatterns are complex operators of specific code. They fetch information from the design or from the use context. You insert them in Macros or in the COBOL code of a Program, Screen, or Server. When the instance is generated again, they automatically produce the corresponding code lines. Each micropattern declaration is kept in the code as it was entered. You can then modify this declaration later and generate the instance again to take the modification into account.
- Other micropatterns are used to retrieve the Pacbase data. They are recognized upon generation to produce a code identical to the Pacbase code. You must not enter them in the code because they have a low added value. It is advised to enter the corresponding code lines instead.
Note: You can also create your own micropatterns by using the Rational® Programming Patterns Application
Programming Interface. For explanations, see User micropatterns.
Snippets offer a guided input to insert code. There are two types of snippets:
- Snippets that correspond to micropatterns. You use them to insert the code that corresponds to the declaration of the micropattern.
- Other snippets. You use them to insert processing loops or indices, for example.