I would vote for the first method. I think it is better that passing member data be left out. In the future, if the member data format is changed, the second format must always be changed, whereas the first format may not have to be.
The first format is also easily changed to a public method in the future should it turn out that has some usefulness.
I think the second technique (data in, data out, with no member data modified) would be best when declared public static, in cases where external methods would also have some use for it in a general purpose way. [ August 12, 2007: Message edited by: Red Smith ]
Joined: Aug 05, 2007
duplicate [ August 12, 2007: Message edited by: Red Smith ]
Joined: Nov 10, 2006
Thanks for your reply.
For me the first approach is more OO. It operate on objects variable. But from the other hand when I'am reading such code:
I can't find that doA and doB perform operations on someData. It is not clear ...
Hmmm, looks like there is no 'best approach', all depends on situation