Results 1 to 7 of 7
  1. #1
    MustSeeMelons is offline Member
    Join Date
    Oct 2012
    Posts
    38
    Rep Power
    0

    Default ActionSelector and Action design

    Hi,
    I have been given the task, to create two classes - ActionSelector and Action. The ActionSelector should print the possible actions (like a simple console menu) and then launch the appropriate Action. The idea is to not use simple println and readln from the console. I'm confused, tried searching, but couldn't find any useful information - maybe there are some tutorials or something for such a thing?

    Thank you for reading and have a nice day :)

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,310
    Blog Entries
    7
    Rep Power
    20

    Default Re: ActionSelector and Action design

    In the end you do have to print something on the console and read something from it, but maybe the exercise wants you to implement a 'menu' where a menu is a list of associations between Strings (to be printed) and Actions (to be executed); a 'managing' object orchestrates the menu, i.e. it prints its Strings, reads some choice from the user and executes the associated Action.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    MustSeeMelons is offline Member
    Join Date
    Oct 2012
    Posts
    38
    Rep Power
    0

    Default Re: ActionSelector and Action design

    Sorry for the late reply :( My e-mail provider marked this as spam and didn't get no notification.
    You were right, that was the main idea.
    An ActionSelector which you use to select an action and afterwards it executes the appropriate Action :)

  4. #4
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,598
    Rep Power
    5

    Default Re: ActionSelector and Action design

    Sorry you're too late now, Jos has already started drinking and won't be able to give a sane response until Monday.

    Serious: based on your last post I can't say if you still have a question or that you now have enough of a clue to go on to perform further research.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    MustSeeMelons is offline Member
    Join Date
    Oct 2012
    Posts
    38
    Rep Power
    0

    Default Re: ActionSelector and Action design

    Sorry that if the answer was ambiguous - research is done, and the code is running like a charm.
    Looks like it's time for me to start drinking too.

  6. #6
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,598
    Rep Power
    5

    Default Re: ActionSelector and Action design

    He he, happy drinking then ;)
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,310
    Blog Entries
    7
    Rep Power
    20

    Default Re: ActionSelector and Action design

    Hey, wait for me! What's all that drinking about?

    kindest regards,

    Jos ;-)
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Intent & action
    By johnsonjp34 in forum New To Java
    Replies: 0
    Last Post: 11-07-2012, 02:56 AM
  2. Preview design vs Run design
    By diamonddragon in forum NetBeans
    Replies: 3
    Last Post: 02-06-2012, 08:11 AM
  3. Replies: 1
    Last Post: 06-30-2011, 09:49 AM
  4. Replies: 3
    Last Post: 08-19-2010, 08:27 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
  •