It depends of how you define the contract of the classes.
a) If you specify that BaseStation
values can change (or you do not specify that it cannot change), you can use two instances of the class.
b) If you specify that BaseStation
values cannot change, then you not only cannot use two instances of the same class for that usage, but you cannot even extend BaseStation
to get your DynamicBaseStation
(as the subclass would violate the superclass contract). You would need to set maybe a common interface.
The stricter your contracts are, the less reusable the classes will be. But also, as the behavior of the classes is better defined, you can use its properties to simplify using the class/avoid mistakes (the a
approach would let you change the values of a StaticBase
, the b
approach forces you to use another class that is, at best, a sibling).
In this concrete class, I would define BaseStation
without specifying that it cannot be moved, and create a StaticBaseStation
that refines the parent contract (but does not contradict it) but stablishing that it cannot change its location. Usually the procedure is to increase the restrictions as you go down through the inheritance (specialization).
Anyway, again, it is a rule of thumb. There may be other motives that force you to define the contract one way or the other; the important is that you do not break when extending the classes.