Properties
Hi folks,
if I have a class A that has a property of type class B, is it good programming practice to simply say
private B _B;
public B b
{
get {return _B;}
set {_B = value;}
}
or should my get return a copy of _B rather than _B itself? Likewise, should my set store a copy of the passed value rather than the value itself, given that it's an object reference?
Ta
Answers
Know the answer? Post it. Somebody with the same question will find it here.