Remote calls (delegation of method calls via the network) load the network layer and may cause computing power on the server side. Methods that do not change the object state (change the property values of an instance) therefore do not necessarily have to be executed on the server side. Here, so-called client-side methods are used.
Use the attribute ACMethodClient class whenever:
- all data (object state) in the proxy component is available that is required for the method algorithm,
- if the method is called often and has only client-side relevance (e.g. for the GUI: calculation of a signal color, conversion of units...)
- database operations can or should be made on the client side.
Client-side methods with the attribute class ACMethodClient can only be static. Similar to the concept of .NET-Extension Methods, the algorithm of the static method must know the this pointer. Therefore, the signature of the method must always be structured in such a way that the first parameter is always an IACComponent acComponent:
[ACMethodClient ("ExGroup", "en{'Example clientside'}de{'Beispiel clientseitig'}", 202, false)]
public static Boolean MyClientsideMethod(IACComponent acComponent, string stringParam)
{... return false; }
When calling client-side methods using ACUrlCommand, the first parameter (this pointer) is automatically set by the iPlus framework and must therefore not be passed explicitly!
Parameters do not have to be serializable for client-side methods.
The "IsEnabled"-method must also be static and requires the IACComponent acComponent parameter:
public static bool IsEnabledMyClientsideMethod(IACComponent acComponent)
{... return true; }