Files
DP44/enriched-qwen3-coder-next/Common/DTS.CommonCore/Interface/SystemSettings/ISOSettings.md

85 lines
6.3 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/Interface/SystemSettings/ISOSettings/IisoSettingsView.cs
- Common/DTS.CommonCore/Interface/SystemSettings/ISOSettings/IISOSettingsModel.cs
- Common/DTS.CommonCore/Interface/SystemSettings/ISOSettings/IISOSettingsViewModel.cs
- Common/DTS.CommonCore/Interface/SystemSettings/ISOSettings/IISOSettingsData.cs
generated_at: "2026-04-16T02:31:37.120937+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "7b8cfe6060429ed5"
---
# ISOSettings
## Documentation Page: ISO Settings Module
### 1. Purpose
This module defines the core interfaces for managing ISO (International Organization for Standardization) code settings within the systems settings infrastructure. It implements a standard Model-View-ViewModel (MVVM) pattern to decouple configuration data (`IISOSettingsData`), business logic/data persistence (`IISOSettingsModel`), and UI presentation (`IISOSettingsView` and `IISOSettingsViewModel`). Its role is to provide a structured, testable abstraction layer for storing, loading, and exposing user-configurable ISO-related display and validation preferences—such as whether ISO codes must be unique, which view modes are active, and which helper UI elements (e.g., code builder, channel lookup) are visible.
---
### 2. Public Interface
#### `IISOSettingsView`
- **Signature**: `interface IISOSettingsView : IBaseView`
- **Behavior**: Represents the view layer contract for ISO settings UI. Inherits from `IBaseView`, implying standard view lifecycle/interaction capabilities (e.g., data binding, initialization hooks). No additional members defined—implementation responsibility lies in concrete view classes.
#### `IISOSettingsModel`
- **Signature**: `interface IISOSettingsModel : IBaseModel`
- **Behavior**: Manages persistence of ISO settings.
- `void SaveData(IISOSettingsData data)`: Persists the provided `IISOSettingsData` instance.
- `IISOSettingsData LoadData()`: Retrieves and returns the current persisted ISO settings data.
Inherits from `IBaseModel`, implying standard model responsibilities (e.g., state management, validation hooks).
#### `IISOSettingsViewModel`
- **Signature**: `interface IISOSettingsViewModel : IBaseViewModel`
- **Behavior**: Orchestrates interaction between view, model, and data.
- `IISOSettingsView View { get; set; }`: Gets or sets the associated view instance.
- `IISOSettingsData ISOData { get; set; }`: Gets or sets the current ISO settings data model.
- `IISOSettingsModel Model { get; set; }`: Gets or sets the associated data persistence model.
Inherits from `IBaseViewModel`, implying standard MVVM behaviors (e.g., command binding, property change notification).
#### `IISOSettingsData`
- **Signature**: `interface IISOSettingsData : IBaseClass`
- **Behavior**: Encapsulates configurable ISO settings properties.
- `bool UniqueISOCodesRequired { get; set; }`: Controls whether duplicate ISO codes are disallowed.
- `IsoViewMode ISOViewMode { get; set; }`: Sets the current display mode for ISO codes (enum value from `DTS.Common.Enums`).
- `bool ShowISOStringBuilder { get; set; }`: Toggles visibility of the ISO code builder UI helper.
- `bool ShowChannelCodeLookupHelper { get; set; }`: Toggles visibility of the channel code lookup helper.
- `bool UseISOCodeFilterMapping { get; set; }`: Enables/disables filtering logic based on ISO code mappings.
- `bool ShowISOCodes { get; }`: *Read-only* flag indicating whether ISO codes should be displayed.
- `bool ShowUserCodes { get; }`: *Read-only* flag indicating whether user-defined codes should be displayed.
- `bool ChannelNamesOnly { get; }`: *Read-only* flag indicating whether only channel names (not codes) should be shown.
Inherits from `IBaseClass`, implying base functionality (e.g., equality, cloning—exact behavior depends on `IBaseClass` implementation).
---
### 3. Invariants
- **Data Integrity**: `SaveData` and `LoadData` must ensure data consistency—`LoadData()` should return a valid `IISOSettingsData` instance (non-null) representing the persisted state.
- **Read-Only Properties**: `ShowISOCodes`, `ShowUserCodes`, and `ChannelNamesOnly` are read-only; their values must be determined internally (e.g., derived from `ISOViewMode` or other settings) and not settable directly.
- **MVVM Coupling**: `IISOSettingsViewModel` requires all three dependencies (`View`, `Model`, `ISOData`) to be non-null for correct operation (enforced by implementation, not interface).
- **Enum Dependency**: `ISOViewMode` is defined in `DTS.Common.Enums`; its valid values and semantics must be consistent with the behavior of `ShowISOCodes`, `ShowUserCodes`, and `ChannelNamesOnly`.
---
### 4. Dependencies
#### Dependencies *of* this module:
- `DTS.Common.Base`: Provides base contracts (`IBaseView`, `IBaseModel`, `IBaseViewModel`, `IBaseClass`).
- `DTS.Common.Enums`: Defines the `IsoViewMode` enum used in `IISOSettingsData`.
#### Dependencies *on* this module:
- Any module implementing or consuming ISO settings (e.g., UI components, persistence layers, configuration services) must depend on these interfaces.
- Concrete implementations of `IISOSettingsView`, `IISOSettingsModel`, `IISOSettingsViewModel`, and `IISOSettingsData` are expected elsewhere in the codebase (not specified here).
---
### 5. Gotchas
- **Read-Only Properties**: `ShowISOCodes`, `ShowUserCodes`, and `ChannelNamesOnly` are read-only but may be computed from `ISOViewMode` or other settings. Modifying `ISOViewMode` could indirectly change these values.
- **No Validation Logic**: The interfaces define *what* data is stored and how its persisted but contain no validation rules (e.g., `UniqueISOCodesRequired` is a flag, but enforcement logic must reside in implementation).
- **Null Safety**: The `ViewModel` interface allows setting `View`, `Model`, or `ISOData` to `null`; implementations must handle null references gracefully (e.g., via guards or default instances).
- **No Explicit Error Handling**: `SaveData`/`LoadData` signatures do not declare exceptions—implementation may throw (e.g., on I/O failure), but callers must infer error paths.
- **Namespace Overlap**: All interfaces reside in `DTS.Common.Interface`, suggesting this is part of a shared core library; changes may impact multiple consumers.
None identified beyond the above.