Results 1 to 2 of 2
  1. #1
    mhadjis is offline Member
    Join Date
    Aug 2013
    Posts
    1
    Rep Power
    0

    Default design pattern for Switching Operation Modes

    Hi,
    I'm trying to create an application that has three operational modes (training, exercise production).
    I desire to know what design pattern I should use to optimize it.
    The logic is simple, the user must log in and then must choose which mode it wants to use.
    According to the selected mode, the business will be different.
    thank you in advance for your help
    mhadjis

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

    Default Re: design pattern for Switching Operation Modes

    You already said it yourself:

    Java Code:
    public interface OperationalMode { ... }
    public class Training implements OperationalMode { ... }
    public class Exercise implements OperationalMode { ... }
    public class Production implements OperationalMode { ... }
    Maybe you want a Factory too that creates the wanted OperationalMode object.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 5
    Last Post: 08-16-2012, 08:02 AM
  2. Design pattern question
    By garnaout in forum Advanced Java
    Replies: 2
    Last Post: 06-06-2012, 09:03 PM
  3. What's the design pattern(s) that describes...
    By starbuck in forum Advanced Java
    Replies: 3
    Last Post: 03-31-2012, 09:28 PM
  4. Need design pattern for ETL components
    By starbuck in forum Advanced Java
    Replies: 0
    Last Post: 03-23-2012, 12:52 PM
  5. Unknown design pattern
    By Steve11235 in forum Advanced Java
    Replies: 4
    Last Post: 07-02-2009, 01:40 PM

Posting Permissions

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