A Bike has many Components. A Component may have other Components. There will be many types of Components, and the granularity that you want to track that should be up to the user.
It should be fine to say I have a Bike { id = 1, name = "Fave" }, and I can have a Component { bikeId = 1, type = "Tire" }, even though tires don't "go on" bikes, they go on wheels.
It should be also fine to say I have a Bike with a Component { type = "Wheel" }, and on that wheel, I have a Component { type = "Tire" }.
I should be able to move a component from one bike (or component) to another. Distance calculations should cascade. The time that I move a component should determine what use that component gets.
A
Bike
has manyComponent
s. AComponent
may have otherComponent
s. There will be many types ofComponent
s, and the granularity that you want to track that should be up to the user.It should be fine to say I have a
Bike { id = 1, name = "Fave" }
, and I can have aComponent { bikeId = 1, type = "Tire" }
, even though tires don't "go on" bikes, they go on wheels.It should be also fine to say I have a
Bike
with aComponent { type = "Wheel" }
, and on that wheel, I have aComponent { type = "Tire" }
.I should be able to move a component from one bike (or component) to another. Distance calculations should cascade. The time that I move a component should determine what use that component gets.