jesterj icon indicating copy to clipboard operation
jesterj copied to clipboard

Interface for the processor Builder classes, input validation

Open dgoldenberg1234 opened this issue 8 years ago • 4 comments

The common functionality to refactor into the interface could be

  • the 'build' method
  • maybe handle getObj / setObj in a unified way
  • a 'validate' method to validate the processor inputs, which perhaps throws a ConfigurationException

dgoldenberg1234 avatar Mar 22 '16 16:03 dgoldenberg1234

We do have a Builder interface though it's not presently being used. It needs to loose it's generics (because that gets complicated with inheritance). I can see adding a validate method. It would be nice to have something for my use of getObj/setObj except it's not possible to specify non-public methods in interfaces and those need to remain protected/private

nsoft avatar Mar 22 '16 17:03 nsoft

might it be ok to do something with the 'obj' via a default method on that interface; may lose some encapsulation but saves on that method impl

dgoldenberg1234 avatar Mar 22 '16 19:03 dgoldenberg1234

This must be work in progress. I see that there's now the 'isValid' method on NamedBuilder, presumably for subclasses to override and do their validation. However, nothing seems to be calling this method. And, it returns a boolean which begs the question of how a validation error is to be propagated into the calling layers.

dgoldenberg1234 avatar Mar 30 '16 13:03 dgoldenberg1234

The present incarnation of the NamedBuilder class has some methods that were originally intended to support a builder<-->YAML conversion. This is presently a mothballed idea. Perhaps it will return, but not for 0.2

nsoft avatar Jun 12 '17 22:06 nsoft

This has become out dated

nsoft avatar Feb 21 '23 17:02 nsoft