From: Erik V. <eri...@xs...> - 2011-06-13 16:05:12
|
> -----Oorspronkelijk bericht----- > Van: Stefan Frey [mailto:ste...@we...] > If you have flipTrain subclassing Train or have both be implementations of > the interface trainI is up to you. However I prefer the latter and trainI is an > unnecessary, as imho there is no need for an interface with only one > implementation (unless you provide an official API). We have many redundant interfaces, and I'd rather get rid of all of them, but there seems to be (or have been) a school of thought with some influence in this project that maintains that such interfaces are required about everywhere, just in case. I prefer to use interfaces only when there is a actual need to provide some common functionality to classes in completely different hierarchies (good examples we have are the CashHolder, Moveable and MoveableHolder interfaces). We'll find out whether or not we really need TrainI when developing the dual train class; I will consider both options. This could the only other train class we will ever need: even the 18EU Pullmann has (right or wrong) been implemented with the standard Train class; its peculiarities are handled by special code. Erik. |