Adding another variant of sorting by reviews in the Demo App
varghesep opened this issue · 1 comments
I'm looking at the .NET demo, and understand how the two sort_by_price sort_by_name variants work. To add another variant sort_by_review, I have to modify the current code. Is there any pattern that you have seen being used by .NET server side developers where variant tests can be created without impacting the existing variant tests code?
Thanks for the comment! Yes, you can add variable/dynamic configuration without the need for code changes. Starting in version 2.0 you can use feature variables, which are configurable outside of the SDK and the code that implements the SDK. Please see here for details on the feature variables API: https://developers.optimizely.com/x/solutions/sdks/reference/?language=csharp#get-feature-configuration
In the example above, the sort_property would just be a string variable that you can add to an experiment and in each variation you create, you can test out different string values there such as price, name, etc and in your code use that to dynamically determine which sorting function to use. Hope this helps.