Created
February 24, 2020 09:41
-
-
Save testanull/3d1db2f0a01bd0dc08bd1233441890cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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