摘要
软件设计模式代表了从成功的系统设计中分离出来可复用的优秀设计经验,已成为现代软件系统设计的重要研究对象。在此介绍采用GOF的模板方法模式及采用回溯算法的模板方法模式的设计与实现。该实现使得回溯算法的实现达到了可扩展性、灵活性和可插入性三个目标,提高了算法的可维护性和可复用性。最后,演示如何使用该设计来解决N皇后问题、排列问题和子集和问题。
Software design pattern represents excellent design experience that can be reused abstracted from successful system designs. It has become an important study subject in modem software design. Template method pattern of GOF and the realization of template method pattern in back tracing algorithm are introduced. The implementation makes the algorithm achieve the goal of extensibility, flexibility and pluggability, promote maintainability and reuseability of the algorithm. At last,it demonstrates how to apply to problem of N_Queen,permutation and sum of subset.
出处
《现代电子技术》
2009年第20期123-125,共3页
Modern Electronics Technique
关键词
GOF设计模式
模板方法模式
设计模式
回溯算法
GOF design model
template method pattern
design pattern
back tracing algorithm