Uploaded image for project: 'Lucene.Net'
  1. Lucene.Net
  2. LUCENENET-467 .NETify the public API where appropriate
  3. LUCENENET-470

Change Getxxx() and Setxxx() methods to .NET Properties

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Lucene.Net 2.9.4, Lucene.Net 2.9.4g, Lucene.Net 3.0.3
    • Fix Version/s: Lucene.Net 3.0.3
    • Labels:
      None
    • Environment:

      all

      Description

      We should use .NET properties where ever possible. There are many methods in the API that use methods similar to Class.Getxxxxx() or Class.Setxxxxx(). These methods often just return a less-accessible field, with no real logic behind it.

      • If there are both public Get/Set methods with no special logic, they can be turned into an automatic property: Name { get; set; }
      • If there are both Get/Set methods with no special logic and the setter is private, use an automatic property: Name { get; private set; }
      • In other cases, use good judgement based with the amount of logic that is present in the getter and setter methods.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ccurrens Christopher Currens
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: