Hi Bertrand,

On Tue, Nov 12, 2013 at 5:52 PM, Bertrand Delacretaz
<bdelacre...@apache.org> wrote:
> Hi,
>
> FYI I have created a minimal prototype [2] of how I'd see feature
> flags in Sling, as suggested a while ago by Henry Saginor in
> SLING-3148.

Look cool!

I have a couple of suggestions regarding the API:

1. I am typically wary of using Strings and am thinking that Enums
would be a nice fit for feature flags. Of course, we can't declare
them in our own API, since enum declarations can't be extended. But
how about having a FeatureFlag marker interface and them enums can
implement it?

public interface FeatureFlag { }

public enum MyAppFlags implements FeatureFlag {
  ENABLE_FEATURE_X,
  ENABLE_FEATURE_Y;
}

We can then invoke the FeatureFlags class:

featureFlags.isEnabled(ENABLE_FEATURE_X, req);

2. Background services don't have access to a request but would
probably still use feature flags. What would be a way around that?

Robert

>
> The slides at [1], that Tommaso tweeted today, are full of good ideas
> about this.
>
> -Bertrand
>
> [1] http://www.paulhammond.org/2010/06/trunk/alwaysshiptrunk.pdf
>
> [2] 
> https://svn.apache.org/repos/asf/sling/whiteboard/bdelacretaz/feature-flags



-- 
Sent from my (old) computer

Reply via email to