It would be nice if the JadeMetadataAnalyzer framework was called by the compiler in the main dev environment to enforce policies.
Different companies will have different coding standards and policies e.g. beginTransaction can only be called in methods on the TransactionAgent class (or only in the ModelSchema), or transient objects can only be created in a certain method (for transient leak detection) etc.
Using JadeMetadataAnalyzer they could add custom checks to the standard compiler to enforcing their policies. First of all the normal compiler checks would be performed, and if the method compiled successfully then it would be checked for policy conformance. If the method failed policy conformance, the message returned by the JadeMetadataAnalyzer framework would be displayed and the offending token highlighted as usual when compiling (and the method would be marked as not compiled so it cannot be executed until it conforms). If the method passed policy conformance, it would be marked as compiled and would be allowed to execute. This way there is no run-time overhead, only compile-time.
It is possible that it would only be necessary to do policy conformance checks when compiling in the development environment. If this is the case, then the addition of policy conformance checks would not affect schema load times on client sites.
If a policy changed, all methods in user schemas may need to be recompiled to ensure their conformance.
Users browsing this forum: No registered users and 3 guests