Question
· Oct 30

Running a routine by name in a non-conventional way?

So I know we can run routines using both XECUTE or @ 
However both of them run slower than just running the routine without it. (that is because as far as i understand, XECUTE command for example will re-compile before running?)

the question is: how can I run a routine by name - and keeping the performance as good as possible?

Product version: Caché 2018.1
Discussion (1)2
Log in or sign up to continue

1. create a wrapper class with classmethods mapping to your routine(s)

or better

2. convert your routines to classes

then use $CLASSMETHOD | Caché ObjectScript Reference | Caché & Ensemble 2018.1.4 – 2018.1.9
to call these dynamically.

This also addresses the issue that xecute is highly risky from a security point of view, it can easily be targeted with injection attacks.