The problem
Any ClearQuest hook programmer encounters limitations that reduce drastically her productivity, her motivation and the global quality of the resulting code.
- the use of the very poor hook editor of the ClearQuest Designer
- the obligation, at each change even the smallest one (typo fix, hard value change, choice list query change, etc), to checkout/edit/checkin the schema and to upgrade all associated user databases
- the inability to reuse hook code in external scripts, except by copy/paste
- the inability to use a configuration management tool that would at least allow her viewing the differences between two revisions of hooks
The solution (PeHeX)
The solution exists, it is simple, it consists in externalising hooks: the schema itself contains the minimum of code, the rest is located in external files.
- an environment variable defines the hooks location
- Any hook in the schema is reduced to a single external procedure call
- a global hook does a use or require (Perl only) of external files to make procedures they contain available during the whole ClearQuest session.
Benefits
There are a lot of benefits:
- ability to use the text editor of your choice, preferably with syntax colouring, on the machine of your choice
- ability to use the Perl interpreter with the warning flag, in compilation only mode
- ability to change the hooks (then the schema behaviour) without changing the schema itself
- ability to reuse hooks in external scripts
- ability to use the configuration management tool of your choice
- the cycle edit/test is faster as it is no more required to relaunch ClearQuest after a hook changed
In short: productivity, quality, evolutivity drastically improved.
Penalties
They may arise with a lack of organisation and/or rigor:
- obligation to maintain the consistency between scripts and schema revisions
- obligation to maintain the availability of the external hooks on each client (a single network share is highly recommended)
- obligation to maintain the existence and the consistency of the environment variable localising the hooks.
Please note that the two last penalties do not exist in a WEB context: only the server needs the hooks.