Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #10871
| From | Novice <novice@example..com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Design Question |
| Date | 2011-12-19 13:34 +0000 |
| Organization | Your Company |
| Message-ID | <Xns9FC05753FF9BCjpnasty@94.75.214.39> (permalink) |
| References | <Xns9FBFC38D782BCjpnasty@94.75.214.39> <Score-20111219050746@ram.dialup.fu-berlin.de> |
ram@zedat.fu-berlin.de (Stefan Ram) wrote in
news:Score-20111219050746@ram.dialup.fu-berlin.de:
> Novice <novice@example..com> writes:
>>The game is capable of showing the score either during the game or at
>>the end. In both cases, I simply display a dialog showing the score.
>
> As a user I am annoyed by such informational dialogs,
> because they hide something and require my action.
> The score should better be displayed as a text field
> somewhere in the main game window.
>
Good point, Stefan. As it happens, I had the same thought as I was
composing the question and realized that I should simply be showing the
current score right on the game window itself, not making the player
request the score whenever he wants it.
But the basic issue of how to handle an issue like this still seemed like
an interesting one so I finished the question just to learn more about
the thought process that should be used in resolving this sort of
question.
>>finished, I entitle the dialog "Final Score". When the player is given
>>the interim score, the button at the bottom says "Quit" and he is
>>returned to
>
> »Quit« a score dialog? I think the usual button is »OK«,
> which is also nonsense, but at least common nonsense.
>
Yes, you're absolutely right. "OK" would make more sense.
>>At the moment, I have a single class that gets invoked to show both
>>the interim score and the final score.
>
> Classes can not be invoked. Methods can be invoked. What you
> mean is »a class, an instance of which is created to show ...«.
>
>>While the dialog is simple and works just fine, I suspect I'm
>>violating some OO principles by making the behavior of the
>>class change depending on what kind of score is being shown.
>
> I am not aware, whether such a principle exist, but you
> could also use:
>
> class InterimScore extends Score { public InterimScore(){ super( true
> ); }} class FinalScore extends Score { public FinalScore(){ super(
> false ); }}
>
Yes, I can see the advantage of that.
>>Or is there a better way?
>
> If your boolean approach is working fine, I see no need to
> change it. What you think of are the template method or
> strategy patterns, but there is no need to apply them here.
>
Thanks for explaining your reasoning to me, Stefan.
--
Novice
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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