Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #10884

Re: Design Question

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Design Question
Date 2011-12-19 22:22 +0000
Organization UK Free Software Network
Message-ID <jcodf3$g0f$1@localhost.localdomain> (permalink)
References <Xns9FBFC38D782BCjpnasty@94.75.214.39> <p2FHq.27831$2e7.8589@newsfe18.iad> <Xns9FC059C13891Ejpnasty@94.75.214.39>

Show all headers | View raw


On Mon, 19 Dec 2011 13:49:04 +0000, Novice wrote:

> Agreed. This is actually an older program that I am bringing up to date
> and I'm trying to be truer to OO principles in it than I was in the
> original coding. I thought of doing the abstract class and the two
> sibling subclasses but wanted to make sure that was the right OO
> approach. But the whole question disappears entirely if I put the score
> on the main game window and keep it updated as the score changes.
>
I'd normally take a somewhat different approach: since this game is all 
about the user interacting with a graphical front end, I'd design the GUI 
first and think about the class structure only when happy with that. 

IMO the design of the GUI is extremely important and deserves a lot of 
care because, if its poor as many GUI designs are, the application will 
suffer because people are going to be less enthusiastic about using it 
regardless of how good the design and code behind it may be.

In this case I agree with everybody else as far as the score goes: its an 
integral part of the game so it belongs on the main window as a permanent 
display field. If the game has a status display bar, that's where it 
belongs. Since most GUI programs have a menu bar containing Help and 
About operations, I'd p-rovide one for the game too and put an 'Exit' 
button in the conventional place in a drop-down 'File' menu, right under 
a 'Save game state' item (if you need one), where it could be used at any 
time.

I'd consider using a JOptionPane dialog that only gets shown at the end 
of the game when it pops up to display 'Exit' and 'Another game' buttons 
so the user can decide whether to exit or start another game. Needless to 
say, it needs to be positioned so it doesn't hide the final score.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Design Question Novice <novice@example..com> - 2011-12-19 00:13 +0000
  Re: Design Question Arne Vajhøj <arne@vajhoej.dk> - 2011-12-18 19:24 -0500
    Re: Design Question ilAn <idonot@wantspam.net> - 2011-12-20 16:47 +0200
      Re: Design Question Arne Vajhøj <arne@vajhoej.dk> - 2011-12-20 10:39 -0500
  Re: Design Question markspace <-@.> - 2011-12-18 19:23 -0800
    Re: Design Question Novice <novice@example..com> - 2011-12-19 13:26 +0000
    Re: Design Question Novice <novice@example..com> - 2011-12-19 13:28 +0000
  Re: Design Question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-12-19 07:16 -0400
    Re: Design Question Novice <novice@example..com> - 2011-12-19 13:49 +0000
      Re: Design Question Martin Gregorie <martin@address-in-sig.invalid> - 2011-12-19 22:22 +0000
        Re: Design Question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-12-19 20:13 -0400
          Re: Design Question Lew <lewbloch@gmail.com> - 2011-12-20 07:37 -0800
            Re: Design Question Arne Vajhøj <arne@vajhoej.dk> - 2011-12-20 10:42 -0500
              Re: Design Question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-12-20 17:46 -0400
        Re: Design Question Martin Gregorie <martin@address-in-sig.invalid> - 2011-12-20 20:40 +0000
  Re: Design Question Novice <novice@example..com> - 2011-12-19 13:34 +0000
  Re: Design Question Roedy Green <see_website@mindprod.com.invalid> - 2011-12-19 06:25 -0800
  Re: Design Question Gene Wirchenko <genew@ocis.net> - 2011-12-19 11:38 -0800
    Re: Design Question Lew <lewbloch@gmail.com> - 2011-12-20 07:42 -0800
      Re: Design Question Gene Wirchenko <genew@ocis.net> - 2011-12-20 11:51 -0800
        Re: Design Question soulspirit@gmail.com - 2011-12-20 14:55 -0800
          Re: Design Question Gene Wirchenko <genew@ocis.net> - 2011-12-20 15:25 -0800
            Re: Design Question soulspirit@gmail.com - 2011-12-21 01:11 -0800
              Re: Design Question Gene Wirchenko <genew@ocis.net> - 2011-12-21 11:08 -0800
                Re: Design Question soulspirit@gmail.com - 2011-12-21 15:27 -0800
                Re: Design Question Gene Wirchenko <genew@ocis.net> - 2011-12-21 18:06 -0800

csiph-web