一提到这个模式就会想到“击鼓传花”这个游戏。 这个模式的核心主要是Handler抽象类,几个设计要点: 1.它要保持对自身的一个引用,就是next字段以及相应属性 2.DoHandler()方法是一个递归遍历,直到处理完这个请求 传入的参数字符串s是等待处理的请求,当然,这个参数可以是任意类 3.HandlerRequest()方法要抽象出来, 传入的参数要与DoHandler... Read More
posted @ 2007-10-24 18:28 包建强 Views(752) Comments(1) Diggs(0) Edit
桥模式,将意图intension与实现implementor分离。其中,意图通常用接口来定义,而实现相应为Factory,返回具体的意图Implemention1。 public interface Intention { void Echo(string message); } public class Implemention1 : Int... Read More
posted @ 2007-10-24 12:14 包建强 Views(1354) Comments(1) Diggs(0) Edit