This article describes our use of design patterns to create an interpreter in
Java, and shows how it can be built in a "pure," object-oriented fashion.
.The patterns we use are from Design Patterns: Elements of Reusable
Object-Oriented Software by Gamma, Helm, Johnson and Vlissides, published by
Addison Wesley in 1995. (We'll refer to this book henceforth as DP.)
What Did We Build?
HotScheme is an online, multiplatform interpreter of the Lisp dialect Scheme,
with GUI front-end and interactive Internet capabilities. It's currently
implemented as a Java applet, although the core of the interpreter is
independent of the front end. At present it's only a partial implementation
of ANSI Scheme, intended for use as an educational tool for learning Scheme,
GUI design and interpreter implementation.
The project came into existence while we were working with Dr. Jo Anne Parikh ... (more)
As we try to keep pace in the frantic Internet era, it's easy to become
enraptured by the latest technologies - JavaBeans, CORBA, Swing and so on.
However, in the rush to add the latest buzzword to our resumes or marketing
brochures, we too often forget the basics of object-oriented programming. The
basics were the reason OOP was developed and what first attracted us to this
paradigm. How many of us have had the dismaying experience of coming across
"object-oriented code" that, although it might implement a "cross-platform,
event-driven, multithreaded, multitiered" application, h... (more)