摘要:
Visitor: Problem Example: exporting the graph into XML format 示例:将图表导出为 XML 格式 Visitor: Solution Place the new behavior into a separate class called v 阅读全文
摘要:
State: Problem A finite number of states The program behaves differently within a state Can be switched from one state to another, and switching rules 阅读全文
摘要:
Memento: Problem Example: supporting undo in a text editor app Problem 1: private fields cannot be accessed Problem 2: when fields are made public, re 阅读全文