Expressions (Magic xpa 4.x)
Expressions are built from one or more functions and variables. The side of the expression is determined by the side of the functions and variables.
Every expression can be categorized as being Client-side, Server-side, Neutral, or Mixed.
-
Client-side expressions can only execute on the client.
-
Server-side expressions can only execute on the server.
-
Neutral expressions, however, can execute in either place. They will execute on the server if the operation is being executed on the server; or on the client if the operation is being executed on the client.
-
Mixed expressions contain elements from the server and from the client.
It is important to know what kind of expression is being used. Expressions are used in many different places within a task. If the expression is a server-side expression, but is being used in a place that would require it to be evaluated on the client, the client has to stop and send a request back to the server before processing can continue. In some cases, the syntax-checker will disallow the process; in other cases, it is allowed, but it will be slow.
|
Every expression is marked as to where it will be executed:
-
S = Server-side
-
C = Client-side
-
M = Mixed
-
blank = Neutral
|
This is important to know, because the expression will be used in an operation, a property, or an Init value. You want to make sure that the side of the expression matches where it is used.
If a client-side function is mixed together with a server-side function within the same expression, this will cause a performance issue as the Rich Client module needs to go back and forth along the communication bus in order to evaluate that expression. To prevent this kind of performance issue, Magic xpa does not allow it and issues a Checker error message.