以下の例のように、メソッド間でオブジェクトを渡し、データを追加する必要があります。以下に書かれたコードは良いプログラミングの実践ですか?
public void parentMethod(){
PropertyBean propertyBean = new PropertyBean();
propertyBean.SetValue1("Value1");
propertyBean = childMethod(propertyBean);
propertyBean.SetValue3("Value3");
}
public PropertyBean childMethod(PropertyBean propertyBean){
propertyBean.SetValue2("Value2");
return propertyBean;
}