Modular Visitor Components

The expression families problem can be defined as the problem of achieving reusability and composability across the components involved in a family of related datatypes and corresponding operations over those datatypes. Like the traditional expression problem , adding new components (either variants or operations) should be possible while preserving modular and static type-safety . Moreover, different combinations of components should have different type identities and the subtyping relationships between components should be preserved. By generalizing previous work exploring the connection between type-theoretic encodings of datatypes and visitors, we propose two solutions for this problem in Scala using modular visitor components . These components can be grouped into features that can be easily composed in a feature-oriented programming style to obtain customized datatypes and operations.

[1]  Peter Buneman,et al.  Theoretical Aspects of Object-Oriented Programming , 1994 .

[2]  Oscar Nierstrasz,et al.  Traits: Composable Units of Behaviour , 2002, ECOOP.

[3]  Gary T. Leavens,et al.  MultiJava: modular open classes and symmetric multiple dispatch for Java , 2000, OOPSLA '00.

[4]  Daniel H. H. Ingalls A simple technique for handling multiple polymorphism , 1986, OOPSLA 1986.

[5]  Corrado Böhm,et al.  Automatic Synthesis of Typed Lambda-Programs on Term Algebras , 1985, Theor. Comput. Sci..

[6]  J. Girard,et al.  Proofs and types , 1989 .

[7]  Kim B. Bruce Some challenging typing issues in object-oriented languages , 2003, WOOD.

[8]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[9]  Luca Cardelli,et al.  Extensible records in a pure calculus of subtyping , 1994 .

[10]  Roberto Erick Lopez-Herrejon,et al.  Evaluating Support for Features in Advanced Modularization Technologies , 2005, ECOOP.

[11]  Brian Randell,et al.  Software engineering : report on a conference sponsored by the NATO Science Committee, Garmisch, Germany, 7th to 11th October 1968 , 1969 .

[12]  Satoshi Matsuoka,et al.  ECOOP'97 — Object-Oriented Programming , 1997, Lecture Notes in Computer Science.

[13]  Andrew P. Black ECOOP 2005 - Object-Oriented Programming, 19th European Conference, Glasgow, UK, July 25-29, 2005, Proceedings , 2005, ECOOP.

[14]  Jens Palsberg,et al.  The essence of the Visitor pattern , 1998, Proceedings. The Twenty-Second Annual International Computer Software and Applications Conference (Compsac '98) (Cat. No.98CB 36241).

[15]  Jacques Garrigue,et al.  Code reuse through polymorphic variants , 2000 .

[16]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[17]  Apostolos Syropoulos,et al.  Steps in Scala: The expression problem , 2010 .

[18]  Mads Torgersen The Expression Problem Revisited , 2004, ECOOP.

[19]  Erik Poll,et al.  Subtyping and Inheritance for Inductive Types , 1997 .

[20]  Martin Odersky,et al.  A Statically Safe Alternative to Virtual Types , 1998, ECOOP.

[21]  Ralf Hinze,et al.  Open data types and open functions , 2006, PPDP '06.

[22]  Craig S. Kaplan,et al.  Predicate Dispatching: A Unified Theory of Dispatch , 1998, ECOOP.

[23]  Meng Wang,et al.  The visitor pattern as a reusable, generic, type-safe component , 2008, OOPSLA.

[24]  Michel Parigot Recursive Programming with Proofs , 1992, Theor. Comput. Sci..

[25]  Bruno César dos Santos Oliveira Genericity, extensibility and type : safety in the VISITOR pattern , 2007 .

[26]  Martin Odersky,et al.  Extensible algebraic datatypes with defaults , 2001, ICFP '01.

[27]  Martin Odersky ECOOP 2004 – Object-Oriented Programming , 2004, Lecture Notes in Computer Science.

[28]  Luca Cardelli,et al.  ECOOP 2003 – Object-Oriented Programming , 2003, Lecture Notes in Computer Science.

[29]  Philippe Altherr,et al.  Adding Type Constructor Parameterization to Java , 2008, J. Object Technol..

[30]  William R. Cook,et al.  Mixin-based inheritance , 1990, OOPSLA/ECOOP '90.

[31]  Hayo Thielecke,et al.  A Type-theoretic Reconstruction of the Visitor Pattern , 2006, MFPS.

[32]  Ralf Hinze Generics for the masses , 2006, J. Funct. Program..

[33]  Xin Qi,et al.  J&: nested intersection for scalable software composition , 2006, OOPSLA '06.

[34]  Martin Odersky,et al.  Independently Extensible Solutions to the Expression Problem , 2004 .

[35]  Bruno C. d. S. Oliveira,et al.  Extensible and modular generics for the masses , 2006, Trends in Functional Programming.

[36]  Martin Odersky,et al.  An Overview of the Scala Programming Language , 2004 .

[37]  Xin Qi,et al.  Sharing classes between families , 2009, PLDI '09.

[38]  Gary T. Leavens,et al.  Typechecking and Modules for Multimethods , 1995, ACM Trans. Program. Lang. Syst..

[39]  Martin Odersky,et al.  Generics of a higher kind , 2008, OOPSLA.

[40]  Wouter Swierstra,et al.  Data types à la carte , 2008, Journal of Functional Programming.

[41]  Christian Prehofer,et al.  Feature-Oriented Programming: A Fresh Look at Objects , 1997, ECOOP.

[42]  Andrew C. Myers,et al.  Scalable extensibility via nested inheritance , 2004, OOPSLA.

[43]  Mirko Viroli,et al.  Variant parametric types: A flexible subtyping scheme for generics , 2006, TOPL.

[44]  Matthias Felleisen,et al.  Synthesizing Object-Oriented and Functional Design to Promote Re-Use , 1998, ECOOP.

[45]  William R. Cook,et al.  Object-Oriented Programming Versus Abstract Data Types , 1990, REX Workshop.

[46]  Kim B. Bruce,et al.  PolyTOIL: A type-safe polymorphic object-oriented language , 1995, TOPL.