SH-Tang / BalancedFieldLength

A C# implementation to calculate the balanced field length of an aircraft.
GNU General Public License v3.0
1 stars 0 forks source link

Investigate location of validation logic #23

Closed SH-Tang closed 3 years ago

SH-Tang commented 4 years ago

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)