For the convenience purpose, sometimes I use some indirect properties to set or get some other properties,
I give an example
class A
{
public string Text { set { b.Text = value; } get { return b.Text; }}
public B b {set; get;}
}
Without the Text property of the A I have to use myA.b.Text = something and now I use myA.Text = something
I would like to know if it is recommended or not and possible problems may arise by this approach?
Please note Text is not a real property of A and in this way it may represent many sub-properties. Is there any trade off?
Aucun commentaire:
Enregistrer un commentaire