检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:朱仙芝[1]
出 处:《现代电子技术》2013年第17期159-162,共4页Modern Electronics Technique
摘 要:按照GoF的"为变化进行设计"的原则,以匹配度算法的选择问题为实例,将泛型编程技术应用于策略模式设计中。首先通过对低层设计的重构,从诸多匹配度算法中抽取共有的部分,将其泛化为简单的函数对象,并用这些函数对象作为策略模式中的具体策略;再利用泛型技术构建抽象策略和上下文引用关系。这样的设计很好地解决了策略模式设计中的代码重用和泛化问题。According to the rule of "designing for change" proposed by GoF, the generic programming technique is used in strategy pattern design by taking the choice problem of matching arithmetic for example. Through refactoring the low-level de-sign, the mutual contents are extracted from a lot of matching algorithms to create the simple function-objects which is used as the concrete strategy. Then the generic technology is used to construct the abstract strategy and the reference relationship in con-text. The design has primely solved the problems of code reuse and generalization problem.
分 类 号:TN711-34[电子电信—电路与系统]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.38