oop – 访客设计模式中的循环依赖

前端之家收集整理的这篇文章主要介绍了oop – 访客设计模式中的循环依赖前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
有没有办法实现访客设计模式没有循环依赖?我的意思是访客需要一个访问对象.并且访问对象需要访问者接受.最终两者都相互依赖.
再找到它!查看 Acyclic Visitor

引用:

Allow new functions to be added to existing class hierarchies without affecting those hierarchies,and without creating the troublesome dependency cycles that are inherent to the GOF VISITOR Pattern.

猜你在找的设计模式相关文章