摘要: /** * Template Method pattern 模版方法是一种行为设计模式, 它在基类中定义了一个算法的框架, 允许子类在不修改结构的情况下重写算法的特定步骤。 * file: Templatets.ts * The Abstract Class defines a template m 阅读全文
posted @ 2023-10-11 18:18 ®Geovin Du Dream Park™ 阅读(22) 评论(0) 推荐(0)
摘要: /** * State Pattern 状态是一种行为设计模式, 让你能在一个对象的内部状态变化时改变其行为。 * The Context defines the interface of interest to clients. It also maintains a * reference to 阅读全文
posted @ 2023-10-11 18:11 ®Geovin Du Dream Park™ 阅读(15) 评论(0) 推荐(0)
摘要: /** * Memento Pattern 备忘录是一种行为设计模式, 允许生成对象状态的快照并在以后将其还原。 * The Originator holds some important state that may change over time. It also * defines a me 阅读全文
posted @ 2023-10-11 18:02 ®Geovin Du Dream Park™ 阅读(21) 评论(0) 推荐(0)
摘要: /** * Iterator Pattern 迭代器是一种行为设计模式, 让你能在不暴露复杂数据结构内部细节的情况下遍历其中所有的元素 * file: Iteratorts.ts npm install -g babel-cli * Intent: Lets you traverse element 阅读全文
posted @ 2023-10-11 18:01 ®Geovin Du Dream Park™ 阅读(17) 评论(0) 推荐(0)
摘要: /** * Chain of Responsibility Pattern 责任链是一种行为设计模式, 允许你将请求沿着处理者链进行发送, 直至其中一个处理者对其进行处理。 * file: Chaints.ts * The Handler interface declares a method fo 阅读全文
posted @ 2023-10-11 08:52 ®Geovin Du Dream Park™ 阅读(30) 评论(0) 推荐(0)