When is an object-oriented approach inappropriate?

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 7267 Views - Last Post: 02 October 2013 - 06:58 PM

#16 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,692
  • Joined: 19-March 11

Re: When is an object-oriented approach inappropriate?

Posted 02 October 2013 - 06:58 PM

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".
Was This Post Helpful? 2
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2