|
> As a library author, I try to expose as less types/methods as possible via the API.
Sure, but you are really exposing the same amount of types one way or the other. In option #2 (just @UnwrapValidationValue) you still need to provide for example a JavaFXValueUnwrapper. In this case you would register it as an option to the bootstrap, but you are adding a new public type. Same for #3. The only difference is that is is more explicit and potentially more verbose.
> b) gives me as author more liberty to change the code base (e.g. re-organize packaging or rename types etc.) which is not as easy once types are part of the API.
#2 or #3 you are exposing the same amount of new types
> Also the user is only interested in expressing that unwrapping should take place
Not quite, since the Validator engine cannot know how unwrapping has to occur, the user also needs to tell us how this is happening. Really the difference between #2 and #3 is just minimal.
|