netgen/query-translator

Remove `final` from Lucene visitors

thePanz opened this issue · 2 comments

As per subject, the Luvene visitors are all marked as final and this recluses the possibility to alter they behaviour by extending those classes.

Usecase: force the domain to be specified when visiting the tree and throw an error.
As it is now the whole classes must be copied-pasted

Everything that's left open for extension is extension point which needs to be supported. So it's defensive like that on purpose, it allows for changes to the implementation without worrying about breaking someone's code because it depends on it.

I guess it can be a nuisance to copy-paste only to add some minor changes, but in the end I think being defensive is beneficial both for the maintainer and user.

Fair enough! :)
I'll close this issue 👍