Skip to main content
Kent Academic Repository

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

Oliveira, Bruno, Wang, Meng, 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. . (KAR id:47470)

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: Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing
Depositing User: Meng Wang
Date Deposited: 28 Feb 2015 16:27 UTC
Last Modified: 16 Nov 2021 10:19 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/47470 (The current URI for this page, for reference purposes)

University of Kent Author Information

Wang, Meng.

Creator's ORCID:
CReDIT Contributor Roles:
  • Depositors only (login required):

Total unique views for this document in KAR since July 2020. For more details click on the image.