Currently, some data objects (for example the EngineData) can be configured in an invalid state (for example, the number of failed engines can exceed the total number of engines that are present on the plane). The question arises: where should this validation logic come? Is it desirable to maintain a data object "dumb" and implement a validator which validates the combination, or should the validation be performed in the object itsellf as it is a bussiness rule?
Consider that hte latter approach could result in an enforcing of the order on how properties need to be set (first total number of engines, then number of failed engines)
Currently, some data objects (for example the EngineData) can be configured in an invalid state (for example, the number of failed engines can exceed the total number of engines that are present on the plane). The question arises: where should this validation logic come? Is it desirable to maintain a data object "dumb" and implement a validator which validates the combination, or should the validation be performed in the object itsellf as it is a bussiness rule?
Consider that hte latter approach could result in an enforcing of the order on how properties need to be set (first total number of engines, then number of failed engines)