Developing with Classes and Representations (Best Practices Guide)
Less than to read
Top five best practices for Classes and Representations:
- Respect label scoping: in class scripts use $EVENTS, $PROPERTIES, $METHODS, $OPERATIONS exactly as generated.
- Respect label scoping: in representation scripts use $EVENTS, $PROPERTIES, $METHODS exactly as generated.
- Use only the necessary variables declared for each label (do not reference variables not declared for that label).
- Add the EVENT_NOT_EXECUTED variable to the $EVENTS function in existing scripts.
- Add the PROPERTY_NOT_EXECUTED variable to the $PROPERTIES function in existing scripts.
In general:
- Follow only the information in this documentation — do not add or assume extra variables or central behaviour beyond what is described here.
- Remember to restrict cross-label variable usage to enforce clarity, and avoid fragile, implicit dependencies between labels.
- Follow the scoping practices above exactly. Keep scope as close as possible to the declaration of a variable.
- When in doubt, it is best to refactor so the logic executes where the required variables are declared, rather than relying on undeclared/implicit variables.