Hello,
I’m new to UML and designing
I’m designing a UML scheme for vehicles and stuff,
My first concern is that i will have several kinds of vehicles (car, trucks, bicycle, and later maybe boats)
but as you know is that cars and trucks have a licenseplate number, chassisnumber, so things that a bicycle doesn’t have.
I was thinking of making an abstract class “Vehicle” and make subclasses for car and truck and bicycle.
But if I do it this way i will have to add the attributes like license plate to the abstract Vehicle class, but this way a bike will also have this attribute when he will inherit from vehicle, and this sounds kinds of silly to me
I also was thinking about making vehicle an interface, but then i have to add the attribute license plate to car and again to the class truck, which is not good i think…
does somebody has an idea of solving this in a proper way?
Thanks in advance