-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Query Refactoring: Merging Parser and Builder classes #10324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query Refactoring: Merging Parser and Builder classes #10324
Conversation
|
Part of this has me wondering if, since this is a large change, we should go ahead and do the rename similar to what Simon did in #9901 and go ahead and rename all the Some potential side effects:
On the other hand, this does allow us to move away from the Builder pattern (if that is something we want to do) and I think the name conflicts issue is not particularly pressing, since end users are not expected to ever have to deal with Lucene queries, so I think that's fine to deal with. @javanna @cbuescher what do you guys think? I'd like to get the big name-change PRs out of the way first so we can start working on individual queries. |
|
We could also rename FooQueryBuilder to FooQuery and add a deprecated On Mon, Mar 30, 2015 at 10:27 PM, Lee Hinman [email protected]
Christoph Büscher |
|
I think I'm +1 on renaming to |
|
I think the main concern we have at this stage is backwards compatibility, others are secondary aspects. These classes are not going to be pure builders anyways... I am either for renaming or keeping names as they are, wouldn't rename and keep builder classes only for bw comp. We can definitely postpone this change/decision. |
|
+1 to postpone a rename |
|
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Open question: There are several places where I had to move no-arg constructor from FooParser to Builder where I had to instantiate a 'final' member to null. At other places I chose to remove the 'final' from the member. Not sure whats better here, maybe this changes in further refactoring anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think in further refactoring this will end up not being a final method and we won't have to set it for this.
A first intermediate step in the query parsing refactoring proposed in #10217. It merges the current parser code from *QueryParser into the corresponding Builder & deleting the former.
In some cases the current implementation of the Parsers require a no-arg constructor for the guice injection. In cases where the original Builder class has
finalfields these are set to eithernullor a default value where possible.