Hi,
we are using Togglz and we really like it!
I especially like the way features are configured in the source code and how you can add a label via annotations.
We need some default values for the parameters of the activation strategies. I know you can do that via a property file.
But I like the idea of adding the activation strategy parameters to the feature in the source code via annotation, so that the whole feature is configured in one place...
Something like this:
public enum MyFeatures implements Feature {
@EnabledByDefault
@Label("First Feature")
FEATURE_ONE,
@Label("Second Feature")
@ActivationStrategy(id = UsernameActivationStrategy.ID,
activationParameter = {@ActivationParameter(name = UsernameActivationStrategy.PARAM_USERS, value = "person1,ck,person2"),
@ActivationParameter(name =....)})
FEATURE_TWO;
public boolean isActive() {
return FeatureContext.getFeatureManager().isActive(this);
}
}
What do you think?
I would send a pull request if you like the idea :-)
Thanks,
Kai