Hello, I have doubts on approaching doing this.
I have a Train class and a Wagon class. There are three types of wagon: FirstClass, TouristClass and DiningCar. Each of these types has the same properties and methods, the only difference between them is their multiplicity with the Train class.
Each train class has one and only one DiningCar wagon, at least one FirstClass wagon and at least one TouristClass wagon.
What is the best way to do this. Should the classes FirstClass, TouristClass and DiningCar inherit from the Wagon class, make them empty and then relate them to the train class? Or there is other approach?