You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Carsten Ziegeler <cz...@apache.org> on 2014/01/17 11:54:45 UTC
[FeatureFlags] Better support for the positive case?
Hi,
the current implementation (and API) of our feature flags is "optimized"
for what I call the negative case, which means if a feature is enabled, it
hides resources (negative = hiding).
>From some use cases, it seems that the positive case is very common: if a
feature is enabled, resources a visible (positive = visible). And if the
feature is not enabled, the resources are hidden.
So if you want to implement the negative case, your Feature returns true
for isEnabled if the feature is really active.
However, to implement the positive case, your Feature implementation
currently should return true if it's not enabled and false otherwise. Only
with this logic, it's possible to hide resources if the feature is not
enabled.
So it's possible to do this and maybe we just have to document it properly.
WDYT?
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: [FeatureFlags] Better support for the positive case?
Posted by Alexander Klimetschek <ak...@adobe.com>.
On 17.01.2014, at 05:10, Bertrand Delacretaz <bd...@apache.org> wrote:
>> Do you have a concrete use case for that ?
>
> Not me but I'm not running any Sling-based sites myself ;-)
>
> OTOH this is basic A/B testing, and also applies to soft launching a
> new feature (B) that replaces an existing one (A).
Apparently typical use cases are (from a discussion with our CMS product manager):
- test a certain new part of your website (some pages, just content) with only a few users
- test a new UI of your website (say a new navigation header, different components and/or content) with a few users (example: new features on facebook)
- A/B test a new UI of your website (say a new navigation header with 2,3,... variants; in addition to the old one) for a few users (and split them evenly for the A/B testing)
In all cases the feature flag would be something that is only enabled for a subset of users. How this works can be very dynamic, so it should be pluggable:
- known early adopters / power users
- geo location / geo ip (only users in Switzerland get the new feature)
- user profile data (for logged in users)
- cookie based
- random subset
- ...
Not sure if that is complete, but should be a good start. Especially the A/B part overlaps a lot with dedicated "targeting" solutions that are much more complex, especially in their end user UI to set up all the rules and different content. And they tend to focus on individual parts on websites, say just a banner or link snippet. I guess for feature flags the goal would be more broader - more on the level of entire sites.
Cheers,
Alex
Re: [FeatureFlags] Better support for the positive case?
Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,
On Fri, Jan 17, 2014 at 1:17 PM, Felix Meschberger <fm...@adobe.com> wrote:
> Am 17.01.2014 um 12:47 schrieb Bertrand Delacretaz <bd...@apache.org>:
...
>> Resource A is visible only if SomeFeature is not active.
>> Resource B is visible only if SomeFeature is active.
>> A and B are never visible simultaneously.
>> Having to create multiple related features for that would be a pain.
...
> Do you have a concrete use case for that ?
Not me but I'm not running any Sling-based sites myself ;-)
OTOH this is basic A/B testing, and also applies to soft launching a
new feature (B) that replaces an existing one (A).
-Bertrand
Re: [FeatureFlags] Better support for the positive case?
Posted by Felix Meschberger <fm...@adobe.com>.
Hi
Am 17.01.2014 um 12:47 schrieb Bertrand Delacretaz <bd...@apache.org>:
> Hi,
>
> On Fri, Jan 17, 2014 at 12:33 PM, Felix Meschberger <fm...@adobe.com> wrote:
>> Carsten wrote:
>>> From some use cases, it seems that the positive case is very common: if a
>>> feature is enabled, resources a visible (positive = visible). And if the
>>> feature is not enabled, the resources are hidden.
>>
>> That *is* IMHO the one and only case for feature flags with respect to resources....
>
> What if you want a feature flag to cause a switch between two resources?
>
> Resource A is visible only if SomeFeature is not active.
>
> Resource B is visible only if SomeFeature is active.
>
> A and B are never visible simultaneously.
>
> Having to create multiple related features for that would be a pain.
Do you have a concrete use case for that ?
Regards
Felix
>
> -Bertrand
Re: [FeatureFlags] Better support for the positive case?
Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,
On Fri, Jan 17, 2014 at 12:33 PM, Felix Meschberger <fm...@adobe.com> wrote:
> Carsten wrote:
>> From some use cases, it seems that the positive case is very common: if a
>> feature is enabled, resources a visible (positive = visible). And if the
>> feature is not enabled, the resources are hidden.
>
> That *is* IMHO the one and only case for feature flags with respect to resources....
What if you want a feature flag to cause a switch between two resources?
Resource A is visible only if SomeFeature is not active.
Resource B is visible only if SomeFeature is active.
A and B are never visible simultaneously.
Having to create multiple related features for that would be a pain.
-Bertrand
Re: [FeatureFlags] Better support for the positive case?
Posted by Bertrand Delacretaz <bd...@apache.org>.
On Fri, Jan 17, 2014 at 1:37 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> ...So I guess we have to recap the whole feature api...
And maybe update the use cases at
https://cwiki.apache.org/confluence/display/SLING/Sling+Feature+Flags+support
based on your new findings.
-Bertrand
Re: [FeatureFlags] Better support for the positive case?
Posted by Carsten Ziegeler <cz...@apache.org>.
Thanks Felix,
yeah now I see the light (and I really mean it this way) - so far I got
this feature stuff totally wrong and rather focused on hiding resources if
a feature is enabled - which doesn't make that much sense....
So I guess we have to recap the whole feature api - and I also think that
implementation wise it would be better to directly do this in the resource
resolver implementation. This way we can have a better and potentially more
performant implementation.
Carsten
2014/1/17 Felix Meschberger <fm...@adobe.com>
> Hi
>
> Hmm, I will have to read that stuff again, but I fear we are building an
> elephant instead of a mouse here …
>
> A Feature Flag will enable a feature if the flag is set. As a consequence,
> since a flag in general is *not* set by default, the corresponding feature
> is disabled by default.
>
> Am 17.01.2014 um 11:54 schrieb Carsten Ziegeler <cz...@apache.org>:
>
> > Hi,
> >
> > the current implementation (and API) of our feature flags is "optimized"
> > for what I call the negative case, which means if a feature is enabled,
> it
> > hides resources (negative = hiding).
>
> That is in fact wrong: Resources should actually be hidden, if the feature
> is *not* enabled. If the feature is enabled, resources are hidden.
>
> >
> > From some use cases, it seems that the positive case is very common: if a
> > feature is enabled, resources a visible (positive = visible). And if the
> > feature is not enabled, the resources are hidden.
>
> That *is* IMHO the one and only case for feature flags with respect to
> resources.
>
> >
> > So if you want to implement the negative case, your Feature returns true
> > for isEnabled if the feature is really active.
> > However, to implement the positive case, your Feature implementation
> > currently should return true if it's not enabled and false otherwise.
> Only
> > with this logic, it's possible to hide resources if the feature is not
> > enabled.
>
> This paragraph makes no sense at all (see above)
>
> Regards
> Felix
>
> >
> > So it's possible to do this and maybe we just have to document it
> properly.
> >
> > WDYT?
> > Carsten
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
>
>
--
Carsten Ziegeler
cziegeler@apache.org
Re: [FeatureFlags] Better support for the positive case?
Posted by Felix Meschberger <fm...@adobe.com>.
Hi
Hmm, I will have to read that stuff again, but I fear we are building an elephant instead of a mouse here …
A Feature Flag will enable a feature if the flag is set. As a consequence, since a flag in general is *not* set by default, the corresponding feature is disabled by default.
Am 17.01.2014 um 11:54 schrieb Carsten Ziegeler <cz...@apache.org>:
> Hi,
>
> the current implementation (and API) of our feature flags is "optimized"
> for what I call the negative case, which means if a feature is enabled, it
> hides resources (negative = hiding).
That is in fact wrong: Resources should actually be hidden, if the feature is *not* enabled. If the feature is enabled, resources are hidden.
>
> From some use cases, it seems that the positive case is very common: if a
> feature is enabled, resources a visible (positive = visible). And if the
> feature is not enabled, the resources are hidden.
That *is* IMHO the one and only case for feature flags with respect to resources.
>
> So if you want to implement the negative case, your Feature returns true
> for isEnabled if the feature is really active.
> However, to implement the positive case, your Feature implementation
> currently should return true if it's not enabled and false otherwise. Only
> with this logic, it's possible to hide resources if the feature is not
> enabled.
This paragraph makes no sense at all (see above)
Regards
Felix
>
> So it's possible to do this and maybe we just have to document it properly.
>
> WDYT?
> Carsten
> --
> Carsten Ziegeler
> cziegeler@apache.org