Xiao Peng

My personal blog moves to xiaopeng.me , blogs about design patterns will be synced to here.
肖鹏,ThoughtWorks资深咨询师,目前关注于架构模式、敏捷软件开发等领域,并致力于软件开发最佳实践的推广和应用。
多次为国内大型企业敏捷组织转型提供咨询和培训服务,在大型团队持续集成方面具有丰富的经验。
随笔 - 268, 文章 - 0, 评论 - 602, 阅读 - 30万
  博客园  :: 首页  :: 联系 :: 订阅 订阅  :: 管理
< 2025年4月 >
30 31 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 1 2 3
4 5 6 7 8 9 10

开放性问题二(Strategy)

Posted on   勇敢的鸵鸟  阅读(539)  评论(0)    收藏  举报

Strategy
Part 1: What happens when a system has an explosion of Strategy objects? Is there some way to better manage these strategies? Part 2: In the implementation section of this pattern, the authors describe two ways in which a strategy can get the information it needs to do its job. One way describes how a strategy object could get passed a reference to the context object, thereby giving it access to context data. But is it possible that the data required by the strategy will not be available from the context's interface? How could you remedy this potential problem?
第一部分:Strategy对象爆炸会发生什么事情?有没有更好地管理这些strategies的办法?
第二部分:在该模式的实现部分,作者描述了一个strategy对象从context对象获得所需的信息来执行自己的行为的两个方法。一个方法是向strategy对象传入context对象的引用,从而使得strategy对象可以访问context对象的数据。但是有没有可能strategy对象要求的数据无法从context对象的接口中获得?你有没有补救这个潜在问题的办法?

编辑推荐:
· 记一次 .NET某云HIS系统 CPU爆高分析
· 如果单表数据量大,只能考虑分库分表吗?
· 一文彻底搞懂 MCP:AI 大模型的标准化工具箱
· 电商平台中订单未支付过期如何实现自动关单?
· 用 .NET NativeAOT 构建完全 distroless 的静态链接应用
阅读排行:
· 如果单表数据量大,只能考虑分库分表吗?
· 一款让 Everything 更加如虎添翼的 .NET 开源辅助工具!
· (原创)[开源][.Net Framework 4.5] SimpleMVVM(极简MVVM框架)更
· 冲压车间软件实施
· 干货分享!MCP 实现原理,小白也能看懂
点击右上角即可分享
微信分享提示