Results 1 to 2 of 2
  1. #1
    StateMachine is offline Member
    Join Date
    Dec 2011
    Posts
    22
    Rep Power
    0

    Default OO for calculations?

    Object orientation is swell when the program flow will be unknown. As when interacting with a user or with a network, or during multitasking like with a smart phone where anything might happen. Or when modelling a physical world with real physical objects.

    But if one will simply perform some calculations on some data, is OO then really helpful? There will be no surprises on the road. Code will be executed in the order A, B, C. Each part delivers its result to the next. Why not do it all in one static class?
    Last edited by StateMachine; 12-31-2011 at 08:00 AM.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: OO for calculations?

    I don't think unpredictability is as much of a concern as complexity. If A, B and C are single statements just stick 'em in a static main() and be happy.

    It's when things become more complex than that that some mechanisms are needed to manage what's going on. Using classes is one such mechanism. But only one.

Similar Threads

  1. Time calculations
    By Jason in forum New To Java
    Replies: 6
    Last Post: 09-29-2011, 09:42 PM
  2. Simple double calculations...
    By b0rt in forum New To Java
    Replies: 8
    Last Post: 08-31-2011, 03:01 PM
  3. Rounding calculations
    By lynxbci in forum New To Java
    Replies: 9
    Last Post: 08-20-2011, 03:49 PM
  4. Thread calculations, and another thread to use the calculations
    By phil128 in forum Threads and Synchronization
    Replies: 4
    Last Post: 12-12-2010, 04:32 PM
  5. decimal calculations?
    By arnab321 in forum CLDC and MIDP
    Replies: 5
    Last Post: 11-19-2008, 03:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •