For advanced use cases, you can extend the SRE by adding entirely new subsystems. A subsystem is a major functional unit of the SRE that provides a specific set of services, powered by its own set of pluggable connectors.
Creating a new subsystem is the most advanced way to extend the SRE and should be reserved for when you need to add a completely new category of functionality that doesn't fit within the existing subsystems.
A new subsystem typically consists of:
A Service Provider Class: This is the main entry point for your subsystem. It inherits from ConnectorServiceProvider
and is responsible for managing the subsystem's connectors.
A Connector Interface: An interface (e.g., IMyNewServiceConnector
) that defines the contract that all connectors for this subsystem must adhere to.
One or More Connector Implementations: Concrete classes that implement your connector interface for specific backends.
A Unique Service Enum: A unique identifier for your subsystem, which you add to the TConnectorService
enum.
Define the Interface: Create your IMyNewServiceConnector.ts
file, defining the methods and properties for your new service type.
Create the Service Provider: Create a class MyNewService extends ConnectorServiceProvider
to manage the registration and retrieval of your new connectors.
Implement Connectors: Build one or more classes that implement your new interface.
Integrate with SRE:
SRE
class, giving it a namespace (e.g., SRE.MyNewSystem
).MyNewService
provider within the SRE's constructor.init
and ready
methods to handle the configuration and initialization of your new subsystem.Due to the complexity and deep integration required, creating a new subsystem should be done with a thorough understanding of the SRE's core architecture. It is often recommended to first explore creating custom components or connectors to see if they can meet your needs.