[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

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 Moores, PhD Research Student, Computing Lab, University of Kent, UK.