State Pattern

The State Pattern allows an object to alter its behavior when its internal state changes. The object will appear to change its class.

  

  

原文地址:https://www.cnblogs.com/jasonC/p/3457334.html