You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2007/09/28 01:05:50 UTC
[jira] Created: (SOLR-367) RFC: use contrete return types in
analysis factory declarations
RFC: use contrete return types in analysis factory declarations
---------------------------------------------------------------
Key: SOLR-367
URL: https://issues.apache.org/jira/browse/SOLR-367
Project: Solr
Issue Type: Improvement
Reporter: Hoss Man
will attach patch for comments: the main idea is to change most of the Tokenizer and TokenFilterFactories to be explicit about what their "create" method returns instead of just using "TokenStream"
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (SOLR-367) RFC: use contrete return types in
analysis factory declarations
Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hoss Man updated SOLR-367:
--------------------------
Attachment: concrete.declared.returntype.factories.diff
my main motivation for this is a little project i'm working on in some spare time to try and build a reflection based tool that will help us autogenerate Factories whenever we upgrade the Lucene jar. step one is identifying which TokenFilter and Tokenizer factories already exist (even though the names might be inconsistent). for that specific use case i could also introduce some new annotations, but it got me thinking about this and i think it's a good idea in general. It makes the API of each factory self documenting about what that factory produces, and makes hte javadocs a lot easier to follow.
no functionality is changed, and it is 100% backwards compatible.
i'm seeking comments before commiting however because it does violate the typical philosophy of an API: declare that you return an interface/abstract class, not a concrete implementation. I'm not sure that is as important in the case of these factories. it also (in theory) could cause problems down the road if we start optimizing the factories. ie: if we decide that for certain input options, SynonymFilterFactory isn't going to return a SynonymFilter and instead will return some new AliasFilter then in theory we have painted ourselves into a corner unless this AliasFilter is a subclass of SynonymFilter because people might have written code that directly calls the create method on the factory and expects a specific return type. likewise we might run into similar problems if we promote some of our own filters up into lucene (and the packages change)
these seem like minor concerns however, given the intended usecase of these factories, and the "self documentation" benefits of the API.
...but that's just my opinion, which is why i wanted to put it out there and see what people think.
> RFC: use contrete return types in analysis factory declarations
> ---------------------------------------------------------------
>
> Key: SOLR-367
> URL: https://issues.apache.org/jira/browse/SOLR-367
> Project: Solr
> Issue Type: Improvement
> Reporter: Hoss Man
> Attachments: concrete.declared.returntype.factories.diff
>
>
> will attach patch for comments: the main idea is to change most of the Tokenizer and TokenFilterFactories to be explicit about what their "create" method returns instead of just using "TokenStream"
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (SOLR-367) RFC: use contrete return types in
analysis factory declarations
Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hoss Man resolved SOLR-367.
---------------------------
Resolution: Fixed
Fix Version/s: 1.3
Assignee: Hoss Man
Committed revision 591158.
> RFC: use contrete return types in analysis factory declarations
> ---------------------------------------------------------------
>
> Key: SOLR-367
> URL: https://issues.apache.org/jira/browse/SOLR-367
> Project: Solr
> Issue Type: Improvement
> Reporter: Hoss Man
> Assignee: Hoss Man
> Fix For: 1.3
>
> Attachments: concrete.declared.returntype.factories.diff
>
>
> will attach patch for comments: the main idea is to change most of the Tokenizer and TokenFilterFactories to be explicit about what their "create" method returns instead of just using "TokenStream"
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (SOLR-367) RFC: use contrete return types in
analysis factory declarations
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530909 ]
Yonik Seeley commented on SOLR-367:
-----------------------------------
Seems fine to me.
> RFC: use contrete return types in analysis factory declarations
> ---------------------------------------------------------------
>
> Key: SOLR-367
> URL: https://issues.apache.org/jira/browse/SOLR-367
> Project: Solr
> Issue Type: Improvement
> Reporter: Hoss Man
> Attachments: concrete.declared.returntype.factories.diff
>
>
> will attach patch for comments: the main idea is to change most of the Tokenizer and TokenFilterFactories to be explicit about what their "create" method returns instead of just using "TokenStream"
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.