Are "proxy properties" good style?
Posted
by erlando
on Stack Overflow
See other posts from Stack Overflow
or by erlando
Published on 2008-09-17T20:43:07Z
Indexed on
2010/04/04
5:03 UTC
Read the original article
Hit count: 269
I have a class with a string property that's actually several strings joined with a separator.
I'm wondering if it is good form to have a proxy property like this:
public string ActualProperty
{
get { return actualProperty; }
set { actualProperty = value; }
}
public string[] IndividualStrings
{
get { return ActualProperty.Split(.....); }
set
{
// join strings from array in propval .... ;
ActualProperty = propval;
}
}
Is there any risks I have overlooked?
© Stack Overflow or respective owner