Static reflector: a pattern for object-oriented access to non-object-oriented interfaces

  • Authors:
  • Bob Jolliffe;J. A. van der Poll

  • Affiliations:
  • Department of Computer Science and Information Systems, University of South Africa, P O Box 392, UNISA, 0003, South Africa;Department of Computer Science and Information Systems, University of South Africa, P O Box 392, UNISA, 0003, South Africa

  • Venue:
  • SAICSIT '03 Proceedings of the 2003 annual research conference of the South African institute of computer scientists and information technologists on Enablement through technology
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

Somewhere near the bottom of the food chain of object oriented programming, the developer frequently encounters a non object oriented API. This paper describes a specialisation of the Wrapper Facade pattern. Wrapper Facades encapsulate functions and data provided by existing non object oriented API's. The Static Reflector addresses the particular problem of building wrappers which contain functions which take C function pointers as parameters. The pattern makes use of a static reflection method to facilitate the construction of cohesive, reusable framework classes which make use of such C functions. We show that the application of this pattern is surprisingly wide. Though concerned primarily with the interface between C and C++, the pattern has implications for and applications to other languages as diverse as Java and [incr Tcl].This pattern was workshopped at the PLOP 2001 conference, Illinois. It is structured according to the canonical form under the headings Name, Problem, Context, Forces, Solution, Resulting Context, Rationale, Examples and Related Patterns.