2019年1月21日

设计模式-状态模式

摘要: 什么时候使用状态模式 通过前面的阐述,我们基本上了解了状态模式的样子。那我们什么时候使用状态模式呢?来看看Martin Fowler的这个重构:Replace Type Code with State/Stategy 你有一个type code,它会影响class的行为,但你无法使用subclass 阅读全文

posted @ 2019-01-21 22:18 手握太阳 阅读(182) 评论(0) 推荐(0) 编辑

导航