Hi I'm reading a design document for good practices in
Java and I keep wondering if someone can explain one thing to me.
The problem is how to go about designing a program where you can use any type of vehicles and move them, but each type of vehicle moves differently, i.e a plane or a car.
So they suggest to do it this way:
Then they have 1 class per type of movement:
..... etc etc...
isn't this too much? plus if you have to change it you have to go to each implementation. Why is this better than this:
Where you can change it in just one class. Anyone?
Thanks