dart_subsystem 0.1.3
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, viarequirementsonSubsystemTypeDesc,SubsystemClassDescandSubsystem.- Concrete requirements:
SubsystemRequiresType,SubsystemRequiresClass(withfromDesc),SubsystemIncompatibleWithType,SubsystemIncompatibleWithClass(withfromDesc). SubsystemRequirementException: thrown (wrapped inSubsystemInitializationException) when a requirement is not satisfied.
0.1.2 #
Added #
kGlobalSubsystemTypeDesc: A predefinedSubsystemTypeDescfor 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/SubsystemClassDescexplaining 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:
SubsystemInstanceRegistryandSubsystemInstanceRegistryByTypeDescfor safe singleton storage and type-based lookup. - Factory System: Fluent
TSubsystemFactoryAPI 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
finalDisposeand protection against duplicate disposal calls. - Custom Exceptions: Typed error handling with
SubsystemInitializationExceptionandSubsystemNotFoundException.