username56283
Re:What Made OO Be Successful
on Sunday January 04, 2015 @11:10AM (#8834783)
What methods is this heating strategy going to call on water and stove? Consider for example that the stove builds up rust. Therefore it needs to know the properties of what's inside. Is the heating strategy going to tell it that?
Re:What Made OO Be Successful
on Sunday January 04, 2015 @10:50AM (#8834716)
What (from a code organization perspective) might work better in practice is:
water.heat(stove);
because it's the water that's being changed and change should be encapsulated. On the other hand, the stove may also change in the process. In fact, the water and the stove do things to each other. Then what makes either of the two options more appropriate? Similar issues arise with a method called sendMessage; is the object having this method now supposed to send a message or to receive a message?