Java设计模式(17) -- 访问者
来源:互联网 发布:复旦大学软件学院学费 编辑:程序博客网 时间:2024/06/08 14:17
Intent
Visitor lets you define a new operation without changing theclasses of the elements on which it operates.
It would bebetter if each new operation could be added separately, and the classes were independent of the operations that apply to them.
Visitor makes adding new operations easy.
A visitor gathers related operations and separates unrelated ones.
How to
Visitor
declares a Visit operation for each class of ConcreteElement in the object structure.
ConcreteVisitor
implements each operation declared by Visitor.
Element
defines an Accept operation that takes a visitor as an argument.
ConcreteElement
implements an Accept operation that takes a visitor as an argument.
ObjectStructure
can enumerate its elements.
UML
Code
Konwn cases
(1)向已有的稳定的类结构添加新操作
(2)聚集一个功能的相关操作
- Java设计模式(17) -- 访问者
- java设计模式 访问者模式
- java设计模式-访问者模式
- JAVA设计模式---访问者模式
- java设计模式---访问者模式
- java设计模式---访问者模式
- 访问者模式-java设计模式
- Java设计模式---访问者模式
- Java设计模式--访问者模式
- Java设计模式--访问者模式
- java设计模式,访问者模式
- JAVA设计模式--访问者模式
- JAVA设计模式--访问者模式
- JAVA 设计模式 访问者模式
- Java 设计摸索--访问者模式
- Java 设计摸索--访问者模式
- 学习笔记——JAVA设计模式<17>访问者模式
- Java设计模式-----Visitor访问者模式
- 多线程
- [代码]如何在ASP.NET网页间传递数据
- 自尊与自强
- ext 导航树实现
- 今天正式啟動CSDN的帳號開始我的軟件學習之旅
- Java设计模式(17) -- 访问者
- How can I install Log::Log4perl on Microsoft Windows?
- Categories
- 转 对w3wp.exe的一点认识!
- NICE TO HAVE A WONDERFUL DAY
- asp.net httpModule
- 求助
- [代码]为ASP.NET网页编写嵌入式代码
- Python多线程编程