By reading the problem definition from the earlier content, it seems that each line from the list represents a single rule. The rules are simple; they include few conditions and a consequence. The consequence will report a customer who failed a validation rule. The two types of messages that will be used include an error and a warning.
We'll now define a report model that will store this information. The model might look like this:
As can be seen in in the previous screenshot, we have the Message
and ValidationReport
interfaces. This validation report is then used by the BankingValidationService
object, which represents some service that will run the validation rules and will act upon the validation report. The screenshot also shows the default implementation of these interfaces.