Skip to content

Instantly share code, notes, and snippets.

@testanull
Created February 24, 2020 09:41
Show Gist options
  • Save testanull/3d1db2f0a01bd0dc08bd1233441890cd to your computer and use it in GitHub Desktop.
Save testanull/3d1db2f0a01bd0dc08bd1233441890cd to your computer and use it in GitHub Desktop.
public interface HandlerInterface{
public void doSmt(...);
}
public class HandlerImpl implements HandlerInterface{
public void doSmt(args){
//real Method
sink();
}
}
public class HandlerUtil{
public static HandlerInterface getHandler() {
return _handler;
}
public void setHandler(
HandlerInterface handler) {
_handler = handler;
}
public static void doSmt(args){
getHandler().doSmt(args);
}
}
public class Foo{
public void processRequest(){
//...
args = request.get(...);
HandlerUtil.doSmt(args);
//...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment