| Approach | Pro's | Con's | ||||||
|---|---|---|---|---|---|---|---|---|
| parallel arrays | "backward compatible" (ie, doesn't break other clients) | responsibility for keeping indices "matched up" | ||||||
get source code for State.java & modify to add new instance variables (& methods to access)
| we know how to do it | (Serious bummer!)
It might be handy if our Fish had a method to center itself on a coordinate location.
cut-n-paste a new class with additional instance variables & methods
| | OR..... use INHERITANCE
| | Syntax to learn and keep straight
| |