Extending the SDK

The SDK is designed to be easily extendable by providing custom implementations of the RunningAbTestsFetcher and AbTestsCache interfaces. Once provided to the AbTesting object through the builder, these will be called by the AbTesting object in the flow.

Warning! Custom implementations should only be if you absolutely need them. Attraqt can not offer support with integration of custom implementations.

The interface for RunningAbTestsFetcher can be imported as:

com.attraqt.sdk.fhr.abtesting.retrieval

And for AbTestsCache this can be imported as:

com.attraqt.sdk.fhr.abtesting.caching

Both rely on the model for RunningAbTests provided in the following location:

com.attraqt.sdk.fhr.abtesting.model;

Please ensure that the A/B tests server URL is not hit as part of any custom AbTestsCache implementation. RunningAbTestsFetcher implementations should take responsibility for fetching the AB tests, whereas AbTestsCache implementations should only be responsible for caching the A/B tests provided to it, rather than doing any calls to the server.

Warning! When doing a custom implementation, please make sure to respect the minimum refresh time of 5 minutes, as otherwise we'd be forced to implement a throttling mechanism to avoid unnecessary load on our services.

Once the new object has been created, pass it to the AbTestingBuilder through the respective method (i.e. abTestsCache or runningAbTestsFetcher).

Last updated