Skip to main content

dart_subsystem 0.1.3 copy "dart_subsystem: ^0.1.3" to clipboard
dart_subsystem: ^0.1.3 copied to clipboard

A lightweight, lifecycle-safe framework to manage singleton subsystems and services in Dart applications.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.1.3 - 2026-10-12 #

Added #

  • SubsystemRequirement (abstract): dependency or incompatibility checked at registration, via requirements on SubsystemTypeDesc, SubsystemClassDesc and Subsystem.
  • Concrete requirements: SubsystemRequiresType, SubsystemRequiresClass (with fromDesc), SubsystemIncompatibleWithType, SubsystemIncompatibleWithClass (with fromDesc).
  • SubsystemRequirementException: thrown (wrapped in SubsystemInitializationException) when a requirement is not satisfied.

0.1.2 #

Added #

  • kGlobalSubsystemTypeDesc: A predefined SubsystemTypeDesc for the global subsystem accessible from anywhere.

0.1.1 #

Added #

  • SubsystemInstanceRegistry.allInstancesWhere(predicate): cross-type lookup of active subsystem instances matching an arbitrary predicate.
  • SubsystemInstanceRegistry.allInstancesOfClass<T>(): cross-type lookup of active subsystem instances implementing/matching a given type or interface (e.g. a capability interface implemented by subsystems of any category).
  • Expanded doc-comments on SubsystemTypeDesc/SubsystemClassDesc explaining the decoupling rationale (shared package depends on a type, unaware of the concrete class each app registers).
  • example/example.dart: added a shared-type/multi-implementation walkthrough (notifications) and a capability-interface + global lookup walkthrough (boot participant).

0.1.0 Initial Release #

Added #

  • Subsystem Base: Core lifecycle management (beginConstruct, initialize, dispose, finalDispose).
  • State Tracking: Subsystems track their own state safely (isConstructed, isInitialized, isDisposed).
  • Registry System: SubsystemInstanceRegistry and SubsystemInstanceRegistryByTypeDesc for safe singleton storage and type-based lookup.
  • Factory System: Fluent TSubsystemFactory API to build, override, and disable subsystems conditionally before startup.
  • Fail-Safe Initialization: Graceful rollback and error tracking (lastFailedRegistrations) if a subsystem throws during initialization.
  • Idempotent Teardown: Guaranteed execution of finalDispose and protection against duplicate disposal calls.
  • Custom Exceptions: Typed error handling with SubsystemInitializationException and SubsystemNotFoundException.
1
likes
160
points
383
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A lightweight, lifecycle-safe framework to manage singleton subsystems and services in Dart applications.

Repository (GitHub)
View/report issues

Topics

#dart #subsystem #management #lifecycle #service

License

MIT (license)

Dependencies

meta

More

Packages that depend on dart_subsystem