GdlrCapability

Inherits: RefCounted < Object

Inherited By: CapGdlrCommandBus, CapGdlrCommandHandlers, CapGdlrCommandRouter, CapGdlrCommandTransport, CapGdlrJobs, CapGdlrJobsRegistry

Base class for capability contracts.

Description

A capability is an abstract class that names a set of methods. A module provides a capability with a service that extends it, and other modules consume the capability without knowing the service.

@abstract class_name CapScore
extends GdlrCapability

@abstract func add_points(amount: int) -> void

Capabilities are the usual tokens in the PROVIDERS, EXPORTS, and TREE_EXPORTS declarations of a GdlrModule. When a provider token is a capability, Godular asserts that the provided value extends it. Godular injects a typed property whose type is a capability automatically.

Tutorials