Continuing from Best Practices for building RPE Template – Part 1
Template creation guidelines
- Debug statements Have debug statements within the template at different stages using _sessionLogger default internal variable. Control printing of debug statements using your own internal RPE variable (say _debugEnabled).
- Template comment: Add template comment element at different stages within the template explaining what the current section is used for. This would act as self documenting the template.
- Template element: Provide name and descriptions to template elements. This helps understanding the purpose of the element template when you or others read the template after some time.
- Naming convention: Follow standard naming convention for variables and data sources as they would be self explanatory in most of the cases. Additionally, provide description for each data source and variable to provide more details on what it is being used for.
- Dynamic Data Source Configuration (DSC) element
- In most of the scenarios, the DSC element connection details are inherited from it’s parent. In such cases, inherit data configuration from parent data source instead of configuring it again.
- Hide data sources that are being configured by parent data source by setting “Configuration required” property value to “hidden”
- Do not forget to run your template after every logical point, while building the template, against the data source. You could run it in preview mode and fix any discrepancies then and there.
- Make versioned backups of your templates (MyTemplate-V01.dta, MyTemplate-V02.dta, MyTemplate-V03.dta). When you are happy with a template you can delete old versions.
I found more best practices on specific topics from earlier posts