Pattern matching on objects in Java

  • Authors:
  • Nadeem Abdul Hamid

  • Affiliations:
  • Berry College, Mount Berry, Georgia

  • Venue:
  • Journal of Computing Sciences in Colleges
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper presents a refinement of the Visitor design pattern, providing convenient pattern matching and deconstruction over objects in a Java class hierarchy. It develops the idea of extracting and passing the values of an object's subcomponents to the visitor operation so that it is not necessary to explicitly extract them using accessor methods. It further presents the use of the Java Reflection API to implement a flexible and extensible pattern matching framework.