![]() |
Page History
Panel | ||
---|---|---|
| ||
|
Different Lucene Query methods that should be pulled out of CodedNodeSetImpl and AbstractLazyCodeHolderFactory. These methods can be pushed into an implementation of the Query interface below. The interface will be used instead of calling Lucene directly.
Code Block | ||||
---|---|---|---|---|
| ||||
//code decoupling // Interface for creating Queries public interface Query { // methods required for CodedNodeSetImpl public Query getCodingSchemeQuery(String uri, String internalVersionString); public Query getRestrictionQuery(Restriction restriction, String internalCodeSystemName, String internalVersionString); // methods required for AbstractLazyCodeHolderFactory private Query getBooleanQuery(List<Query> queries); public Query getFilteredQuery(List<Filter> filters, BooleanQuery combinedQuery, Filter chainedFilter); } // Lucene Implementation public class LuceneQuery implements Query { } |
...
Need to define different types of Queries and Filters. Create an abstract class for each of them. CodedNodeSetImpl and AbstractLazyCodeHolderFactory will not need to reference Lucene objects directly then.
Code Block | ||||
---|---|---|---|---|
| ||||
// Abstract class for defining different types of Queries
public abstract class QueryType {
}
public abstract class FilterType {
} |