首页    期刊浏览 2025年02月22日 星期六
登录注册

文章基本信息

  • 标题:The Language of the Visitor Design Pattern
  • 作者:Markus Schordan
  • 期刊名称:Journal of Universal Computer Science
  • 印刷版ISSN:0948-6968
  • 出版年度:2006
  • 卷号:12
  • 期号:7
  • 页码:849-867
  • 出版社:Graz University of Technology and Know-Center
  • 摘要:Design patterns have been developed to cope with the vast space of possible different designs within object-oriented systems. One of those classic patterns is the Visitor Pattern, used for representing an operation to be performed on the elements of an object structure. In general, the order in which the objects are visited is crucial. We present a mapping from the Visitor Pattern to a context free grammar that defines the set of all such visit sequences, a given Visitor can perform. The language defined by this grammar is the language of the Visitor Design Pattern and the mapping encodes knowledge about the class hierarchy and the implementation of the accept methods of a Visitor Design Pattern. It is general enough to model complications that occur when traversing arbitrary object structures, and also properly represents cases such as lack of a common base class, multiple inheritance, and inheritance from concrete classes. Due to its particular design, the grammar can also be used as precise documentation for a Visitor Design Pattern.
Loading...
联系我们|关于我们|网站声明
国家哲学社会科学文献中心版权所有