I have made an aggregated class named DrivingLog. I have only included the necassary fields in the picture below.
Now, when I want to add a driving record I say addRecord(Double distance, ...) on the DrivingLog object. However, is the DrivingRecord an aggregate for the Condition and Environment class or are they only references? Condition and Enviroment has no value outside one DrivingRecord.
Condition and Environment is static data: The user will be selecting among predefined values in a dropdown list in the JSF view. But if the DrivingRecord is an aggregate it should have a method namedaddEnviroment(). Should this be taking the Enviroment class as argument?
If thats the case would the DrivingLog have a method named addRecord(Double distance, Environment environment...)?
And last, shouldn't Environment and Condition be "hided" by the aggregate root and never accessed outside. This make me think if the DrivingRecord really is an aggregated root as well.
Is the nesting of aggregates even allowed, bad practice, ok in some cases?
