Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Design Question Date: Mon, 19 Dec 2011 22:22:27 +0000 (UTC) Organization: UK Free Software Network Lines: 37 Message-ID: References: NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1324333347 16399 84.45.235.129 (19 Dec 2011 22:22:27 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Mon, 19 Dec 2011 22:22:27 +0000 (UTC) User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT 30dc37b master) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10884 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 |