The VISITOR Pattern as a Reusable, Generic, Type-Safe Component
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 as anything more formal than prose, pictures and prototypes. we sh...
Asıl Yazarlar: | , , , |
---|---|
Materyal Türü: | Conference item |
Baskı/Yayın Bilgisi: |
2008
|
_version_ | 1826276280012636160 |
---|---|
author | Oliveira, B Wang, M Gibbons, J ACM |
author_facet | Oliveira, B Wang, M Gibbons, J ACM |
author_sort | Oliveira, B |
collection | OXFORD |
description | 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 as anything more formal than prose, pictures and prototypes. 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 and modularly: no reflection or similar mechanisms are used and modules can be independently compiled. the library is generic, in two senses: not only is it parametrised by both the return type and the shape of the object hierarchy, but also it allows a number of implementation choices (internal versus external control, imperative versus functional behaviour, orthogonal aspects such as tracing and memoisation) to be specified by parameters rather than fixed in early design decisions. finally, we propose a generalised datatype-like notation, on top of our visitor library: this provides a convenient functional decomposition style in object-oriented languages. Copyright © 2008 ACM. |
first_indexed | 2024-03-06T23:11:34Z |
format | Conference item |
id | oxford-uuid:65a95b15-a95e-4551-a20b-66fd0be9cf11 |
institution | University of Oxford |
last_indexed | 2024-03-06T23:11:34Z |
publishDate | 2008 |
record_format | dspace |
spelling | oxford-uuid:65a95b15-a95e-4551-a20b-66fd0be9cf112022-03-26T18:26:52ZThe VISITOR Pattern as a Reusable, Generic, Type-Safe ComponentConference itemhttp://purl.org/coar/resource_type/c_5794uuid:65a95b15-a95e-4551-a20b-66fd0be9cf11Symplectic Elements at Oxford2008Oliveira, BWang, MGibbons, JACMThe 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 as anything more formal than prose, pictures and prototypes. 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 and modularly: no reflection or similar mechanisms are used and modules can be independently compiled. the library is generic, in two senses: not only is it parametrised by both the return type and the shape of the object hierarchy, but also it allows a number of implementation choices (internal versus external control, imperative versus functional behaviour, orthogonal aspects such as tracing and memoisation) to be specified by parameters rather than fixed in early design decisions. finally, we propose a generalised datatype-like notation, on top of our visitor library: this provides a convenient functional decomposition style in object-oriented languages. Copyright © 2008 ACM. |
spellingShingle | Oliveira, B Wang, M Gibbons, J ACM The VISITOR Pattern as a Reusable, Generic, Type-Safe Component |
title | The VISITOR Pattern as a Reusable, Generic, Type-Safe Component |
title_full | The VISITOR Pattern as a Reusable, Generic, Type-Safe Component |
title_fullStr | The VISITOR Pattern as a Reusable, Generic, Type-Safe Component |
title_full_unstemmed | The VISITOR Pattern as a Reusable, Generic, Type-Safe Component |
title_short | The VISITOR Pattern as a Reusable, Generic, Type-Safe Component |
title_sort | visitor pattern as a reusable generic type safe component |
work_keys_str_mv | AT oliveirab thevisitorpatternasareusablegenerictypesafecomponent AT wangm thevisitorpatternasareusablegenerictypesafecomponent AT gibbonsj thevisitorpatternasareusablegenerictypesafecomponent AT acm thevisitorpatternasareusablegenerictypesafecomponent AT oliveirab visitorpatternasareusablegenerictypesafecomponent AT wangm visitorpatternasareusablegenerictypesafecomponent AT gibbonsj visitorpatternasareusablegenerictypesafecomponent AT acm visitorpatternasareusablegenerictypesafecomponent |