For the convenient 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 aObject.B.Text = something
and now I use aObject.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 properties of its sub-classes. Is there any trade off?
Aucun commentaire:
Enregistrer un commentaire