Considering the question is about "when is an OO approach inappropriate", and we're in the Java Advanced discussion forum, it seems that this is very much a question about OO design, and not the fact that java's programming model frames all programs as classes.
I think the point has been made, yes, every java program involves at least one class and therefore could be treated as an object. However, that does not mean that the programmer is writing object-oriented code in any reasonable sense. It just means that this piece of fundamentally procedural code could, in principle, be called by some other object on the jvm. Fine, got that. The question is, when you write a craps game, do you always model the dice as Die objects, or are there situations where you simply call a "roll()" method twice and show the result?
And the answer, in my case, is still "it depends".
15 Replies - 9455 Views - Last Post: 02 October 2013 - 06:58 PM