The VISITOR Pattern as a Reusable, Generic, Type-Safe Component

Oliveira, Bruno and Wang, Meng and Gibbons, Jeremy (2008) The VISITOR Pattern as a Reusable, Generic, Type-Safe Component. In: Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications. (Full text available)

PDF - Author's Accepted Manuscript
Download (226kB) Preview
[img]
Preview
Official URL
http://dl.acm.org/citation.cfm?id=1449799

Abstract

The VISITOR design pattern shows how to separate the structure of an object hierarchy from the behaviour of traversals over that hierarchy. The pattern is very flexible; this very flexibility makes it difficult to capture the pattern formally. We show how to capture the essence of the VISITOR pattern as a reusable software library, by using advanced type system features appearing in modern object-oriented languages such as Scala. We preserve type-safety statically: no reflection or similar mechanisms are used. The library is generic, in two senses: by types (the traversal return type and the object hierarchy shape) and by strategy (internal versus external control, imperative versus functional behaviour, orthogonal aspects such as tracing and memoisation). Finally, we propose a generalised datatype-like notation, providing a convenient functional decomposition style in object-oriented languages.

Item Type: Conference or workshop item (Paper)
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 75 Electronic computers. Computer science
Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming,
Divisions: Faculties > Sciences > School of Computing > Programming Languages and Systems Group
Depositing User: Meng Wang
Date Deposited: 28 Feb 2015 16:27 UTC
Last Modified: 05 Feb 2016 09:43 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/47470 (The current URI for this page, for reference purposes)
  • Depositors only (login required):

Downloads

Downloads per month over past year