Feature

interface Feature

A Feature is a Tegral software component that gets installed within an application.

Features themselves do things by:

  • Modifying the application's Tegral DI environment (e.g. adding components or DI extensions)

Creating a feature

Creating a feature can be done by implementing this interface in an object, e.g.

object MyFeature : Feature {
override val id: String = "my-feature"
override val name: String = "My Feature"
override val description: String = "My feature does this and that"

override fun install(context: FeatureContext) {
// Do something
}
}

Generally, features should not actually perform actions other than creating relevant classes within the DI environment of the application (i.e. the receiver of install).

Inheritors

Functions

Link copied to clipboard

Callback when this feature is installed onto an environment.

Properties

Link copied to clipboard

Dependencies for this feature. Dependencies are features that will be installed together with (but not necessarily before) your feature.

Link copied to clipboard
abstract val description: String

A short description of what your feature provides.

Link copied to clipboard
abstract val id: String

The identifier for this feature. Should be a lower case kebab-case string (e.g. this-is-my-feature).

Link copied to clipboard
abstract val name: String

The name for your feature, e.g. My Feature.