[ 
https://issues.apache.org/jira/browse/LUCENE-4256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422866#comment-13422866
 ] 

Chris Male commented on LUCENE-4256:
------------------------------------

bq. I don't think we should do this: else there is no point to the factories. 
If you want strong typing, just create Tokenizers etc directly.

The Factories provide integrating with resources, construction of more complex 
types, configure once make many copies support.  I guess I was referring to 
being able to actually pass in primitive types like booleans instead of having 
to convert a String to a boolean inside the Factory.

{quote}
I'm not sure I like that either, i would prefer ctor(args). This way its 
enforced by the java language 
itself that this was called, people can use final keyword, etc.
{quote}

Agreed.  Using constructors definitely gives us better workflow control.
                
> Improve Analysis Factory configuration workflow
> -----------------------------------------------
>
>                 Key: LUCENE-4256
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4256
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/analysis
>            Reporter: Chris Male
>
> With the Factorys now available for more general use, I'd like to look at 
> ways to improve the configuration workflow.  Currently it's a little disjoint 
> and confusing, especially around using {{inform(ResourceLoader)}}.
> What I think we should do is:
> - Remove the need for {{ResourceLoaderAware}} and pass in the ResourceLoader 
> in {{init}}, so it'd become {{init(Map<String, String> args, ResourceLoader 
> loader)}}
> - Consider moving away from the generic args Map and using setters.  This 
> gives us better typing and could mitigate bugs due to using the wrong 
> configure key.  However it does force the consumer to invoke each setter.
> - If we're going to stick with using the args Map, then move the Version 
> parameter into {{init}} as well, rather than being a setter as I currently 
> made it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to