Github user covolution commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/171#discussion_r110346756
  
    --- Diff: solr/core/src/java/org/apache/solr/handler/StreamHandler.java ---
    @@ -191,7 +237,20 @@ public void inform(SolrCore core) {
           .withFunctionName("lteq", LessThanEqualToEvaluator.class)
           .withFunctionName("not", NotEvaluator.class)
           .withFunctionName("or", OrEvaluator.class)
    -      
    +
    +      // Date Time Evaluators
    +      .withFunctionName(TemporalEvaluatorYear.FUNCTION_NAME, 
TemporalEvaluatorYear.class)
    --- End diff --
    
    I agree with what you are saying. Its a tricky question.
    
    The function definitions in StreamHandler are all static, there are no 
class instances.  This makes sense if a factory is creating them.  If we went 
for an instance method on an implementation class then that wouldn't really 
work.  (It would allow us to have multiple implementations in the same class 
though)!
    
    So instances vs static is a bit of a problem. I like that you can also use 
aliases at the moment so wouldn't want to lose that. Are function classes being 
created on-demand, per request?
    
    If we keep with the static implementation, perhaps we can use an interface 
called FunctionNames to put all the string constants?  It would be one central 
definition list for StreamHandler, GraphHandler and SolrTable.  Function 
implementation classes could still reference the FunctionNames in their 
implementation.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to