I used to write basic class property implementations this way. This was boring and repetitive.
Style 1:
public class CaseDetails
{
public CaseDetails()
{ }
private string _impact = "";
private string _capacity = "";
public string impact
{
get
{
return _impact;
}
set
{
_impact = value;
}
}
public string capacity
{
get
{
return _capacity;
}
set
{
_capacity = value;
}
}
}
which is also equal to programming it rather this way (and much faster)
Style 2:
public class CaseDetails
{
public CaseDetails()
{ }
public string impact { get; set; }
public string capacity { get; set; }
}
The caveat is this writing style 1 only worked on .net 2.0 framework, moving to .net 3.5 enabled the developer to write in style 2 which cut costs on development time.
Getters and setters get faster. Say that 10 more times.