包含要素:
Vistor:抽象访问者,为每一个element元素声明一个方法
ConcreteVistor:具体访问者
Element:抽象元素
ConcreteElement:具体元素
ObjectStructure:对象结构
示例demo:比如在公司中,一般老板关心管理者的情况,管理者关系员工的工作情况。
![](https://img.haomeiwen.com/i4094034/6ff5cf3f82189b21.png)
![](https://img.haomeiwen.com/i4094034/ff6d5358a25c705d.png)
![](https://img.haomeiwen.com/i4094034/3a2fc6c45fb2fb64.png)
![](https://img.haomeiwen.com/i4094034/1c09e66cc8945de7.png)
![](https://img.haomeiwen.com/i4094034/74f3c045ea4dc3c7.png)
![](https://img.haomeiwen.com/i4094034/e339fa3ea0ab61af.png)
包含要素:
Vistor:抽象访问者,为每一个element元素声明一个方法
ConcreteVistor:具体访问者
Element:抽象元素
ConcreteElement:具体元素
ObjectStructure:对象结构
示例demo:比如在公司中,一般老板关心管理者的情况,管理者关系员工的工作情况。
本文标题:3.11 行为型-访问者模式
本文链接:https://www.haomeiwen.com/subject/nohqoktx.html
网友评论