ApplicationClassExtensionConfig

data class ApplicationClassExtensionConfig(val applicationClassExtensionBuilderName: String, val implementationModule: ModuleReference, val subPackageName: String? = null, val dependencies: IviServiceDependencies = IviServiceDependencies())

Defines the reference to an application class extension implementation and how to configure it.

TomTom Digital Cockpit plugins can extend the Android application class with additional functionality, without extending the Application class itself. This allows integrators to include or exclude TomTom Digital Cockpit applications without modifying the Application class.

TomTom Digital Cockpit plugins can extend the Android application class by implementing com.tomtom.ivi.platform.framework.api.product.application.IviApplicationExtension and com.tomtom.ivi.platform.framework.api.product.application.IviApplicationExtensionBuilder. See IviApplicationConfigurator.applicationClassExtensions or IviDefaultsGroupConfigurator.addApplicationClassExtensions to register the extension.

Note: The extensions share the same lifecycle as the Android application class. They are created at startup of each process that is started for the application and remain alive as long as the process is alive. Android processes can remain alive even if the process is not used any longer for any component, but they also can be killed at any time. Therefore, application extensions are glorified singletons. As singletons are considered a design anti-pattern, implementing an application extension is a last resort solution and should be avoided if possible.

Parameters

applicationClassExtensionBuilderName

The name of the application class extension builder class.

The application class extension builder name must be formatted in PascalCase and must end with the ApplicationExtensionBuilder suffix. The ApplicationExtensionBuilder suffix is mandatory to make it easier for developers to find where the class is used in the code base.

The application class extension builder name needs to match a class with the same name that implements the com.tomtom.ivi.platform.framework.api.product.application.IviApplicationExtensionBuilder class.

implementationModule

The module that contains the class that implements the com.tomtom.ivi.platform.framework.api.product.application.IviApplicationExtensionBuilder class.

The package name of the class is obtained from this ModuleReference. If the class resides in a sub package within this module, the sub package can be provided through subPackageName. This subPackageName is appended to the package name of the module, with a period in between.

subPackageName

Optional sub package. If not null, this value is appended to the ModuleReference.packageName of the implementationModule property with a period in between.

dependencies

IVI service dependencies of the application class extension implementation.

An application class implementation can require other IVI service interfaces to be registered. This allows misconfiguration to be detected at build time.

Constructors

Link copied to clipboard
constructor(applicationClassExtensionBuilderName: String, implementationModule: ModuleReference, subPackageName: String? = null, dependencies: IviServiceDependencies = IviServiceDependencies())

Types

Link copied to clipboard
object Companion

Properties

Functions

Link copied to clipboard

Copies this ApplicationClassExtensionConfig, adds the given dependencies to the copied instance, and returns it.