摘要: /** * * Visitor Pattern 访问者是一种行为设计模式, 允许你在不修改已有代码的情况下向已有类层次结构中增加新的行为。 * file: Visitorts.ts * The Component interface declares an `accept` method that 阅读全文
posted @ 2023-10-13 18:12 ®Geovin Du Dream Park™ 阅读(5) 评论(0) 推荐(0) 编辑
摘要: /** * Strategy Pattern 策略是一种行为设计模式, 它将一组行为转换为对象, 并使其在原始上下文对象内部能够相互替换。 * * file: Strategyts.ts * The Context defines the interface of interest to clien 阅读全文
posted @ 2023-10-13 18:11 ®Geovin Du Dream Park™ 阅读(4) 评论(0) 推荐(0) 编辑