Where is the best place to put an appication variable???

Discussion in 'Java' started by simon_s_li@hotmail.com, Oct 26, 2005.

  1. Guest

    Hi,

    I need to store a value, which tells us what mode an application is in.

    Basically it needs to be stored on an application level.

    Can someone please advise me the best place to store this value, where
    it can be accessed from any where within the system.

    Thanks
    Simon
    , Oct 26, 2005
    #1
    1. Advertising

  2. Roedy Green Guest

    On 26 Oct 2005 03:49:52 -0700, wrote, quoted or
    indirectly quoted someone who said :

    >Can someone please advise me the best place to store this value, where
    >it can be accessed from any where within the system.


    The easiest place is in a flat file. If you want to get fancy, in
    Windows you can put it in the registry.

    Probably the safest place is in a database.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Oct 26, 2005
    #2
    1. Advertising

  3. Guest

    I already read the value from a xml file, but I need to store it
    somewhere in the application at an application level.

    The reason we need this is we aim to have 2 versions of the
    application, but on 2 separate servers. What needs to happen is that
    when the application deploys or loads, it reads an xml file and that
    will decide what menus will be displayed based on the value.

    This means it cannot be stored on the database because they both point
    to the same database.

    It cannot be in registry or flat file.

    Any other ideas?

    Regards
    Simon
    , Oct 26, 2005
    #3
  4. Malte Guest

    wrote:
    > I already read the value from a xml file, but I need to store it
    > somewhere in the application at an application level.
    >
    > The reason we need this is we aim to have 2 versions of the
    > application, but on 2 separate servers. What needs to happen is that
    > when the application deploys or loads, it reads an xml file and that
    > will decide what menus will be displayed based on the value.
    >
    > This means it cannot be stored on the database because they both point
    > to the same database.
    >
    > It cannot be in registry or flat file.
    >
    > Any other ideas?
    >
    > Regards
    > Simon
    >


    If webapp, store it in web.xml
    Malte, Oct 26, 2005
    #4
  5. wrote:
    > I already read the value from a xml file, but I need to store it
    > somewhere in the application at an application level.
    >
    > The reason we need this is we aim to have 2 versions of the
    > application, but on 2 separate servers. What needs to happen is that
    > when the application deploys or loads, it reads an xml file and that
    > will decide what menus will be displayed based on the value.
    >
    > This means it cannot be stored on the database because they both point
    > to the same database.
    >
    > It cannot be in registry or flat file.
    >
    > Any other ideas?
    >
    > Regards
    > Simon
    >


    Well I think I would store it as an instance or class variable in the
    class where I read the XML file. No sense getting too complicated.

    --

    Knute Johnson
    email s/nospam/knute/
    Knute Johnson, Oct 26, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pa Ji
    Replies:
    3
    Views:
    431
    Pa Ji
    Jun 27, 2003
  2. Arvind P Rangan

    Where is best place to put DB connection string?

    Arvind P Rangan, Mar 1, 2004, in forum: ASP .Net
    Replies:
    8
    Views:
    614
    Martin Dechev
    Mar 1, 2004
  3. Fernando Lopes
    Replies:
    5
    Views:
    2,272
    Ken Cox [Microsoft MVP]
    Mar 30, 2005
  4. Replies:
    0
    Views:
    1,211
  5. Gian Holland
    Replies:
    0
    Views:
    86
    Gian Holland
    Jan 9, 2008
Loading...

Share This Page