CloudBees Feature Management is an advanced feature flagging solution that lets your development teams quickly build and deploy applications without compromising on safety.
Features
-
Mobile-first: CloudBees Feature Management is the first feature flagging system built from the ground up to run directly inside phones, tablets, and wearables.
-
Simple: CloudBees Feature Management allows developers to focus on their business logic instead of the complex configurations on the dashboard.
-
Modern: Using static types, the compiler and IDE are responsible for preventing collisions, allowing easy flags discovery by developers (through autocomplete).
-
Support Optimizations: CloudBees Feature Management unique proposition is that it supports the company’s needs for a fully capable experimentation system, for A/B/N testing, optimizations, customizations, and more.
-
Remote configuration included: CloudBees Feature Management includes a remote configuration module that allows developers to define a configuration that can be controlled from the server.
ROX
public class ROX
ROX class is a static swift class that acts as a facade interface.
You can use this flag for the following:
-
Initialize CloudBees Feature Management SDK using
ROX.setup(withKey:)
. -
Register container instances using
ROX.register(_:)
. -
Retrieve container instances using
ROX.getContainer(_:)
. -
Load custom properties with
ROX.setCustomProperty(key:value:)
. -
Present the flags view controller with
ROX.flagsViewController()
.
Methods | Description | Declaration | Parameter | ||||
---|---|---|---|---|---|---|---|
setup(withKey:) |
|
|
|
||||
setup(withKey:options:) |
|
|
|
||||
register(_:) |
Register a container instance to CloudBees Feature Management system, the same instance can be retrieved by using ROX.getContainer(_:) function
|
|
|
||||
getContainer(_:) |
Retrieve an instance from type clazz that was registered with ROX.register(_:) |
|
Return Value The instance that was registered |
||||
sync() |
Recalculate the rules of experiments allocation based on new data. See Also ROX,unfreeze()
|
|
|||||
unfreeze() |
Unfreeze the state of all flags in code When a flag is used in code, its value gets frozen in the app until the next app foreground event. Calling this function will unfreeze all flags, and using a flag will return its most updated value. |
|
|||||
flagsViewController() |
|
|
Return Value ViewController which shows the local feature flags and provides an interface to turn them on or off. |
||||
setCustomProperty(key:value:) |
Sets a custom property value that can be used when creating target groups. |
|
|
||||
setCustomProperty(key:asSemver:value:) |
Sets a custom property value that can be used when creating target groups. |
|
|
||||
setCustomProperty(key:value:) |
|
|
|
||||
setCustomProperty(key:asSemver:value:) |
|
|
|
||||
setCustomProperty(key:value:) |
Sets a custom property value that can be used when creating target groups. |
|
|
||||
setCustomProperty(key:value:) |
|
|
value::a code block to return the value of the custom property |
||||
setCustomProperty(key:value:) |
Sets a custom property value that can be used when creating target groups. |
|
|
||||
setCustomProperty(key:value:) |
|
|
value::a code block to return the value of the custom property |
||||
setCustomProperty(key:value:) |
Sets a computed custom property value that can be used when creating target groups. |
|
|
||||
setCustomProperty(key:value:) |
Sets a computed custom property value that can be used when creating target groups. |
|
|
||||
roxDisabled() |
Check if ROX is disabled. |
|
|
Protocols
Protocols | Description |
---|---|
RoxContainer |
A container class for configurations and flags. Any Swift class that adopts this protocol can be used as an entry point for flags and containers that are controlled by the CloudBees Feature Management system. To use an instance of this class you need to register the instance using the ROX.register(:) method and retrieve the instance using ROX.get(:) method. |
- Here is an example of a class using flags and containers together
public class MyContainer : RoxContainer {
//group support feature flag
let groupSupport = RoxFlag()
// String configuration defaulted to "Hello World"
let message = RoxConfigurationString(defaultValue: "Hello World")
// Bool configuration default to true
let shouldShowBadge = RoxConfigurationBool(defaultValue: true)
// Int configuration default to 100
let popupTimeout = RoxConfigurationInt(defaultValue: 100)
// Double configuration default to
let ratio = RoxConfigurationDouble(defaultValue: 0.55)
}
// Register MyContainer class
ROX.register(MyContainer())
// Access MyContainer from any
let conf = ROX.get(MyContainer.self)!
// Use the Flag
conf.groupSupport.enabled {
print("group support enable code goes here")
}
print("Welcome message is '\(conf.message.value)'")
RoxFlag
This class is the API for flags that are controlled by CloudBees Feature Management server. Flags are assigned to an experiment and their value is based on the experiment container. The typealias RoxFlag is available globally.
open class ROXFlag : ROXVariant {
open var isEnabled: Bool { get }
open func enabled(_ codeBlock: (() -> Swift.Void)!)
open func disabled(_ codeBlock: (() -> Swift.Void)!)
open func enabled(_ enabledCodeBlock: (() -> Swift.Void)!, disabled disabledCodeBlock: (() -> Swift.Void)!)
open var name: String! { get }
}
public typealias RoxFlag = ROXFlag