Skip to content
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

FilterOperation and ApiRequest cannot be extended #771

Closed
efronbs opened this issue Sep 20, 2018 · 0 comments
Closed

FilterOperation and ApiRequest cannot be extended #771

efronbs opened this issue Sep 20, 2018 · 0 comments

Comments

@efronbs
Copy link
Contributor

efronbs commented Sep 20, 2018

The FilterOperation class is an enum with no interface. A lot of code surrounding filtering explicitly depends on this enum. This makes it very difficult to add filter operations. Additionally, ApiRequest is a concrete class that is tightly couple with many higher level classes. Because ApiRequest represents an assumed-to-be constant set of data, it being a concrete class is not that big of an issue. However, it has a constructor for building itself out of the query parameter string of the filter clause of the API request. higher level classes depending on this constructor has become an issue blocking easy extendability. FilterOperation is also tightly coupled to ApiRequest, and both are tightly coupled with druid filter builds and search providers.

The solution is to extract an interface for FilterOperation, and have all classes that currently refer to the implementation instead refer to the interfaces.

For ApiRequest, it should be turned into a data object, and it should be created by a factory that is injected into the the class that would otherwise be handling its construction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant