...
This guideline is an instance of 181. SEC51-JG17. Minimize privileged code.
...
This code could be used by a client safely, as in:
Code Block | ||
---|---|---|
| ||
public static void main(String[] args) { int uid = Integer.parseInt(args[0]); UserLookupCallBack callBack = new UserLookupCallBack(uid); CallBackAction action = new CallBackAction(callBack); // ... action.perform(); // Looks up user name System.out.println("User " + uid + " is named " + callBack.getName()); } |
...