We set out to build a generic framework for creating Java client/server
relationships. Our hope was to encapsulate all of the messy details of the
relationship, allowing developers writing a client or a server to focus just
on their particular application. This would allow our team to swiftly create
client/server relationships relying on robust, fully debugged classes to
handle communications. We wanted a framework that was simple and easy to use,
but flexible enough to handle multiple communications methods.
Motivation
It has generally been difficult to set up the communications for a new
client/ server architecture. The first hurdle is to decide which of various
methods to use: custom-parsed data on a socket, serialization, Remote Method
Invocation (RMI), JavaSpaces, a proprietary middleware package, and so forth.
The next issue to be tackled is connection managemen... (more)
A common set of programming problems drove us to develop a Java class we call
PropArgs. Consider the following questions a programmer may want answered
about a program: Which RDBMS instance should data come from? Does this
particular user have any personal preferences I should be setting? Should
debugging code be executed during a particular run of a program? Are there
different execution paths based on the current operating system? Should the
programmer be operating in batch or interactive mode? What directory should
disk output be written to?
The common factor in these questio... (more)
Serialization in Java is an operation in which an object's internal state is
translated into a stream of bytes. This binary stream or image of the object
is created in an operating system-neutral network byte order. The image can
be written to a disk, stored in memory, or sent over a network to a different
operating system. This amazing feat requires little or no work on the part of
the programmer. Just implement the serializable interface, which contains no
methods, and call the writeObject() method on your object, and it's
serialized! You can serialize an object to or from any ... (more)
In creating the HotScheme interpreter (JDJ Vol. 4, Issue 1), we decided to
employ functional programming concepts to Java, our implementation language,
whenever it was practical. Functional programming has a number of advantages
over more traditional procedural code, which we will enumerate below. The
common thread uniting these advantages is an attempt to create code that's
conceptually transparent. Employing this functional style directly in Java
allowed us to define many Scheme functions in Java the same as they'd be
written in Scheme itself. We wouldn't recommend attempting t... (more)
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 t... (more)