考虑可读性、内存使用和其他原因,哪个是推荐的呢?
1.
如果您采用其他方式,那会是什么方式?为什么要这样做?
String strSomething1 = someObject.getSomeProperties1();
strSomething1 = doSomeValidation(strSomething1);
String strSomething2 = someObject.getSomeProperties2();
strSomething2 = doSomeValidation(strSomething2);
String strSomeResult = strSomething1 + strSomething2;
someObject.setSomeProperties(strSomeResult);
2.
someObject.setSomeProperties(doSomeValidation(someObject.getSomeProperties1()) +
doSomeValidation(someObject.getSomeProperties2()));
如果您采用其他方式,那会是什么方式?为什么要这样做?