Files
DP44/enriched-qwen3-coder-next/Common/DTS.Common/Events/ISO.md
2026-04-17 14:55:32 -04:00

3.9 KiB
Raw Blame History

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
Common/DTS.Common/Events/ISO/ExtraPropertiesChangedEvent.cs
2026-04-16T03:25:01.894095+00:00 Qwen/Qwen3-Coder-Next-FP8 1 61eef1209c66c784

ISO

1. Purpose

This module defines event infrastructure for propagating changes to extra properties within the ISO domain layer of the DTS system. Specifically, it provides a Prism-based pub/sub event (ExtraPropertiesChangedEvent) and its associated argument container (ExtraPropertiesChangedEventArgs) to decouple producers and consumers of property updates—enabling reactive UI or business logic components to respond when a collection of IExtraProperty instances is modified, while preserving provenance via Producer and Consumer references.


2. Public Interface

  • ExtraPropertiesChangedEvent

    • Type: class inheriting from PubSubEvent<ExtraPropertiesChangedEventArgs>
    • Behavior: A Prism PubSubEvent used to publish and subscribe to notifications about changes to extra properties. Subscribers receive an ExtraPropertiesChangedEventArgs payload.
  • ExtraPropertiesChangedEventArgs

    • Type: class
    • Constructor: ExtraPropertiesChangedEventArgs(IList<IExtraProperty> extraProperties, object producer, object consumer)
    • Properties:
      • IList<IExtraProperty> ExtraProperties { get; } — The updated collection of extra properties.
      • object Producer { get; } — The object instance that initiated or caused the change.
      • object Consumer { get; } — The object instance that is the intended recipient or target of the change.
    • Behavior: Encapsulates the data for an ExtraPropertiesChangedEvent payload. All properties are read-only after construction.

3. Invariants

  • ExtraProperties is non-null (enforced by constructor assignment; no null-check is present, so passing null will result in a NullReferenceException at runtime).
  • Producer and Consumer may be null (no validation is enforced in the constructor).
  • The ExtraProperties list reference is immutable in terms of property exposure (only a getter), but the contents of the list are not defensively copied—consumers must treat the list as potentially mutable if the producer retains a reference.
  • The event is strictly publish-once-per-change; no batching or deduplication semantics are implied.

4. Dependencies

  • Dependencies on this module:
    • DTS.Common.Interface.ISO.ExtraProperties — Provides the IExtraProperty interface used in ExtraPropertiesChangedEventArgs.ExtraProperties.
    • Prism.Events — Provides the PubSubEvent<T> base class.
    • System.Collections.Generic — Provides IList<T>.
  • Dependencies of this module:
    • This module is consumed by components that use Prism event aggregation (e.g., view models, services) to react to extra property changes in the ISO domain.
    • No other modules in this file depend on it—this is a leaf event definition.

5. Gotchas

  • No defensive copying: The ExtraProperties list is assigned directly from the constructor argument; if the caller mutates the list after constructing the args object, subscribers may observe unexpected changes.
  • No validation on Producer/Consumer: These may be null, and subscribers must handle this case explicitly.
  • No versioning or metadata: The event carries no timestamp, correlation ID, or change type (e.g., add/remove/replace), limiting traceability or differential processing.
  • Assumes Prism event aggregator usage: The class is tightly coupled to Prisms PubSubEvent<T>—not usable in isolation without Prism infrastructure.
  • No documentation on semantics of Producer vs Consumer: The distinction between the two is not clarified in the source—consumers must infer intent (e.g., Producer = source of change, Consumer = target component).