The functionality weaver offers a lot of benefits for writing and maintaining code:
- Offering dynamic weaving.
- Code history.
- Code review and managing who wrote which code.
- Validation while executing the query on the database.
- Changing code without syncing to IAM.
These benefits do not apply for expression fields. Expression fields are widely used but the support for maintaining them is very limited.
My idea for expression fields 2.0 is as follows:
- New codegroup and program object type: EXPRESSIONS.
- New type of program object: EXPRESSION. Naming: exp_<table_name)_<col_name>.
- For every program object of type EXPRESSION a function is generated.
- PK colums are given as parameters to this function.
- Templates are used with these parameters to return a value.
- The GUI executes the function instead of the expression query specified on the column.
- The expression field query on table “col” is no longer needed and can be discarded since calculated_field_type = expression generates a program object.
Let me know what you guys think.