I am confused about the usage of associations with Java Enums in UML Class diagrams. Currently I am modelling a system containing a Car class that has some properties. Some are also Enums, just like FuelKind or CarBrand:
There are going to be a lot of cars in the database (Car is a JPA entity) and I'm asking myself which is the best association and cardinality to FuelKind and CarBrand.
My thoughts until now:
- Enum instances are instantiated on their own, so technically they do not depend on Car. Also non-technically those enums contain all available 'choices', so there is no strict dependency. So it can not be a Composition Aggregation between them.
- One Car has one CarBrand and one FuelKind. But from the other side: Does one brand or fuel kind have one car or multiple cars? Logically multiple cars can be from Mercedes or driving on petrol. But technically a enum instance has no link to one or multiple cars.
Do you have some suggestions and thoughts on how to solve this problem?