You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Shad Storhaug (Jira)" <ji...@apache.org> on 2021/12/09 17:59:00 UTC

[jira] [Closed] (LUCENENET-467) .NETify the public API where appropriate

     [ https://issues.apache.org/jira/browse/LUCENENET-467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shad Storhaug closed LUCENENET-467.
-----------------------------------
    Resolution: Fixed

Closed @ GitHub: https://github.com/apache/lucenenet/issues/280

> .NETify the public API where appropriate
> ----------------------------------------
>
>                 Key: LUCENENET-467
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-467
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib, Lucene.Net Core
>    Affects Versions: Lucene.Net 2.9.2, Lucene.Net 2.9.4, Lucene.Net 2.9.4g, Lucene.Net 3.0.3
>         Environment: all
>            Reporter: Christopher Calvin Currens
>            Priority: Major
>              Labels: refactoring
>             Fix For: Lucene.Net 3.6
>
>         Attachments: Lucenenet-467-create.patch
>
>
> Although we haven't abandoned the line-by-line port of Java lucene, there are many idioms in Java that make little to no sense in a .NET assembly.  The API can change to allow for a conventional .NET experience, while still maintaining the ability and ease during the porting process of Java logic.
> * Change Getxxx() and Setxxx() methods to .NET Properties
> * Implement the [dispose pattern|http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx] properly.  Try, at all costs, to only use finalizers *when necessary*.  They are expensive, and most of the classes used already have finalizers that will be called.
> * Convert Java Iterator-style classes (see TermEnum, TermDocs and others) to implement IEnumerable<T>
> * When catching exceptions, do not use *throw;* instead of *throw ex;* to maintain the stack trace



--
This message was sent by Atlassian Jira
(v8.20.1#820001)