Rational Programming Patterns

Using the configuration area

A micropattern handler can use standard parameters (following the canonical form name=value) or specific input defined in a generic, free configuration area.

The micropattern engine does not manage this area. So its content might remain unchanged between two generations or regenerations of the source code.

Using the configuration area instead of named parameter is an architectural choice that must be carefully studied. If a parameter position is meaningful, it is a best practice to define a specific parameter using the configuration area.

For example, the following code
....|....1....|....2....|....3....|....4....|....5....|....6..
      *!INVERT / A B
is easier to understand than
....|....1....|....2....|....3....|....4....|....5....|....6..
      *!INVERT param1=A param2=B

The configuration area can be used to enter information in other languages. This information is then used by the micropattern handler to generate its code. You can, for example, create a handler that connects to a data source to initialize global variable. Using the configuration area perfectly fits this purpose.

You can, for example, write an SQL sentence in the configuration area to connect to a data source and get a result set used by the handler to generate a COBOL WORKING-STORAGE SECTION item. You can then write:
....|....1....|....2....|....3....|....4....|....5....|....6....
      *!INIT db=DB2001 user=admin password=(encrypted)AI6ehJK0n /
      * SELECT * FROM TBL_DATA WHERE RUBCOD=='NUCLI'

To use the configuration area, the handler calls the IMicroPattern#getConfigurationArea() method. Parsing this area is application-dependent.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)