Results 1 to 2 of 2

Thread: Enable/Disable application features

  1. #1
    Join Date
    Aug 2008
    Location
    Phoenix, AZ
    Posts
    76

    Default Enable/Disable application features

    I have a question regarding possible implementation alternatives to the one I'm currently using.

    The requirement: to be able to turn on/off particular features of an application at run time.

    Right now, we have a class that we call "applicationProperties" with a bunch of different properties (isFeatureXEnabled, isFeatureYEnabled, etc, etc) which the application code (and UI code in some cases) is using to determine whether or not to turn on/off a particular feature. What's nice is that we can export the "applicationProperties" file as an MBean and change/update its values at run time through the JMX console.

    My question:
    At the moment, our application code is riddled with awful if/else statements specifying whether a particular feature should be enabled.
    E.G.:

    if(isFeatureXEnabled()){
    .. do something...
    }

    other parts of the app:

    if(isFeatureYEnabled()){
    .. do something..
    }

    etc...

    Has anyone else run into a requirement such as this (ability to turn on/off features at run-time) without polluting and littering their code base with if/else statements?

    Thanks in advance for any input!
    Enterprise Software Consultant
    http://www.christianposta.com/blog

  2. #2
    Join Date
    Jan 2008
    Posts
    182

    Default It depends

    It depends what you mean by turning a feature off. If you mean that when accessing it a user gets a security exception then maybe spring-security method interception. If you mean that a feature is no longer accessible in the first place ...

Posting Permissions

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