lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Currens (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENENET-470) Change Getxxx() and Setxxx() methods to .NET Properties
Date Fri, 13 Apr 2012 16:59:17 GMT


Christopher Currens commented on LUCENENET-470:

Thanks for the feedback, Itamar.  I'm hoping soon to get feedback from others in the community
soon, I think Michael is on his way to start promoting it.  I suppose whatever feedback we
get from the majority will shape what we decide to do with it.

That being said, it would be good to record the progress of this issue here.  It's so close
to being done, there are only a few other methods I'd like to convert to properties.  I think
in some of the attributes there are methods like {{public string Term()}}, which are ideal
candidates for property conversion.
> Change Getxxx() and Setxxx() methods to .NET Properties
> -------------------------------------------------------
>                 Key: LUCENENET-470
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Sub-task
>          Components: Lucene.Net Contrib, Lucene.Net Core
>    Affects Versions: Lucene.Net 2.9.4, Lucene.Net 2.9.4g, Lucene.Net 3.0.3
>         Environment: all
>            Reporter: Christopher Currens
>             Fix For: Lucene.Net 3.0.3
> 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.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message