Java Threads mailing list archive

Re: Java Tip 68: Learn how to implement the Command pattern in Java - JavaWorld - February 1999

From: "J.Moores" <jm40@ukc.ac.uk>
Date: Fri, 12 Feb 1999 12:58:29 +0000 (GMT)

On Fri, 12 Feb 1999, Rick van Rein wrote:

> The matter is not an efficiency issue, but a modelling issue.
> 
> A case statement enumerates over a limited set of possibilities.
> These possibilities are usually considered in many places in a program.
> 
> Program extensions often add new possibilities to such sets.
> The style of coding with switch statements makes it necessary to look up
> all the switch statements and adapt all of them. This means that the whole
> design must be reviewed, which is often (too) complicated.
> <snip>

I agree, I had particular problems with switch statements when extending
the Inmos occam compiler, and if you added added a tree node, or a new
field to an existing node, you had to modify switch statements all over
the place.

> Rick van Rein,
> 	Spiritus flexibilis in corpore flexibile
> --
> Universiteit Twente * INF-3027 * Postbus 217 * 7500 AE Enschede * 053-4894291
Jim
---
Jim Moores, PhD Research Student, Computing Lab, University of Kent, UK.
                                                



	


Last updated: Tue Nov 2 12:11:31 1999
Maintained by Peter Welch.