Reflective systems allow their own structures to be altered from withi
n. Here we are concerned with a style of reflection, called linguistic
reflection, which is the ability of a running program to generate new
program fragments and to integrate these into its own execution. In p
articular, we describe how this kind of reflection may be provided in
the compiler-based, strongly typed object-oriented programming languag
e Java. The advantages of the programming technique include attaining
high levels of genericity and accommodating system evolution, These ad
vantages are illustrated by an example taken from persistent programmi
ng, which shows how linguistic reflection allows functionality (progra
m code) to be generated on demand (Just-In-Time) from a generic specif
ication and integrated into the evolving running program. The techniqu
e is evaluated against alternative implementation approaches with resp
ect to efficiency, safety and ease of use, (C) 1998 John Wiley & Sons,
Ltd.