If you encapsulate your operations as objects, you can often use the data structure to replace the operator switch, and hopefully just add operations in the future.
For example, this is one way to encapsulate operations as objects: using Enum to represent operations:
http://download.oracle.com/javase/1.5.0/docs/guide/language/enums.html
public enum Operation {
PLUS { double eval(double x, double y) { return x + y; } },
MINUS { double eval(double x, double y) { return x - y; } },
TIMES { double eval(double x, double y) { return x * y; } },
DIVIDE { double eval(double x, double y) { return x / y; } };
abstract double eval(double x, double y);
}
, , . [[ UI/view /, , , , , .]]
, , , :