I've been requested to develop a quite well known problem for a job interview. The Parking Simulation which an example can be found here.
I came up with some ideas for which design pattern should I use and so on, but I got confused when I searched about how other people interpreted that.
This might be a really dumb question, but I need to be sure that I am not the only one who thinks like this.
I've found a lot of people who use a Vehicle Interface which is implemented by classes Car, and Truck (So far, so good). But all of them put the properties of the size occupied by the vehicle and the fee which it has to pay, on those classes as well.
I can understand that. But for me it is not making much sense, since the size is not the actual Vehicle size, but how much parking space it requires. For example (a little no sense but...) you could create another Parking based on motorcycles/bikes size, so the values would differ because the Parking is different, not vehicles themselves.
The same goes for the prices, at least for me, the parking tell the fees, not the vehicles.
But, if the parking do everything the vehicle classes will have nothing to do, and it will not look very cohesive.
Is that clear? Does this make sense or I'm being dumb?