Thursday, January 21, 2010
This method allows to determine if the code is being executed on server (or client). It can be useful if there is a class which is explicitly designed to be executed on "called from" tier but which has a method that performs a lot of database calls. Execution of the "heavy" method on the object which resides on the client can result in a large numer of RPC calls which seriously reduces performance. To avoid that, object on the client can be serialized, instantiated on the server, deserialized and then execution of the desired method can be performed. To determine whether object is on the client (or server) just call Global::isRunningOnServer() method.