Hello,
I want to run the same method on the client and server side. The reason is that the user can call that method when interacting with the UI, but the same method can also be called at a later time by a Task on the server side. I already wrote the method using the proxy object. I wanted to know if there is a way to call the same method on the server side (no proxy) without duplicating the code.
What is the best practice?
Example:
MyObject is a domain object in the server package
MyObjectProxy is the proxy for MyObject
The method that uses the proxies called on the client side.
public static int sum(MyObjectProxy proxy) {
return proxy.getA() + proxy.getB();
}
I want the same method but for the server side with the following signature:
public static int sum(MyObject domain) {
return domain.getA() + domain.getB();
}
Thanks