2008年9月10日state模式:Java基础之state模式
state模式: 允许一个对象在其状态改变时,改变它的行为。看起来对象似乎修改了它的类。 例子: view plaincopy to clipboardprint? public interface State { public void handle(Context ctx); } public class Context { private State _state; public Context(State state) { _state = state; } public void request() { if (_state != null) {...
[阅读全文] [PDF]
1 共1条 分1页