You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Kenny MacLeod (JIRA)" <ji...@apache.org> on 2006/10/16 14:53:35 UTC

[jira] Created: (LUCENE-685) Extract interface from IndexWriter

Extract interface from IndexWriter
----------------------------------

                 Key: LUCENE-685
                 URL: http://issues.apache.org/jira/browse/LUCENE-685
             Project: Lucene - Java
          Issue Type: Improvement
          Components: Index
    Affects Versions: 2.0.0
            Reporter: Kenny MacLeod
            Priority: Minor


org.apache.lucene.index.IndexWriter should probably implement an interface to allow us to more easily write unit tests that use it.  As it stands, it's a complex class that's hard to stub/mock.

For example, an interface which had methods such as addDocument(), close() and optimize().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-685) Extract interface from IndexWriter

Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12558402#action_12558402 ] 

Grant Ingersoll commented on LUCENE-685:
----------------------------------------

Well, they are hard to maintain when you want to go add a new method and you end up breaking 500 users who then flood the list b/c their implementations are broken because of interface changes.  So, in general, we favor abstract classes.  If Lucene had a different policy on back-compatibility, then this could change.  

At any rate, this issue is not for that discussion.  I'd be happy to visit it on java-dev, as I actually think it is an area Lucene could be better about.

> Extract interface from IndexWriter
> ----------------------------------
>
>                 Key: LUCENE-685
>                 URL: https://issues.apache.org/jira/browse/LUCENE-685
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.0.0
>            Reporter: Kenny MacLeod
>            Priority: Minor
>         Attachments: InterfaceIndexWriter.java
>
>
> org.apache.lucene.index.IndexWriter should probably implement an interface to allow us to more easily write unit tests that use it.  As it stands, it's a complex class that's hard to stub/mock.
> For example, an interface which had methods such as addDocument(), close() and optimize().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-685) Extract interface from IndexWriter

Posted by "Karl Wettin (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LUCENE-685?page=all ]

Karl Wettin updated LUCENE-685:
-------------------------------

    Attachment: InterfaceIndexWriter.java

This is the interface I let IndexWriter implement in http://issues.apache.org/jira/browse/LUCENE-550 in order to subclass my own non-Directory index. Perhaps a start?

> Extract interface from IndexWriter
> ----------------------------------
>
>                 Key: LUCENE-685
>                 URL: http://issues.apache.org/jira/browse/LUCENE-685
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.0.0
>            Reporter: Kenny MacLeod
>            Priority: Minor
>         Attachments: InterfaceIndexWriter.java
>
>
> org.apache.lucene.index.IndexWriter should probably implement an interface to allow us to more easily write unit tests that use it.  As it stands, it's a complex class that's hard to stub/mock.
> For example, an interface which had methods such as addDocument(), close() and optimize().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Resolved: (LUCENE-685) Extract interface from IndexWriter

Posted by "Grant Ingersoll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grant Ingersoll resolved LUCENE-685.
------------------------------------

    Resolution: Won't Fix

Interfaces are hard to maintain from an API perspective and we have _generally_ concluded that we should avoid them given Lucene's backward-compatibility requirements.

> Extract interface from IndexWriter
> ----------------------------------
>
>                 Key: LUCENE-685
>                 URL: https://issues.apache.org/jira/browse/LUCENE-685
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.0.0
>            Reporter: Kenny MacLeod
>            Priority: Minor
>         Attachments: InterfaceIndexWriter.java
>
>
> org.apache.lucene.index.IndexWriter should probably implement an interface to allow us to more easily write unit tests that use it.  As it stands, it's a complex class that's hard to stub/mock.
> For example, an interface which had methods such as addDocument(), close() and optimize().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-685) Extract interface from IndexWriter

Posted by "Kenny MacLeod (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12558315#action_12558315 ] 

Kenny MacLeod commented on LUCENE-685:
--------------------------------------

Interfaces in APIs are hard to manintain...  you *are* kidding, right?  Take a look at every well-written Java API out there, they *all* make heavy use of interfaces, because it makes API maintenance *easier*.

Never mind.  Now that Spring has a Lucene API wrapper, I can use that to get a usable API.

> Extract interface from IndexWriter
> ----------------------------------
>
>                 Key: LUCENE-685
>                 URL: https://issues.apache.org/jira/browse/LUCENE-685
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.0.0
>            Reporter: Kenny MacLeod
>            Priority: Minor
>         Attachments: InterfaceIndexWriter.java
>
>
> org.apache.lucene.index.IndexWriter should probably implement an interface to allow us to more easily write unit tests that use it.  As it stands, it's a complex class that's hard to stub/mock.
> For example, an interface which had methods such as addDocument(), close() and optimize().

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org