Currently, DataTranslator can control the type of Translation object is attached to the resulting output DataSource and it can control how the translation is done (obviously). However, for input, there will, in general, be the possibility that one thing or another has gone wrong with the input DataSource. Similarly, for output it's possible that the output DataSource has been created incorrectly. To streamline DataTranslator code, it would be good to
Add an interface method, validate, to DataTranslator to validate its input
Add an interface method, validate, to DataSource to validate their fields regardless of how they are set (e.g., pre or post translation)
Add one or more decorators for decorating validate to change when, in the potentially expensive process of providing capabilities to a DataSource pre-translation, that a validation should occur, with the undecorated validate running after all capabilities are provided
Add places in the pow translate process where validation is called
It shouldn't be necessary to add to the DataTranslator interface a validation aftertranslate has run since their shouldn't be any validation specific to the DataTranslator that can't be put into translate itself.
Exit criteria:
validate methods as described above with a default no-op implementation
appropriate user errors for validation failures describing the nature of the validation failure. This is provided by each validate method ... just need to provide the means for validators to provide the message to the user
addition of calls to validate before and after DataTranslator::translate runs in POW::translate
Currently, DataTranslator can control the type of Translation object is attached to the resulting output DataSource and it can control how the translation is done (obviously). However, for input, there will, in general, be the possibility that one thing or another has gone wrong with the input DataSource. Similarly, for output it's possible that the output DataSource has been created incorrectly. To streamline DataTranslator code, it would be good to
validate
, to DataTranslator to validate its inputvalidate
, to DataSource to validate their fields regardless of how they are set (e.g., pre or post translation)validate
to change when, in the potentially expensive process of providing capabilities to a DataSource pre-translation, that a validation should occur, with the undecoratedvalidate
running after all capabilities are providedpow translate
process where validation is calledIt shouldn't be necessary to add to the DataTranslator interface a validation after
translate
has run since their shouldn't be any validation specific to the DataTranslator that can't be put intotranslate
itself.Exit criteria:
validate
methods as described above with a default no-op implementationvalidate
method ... just need to provide the means for validators to provide the message to the uservalidate
before and afterDataTranslator::translate
runs inPOW::translate