Grouping Operations (Magic xpa 3.x)
When you do have an event handler that is mixed, it's best to group the server and client operations as much as possible, to minimize network traffic. Here we have a series where the Rich Client module will:
0. Start out on the client (where the session is executing when the event is raised).
1. Update variable with a CallDLL: on the server.
2. Verify warning: back on the client.
3. Call program: on the server.
4. Display the program: back on the client.
This is four trips back and forth.
By slightly changing the code, we change this to 2 trips:
0. Start out on the client, as before. Stay on the client to execute the Verify.
1. Go to the server for the CallDLL. Stay on the server to fetch the program.
2. Come back to the client to display the program.
Of course, how much optimization you can do depends on the logic of the program.