![]()
We started by doing only code generation of the simple patterns required by the OTM frameworks we were using. This alone gave us a big advantage and eliminated a considerable amount of the risk associated with human coding of redundant patterns (humans get bored and they make mistakes). As we moved further into design, we realized that code generation could handle almost all of our data access delegations. So far, the generation was mostly brute force and did not yet employ templates. As more patterns surfaced, it was realized that generation could also handle creational patterns, navigation, derivation, etc. A more generalized approach was needed. Parameterized templates became an obvious choice. The templates were kept external from the code generator program so they could be added or changed without requiring a retest of the generator. This also allowed developers to define new templates as patterns were identified. Templates were allowed to call other templates, handling patterns within patterns.