Files
DP44/docs/ai/Common/DTS.Common.Property/Model.md

39 lines
1.9 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common.Property/Model/GraphPropertyObject.cs
generated_at: "2026-04-17T16:10:18.442473+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "2d42a403a94ff001"
---
# Model
### Purpose
This module provides the abstract `BaseModel<TModel>` class, which serves as a foundational base class for creating model wrapper objects in the DTS system. It establishes a pattern for wrapping domain model objects with additional infrastructure (property change notification and persistence tracking) while maintaining type safety through generics.
### Public Interface
- **`BaseModel<TModel>`** (abstract class)
- Inherits from: `BasePropertyChanged`, implements `IBaseModel`
- Generic constraint: `TModel : class`
- **`TModel Model { get; set; }`** - Gets or sets the wrapped model object.
- **`bool IsSaved { get; }`** - Gets a value indicating whether the model has been saved. Has a private setter; no public method exists to set this to true.
- **`BaseModel()`** - Public parameterless constructor. Creates a new instance of the base class.
### Invariants
- `TModel` must always be a reference type (class constraint).
- `IsSaved` is initialized to `false` (default bool value) and can only be modified within the class itself.
### Dependencies
- **Depends on**: `BasePropertyChanged` (base class providing property change notification), `IBaseModel` (interface contract).
- **Depended on by**: Unknown from this source alone, but designed as a base class for model wrappers throughout the system.
### Gotchas
- The `IsSaved` property has a private setter but no method in this class ever sets it to `true`. Subclasses or external code cannot modify it, suggesting either incomplete implementation or that reflection/serialization is expected to set it.
- The class is abstract but has a public constructor (suppressed ReSharper warning indicates this is intentional, possibly for serialization or reflection scenarios).
---