The Rover SDK is broken up into separate modules. Each module contains an Assembler (described below) and a collection of services. A module may also contain models and UI components.
Each Rover module comes with an assembler. Before you can use a module in your
app you need to pass its assembler to the
Rover.initialize method when you
initialize the Rover SDK.
The Assemblers are in effect collections of factories that know how to construct each Rover component. This whole system constitutes a Dependency Injection system and can be reasoned about as such.
Below is an example of initializing the Rover SDK with just the Core module.
Rover.initialize( CoreAssembler(/* … */) )
Rover.initialize method instantiates the shared Rover instance and gives
each assembler the opportunity to register services to it. After a service has
been registered it can be accessed through the
Rover.sharedInstance.resolve method. Below is an example of
LogReceiver service—defined in the Core module—and
If you attempt to resolve a service defined in a module whose assembler was not
included when calling
method will return
A list of all the services in each module is included on the detail page for each module.
Each module’s assembler accepts a set of arguments that can be used to customize its behavior. Below is an example of customizing the core assembler to use a more verbose logging strategy.
Rover.initialize( CoreAssembler( chromeTabBackgroundColor = Color.RED ) )
Details on the customization options for each assembler are listed on each module's detail page.