您的位置:首页 > 大数据 > 人工智能

Core Design Patterns(16) Chain of Responsibility 职责链模式

2008-04-01 21:34 501 查看
VS 2008

多个对象构成一个链式结构,客户端向链中的某个对象发出请求,被请求的对象可以处理客户代码的请求,也可以根据业务将请求向下传递,依此类推,直到请求最终被某对象处理,或抛出异常。这就是职责链模式的应用场景。

1. 模式UML图



using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

SE.cs



using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

SSE.cs



using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

PL.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

PM.cs



using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

Client

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using DesignPattern.ChainOfResponsibility.BLL;

Output



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: