I often use calls, and I was concerned about a question that annoys me:
Suppose that to run the foo () function, you first need to perform a couple of checks.
If you 1. Insert checks as part of the called:
class A implements Callable<Long> {
...
public Long call() {
check1();
check2();
return (run());
}
- OR, paste all this logic into another class (ALOGIC) and use Callable for shell only for shell?
class A implements Callable {
...
public Long call() {
ALogic aLogic = new ALogic();
return (aLogic.run());
}
What do you think pro and con are? What do you usually prefer?
source
share