8.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:22:29.046640+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 9dfaf004748c958d |
Documentation: View and ViewModel Interfaces for Assembly/Tile/Group Hierarchies
1. Purpose
This module defines a set of interfaces that establish a consistent MVVM (Model-View-ViewModel) pattern for hierarchical UI components representing assemblies, tiles, and groups. It provides abstract contracts for view interfaces (I*View) and view model interfaces (I*ViewModel) across two distinct namespace hierarchies (DTS.Common.Interface and DataPro.Common.Interface), likely supporting different UI frameworks or product lines. The interfaces enable decoupling of UI rendering logic (views) from data presentation logic (view models), with view models exposing strongly-typed references to their associated views and managing collections of child items (e.g., AssemblyList, GroupList). The structure supports nested groupings—e.g., a list of groups, each group containing assemblies or tiles.
2. Public Interface
View Interfaces (All inherit IBaseView)
| Interface | Namespace | Description |
|---|---|---|
IAssemblyView |
DTS.Common.Interface |
Marker interface for views displaying a single assembly. |
IAssemblyListView |
DTS.Common.Interface |
Marker interface for views displaying a list of assembly groups. |
ITileView |
DataPro.Common.Interface |
Marker interface for views displaying a single tile. |
IGroupView |
DataPro.Common.Interface |
Marker interface for views displaying a single group. |
ITileListView |
DataPro.Common.Interface |
Marker interface for views displaying a list of tile groups. |
IGroupListView |
DataPro.Common.Interface |
Marker interface for views displaying a list of groups. |
Note
: All view interfaces are empty (no members beyond inheritance). They serve as type-safe markers to associate view models with concrete view implementations.
ViewModel Interfaces (All inherit IBaseViewModel)
| Interface | Namespace | Key Members | Description |
|---|---|---|---|
IAssemblyViewModel |
DTS.Common.Interface |
IAssemblyView View { get; set; }string GroupName { get; set; }List<AssemblyNameImage> AssemblyList { get; set; } |
Represents a single assembly group’s data and behavior. Contains a list of AssemblyNameImage items. |
IAssemblyListViewModel |
DTS.Common.Interface |
IMainViewModel Parent { get; set; }IAssemblyListView View { get; set; }List<IAssemblyView> GroupList { get; set; } |
Represents a list of assembly groups. Holds references to child IAssemblyViews (not view models). |
ITileViewModel |
DataPro.Common.Interface |
ITileView View { get; set; }string GroupName { get; set; }List<AssemblyNameImage> AssemblyList { get; set; } |
Represents a single tile group’s data. Structurally identical to IAssemblyViewModel. |
IGroupViewModel |
DataPro.Common.Interface |
IGroupView View { get; set; }string GroupName { get; set; }List<AssemblyNameImage> AssemblyList { get; set; } |
Represents a single group’s data. Structurally identical to IAssemblyViewModel. |
ITileListViewModel |
DataPro.Common.Interface |
IMainViewModel Parent { get; set; }ITileListView View { get; set; }List<ITileView> GroupList { get; set; } |
Represents a list of tile groups. Holds references to child ITileViews. |
IGroupListViewModel |
DataPro.Common.Interface |
IMainViewModel Parent { get; set; }IGroupListView View { get; set; }List<IGroupView> GroupList { get; set; } |
Represents a list of groups. Holds references to child IGroupViews. |
Note
:
AssemblyNameImageis used in multiple view models but is not defined in this source set; its definition must be found elsewhere.IMainViewModelis referenced as a parent but not defined here.List<T>is used for collections (notObservableCollection<T>), despiteSystem.Collections.ObjectModelbeing imported in some files.
3. Invariants
- View-ViewModel Pairing: Each
I*ViewModelinterface declares aViewproperty typed to its correspondingI*Viewinterface (e.g.,IAssemblyViewModel↔IAssemblyView). This implies a strict 1:1 pairing between view and view model. - Hierarchical Consistency:
IAssemblyListViewModel.GroupListholdsIAssemblyViewinstances (notIAssemblyViewModel), suggesting the list is view-centric.- Conversely,
IAssemblyViewModel.AssemblyListholdsAssemblyNameImageobjects, indicating data content. - The same pattern holds for
TileandGroupvariants.
- Namespace Separation: Two disjoint sets of interfaces exist:
DTS.*namespace for Assembly-centric components.DataPro.*namespace for Tile/Group-centric components.
This suggests parallel UI architectures for different subsystems or product lines.
- No Validation Rules: No explicit validation or constraint logic is present in the interfaces themselves.
4. Dependencies
Internal Dependencies (from imports)
DTS.Common.Base→ DefinesIBaseViewandIBaseViewModel(not included here).DataPro.Common.Base→ DefinesIBaseViewandIBaseViewModel(not included here).System.Collections.Generic,System.Collections.ObjectModel,System.Reflection→ Standard .NET collections and reflection APIs.
External Dependencies (inferred)
- Consumers: Any UI layer (e.g., WPF, WinForms, or custom framework) implementing MVVM must implement these interfaces to bind views and view models.
- Dependents: Concrete implementations of these interfaces (e.g.,
AssemblyViewModel : IAssemblyViewModel) will depend on:AssemblyNameImagetype (forAssemblyList)IMainViewModel(forParentreference)- Concrete view classes implementing
I*Viewinterfaces.
5. Gotchas
- Namespace Splitting: The duplication of nearly identical interfaces across
DTS.Common.InterfaceandDataPro.Common.Interface(e.g.,IAssemblyViewModelvs.ITileViewModel) suggests legacy or parallel development paths. Developers must ensure correct namespace usage to avoid type conflicts or accidental mixing of subsystems. - View vs. ViewModel Collections:
IAssemblyListViewModel.GroupListstoresIAssemblyView(notIAssemblyViewModel).- This implies the view layer is responsible for managing child view instances, which is unconventional in MVVM (typically, view models manage child view models). This may indicate a design where views are composed manually or via a custom framework.
- Missing Collection Type Consistency:
ITileViewModelandIGroupViewModelimportSystem.Collections.ObjectModelbut useList<T>forAssemblyList. If observable notifications are needed,ObservableCollection<T>would be expected—this mismatch may cause issues if data binding relies on change notifications.
- No Method Signatures: All interfaces are property-only. Behavior (e.g., initialization, command binding) must be defined in base interfaces (
IBaseViewModel,IBaseView) or concrete implementations. - Ambiguous
GroupNameSemantics: TheGroupNameproperty appears inIAssemblyViewModel,ITileViewModel, andIGroupViewModel, but its meaning is unclear:- Is it the name of the group containing the assemblies/tiles?
- Or the name of the assembly/tile itself?
Context fromAssemblyListsuggests the former, but this is not explicit.
None identified from source alone for other areas (e.g., thread safety, lifecycle, nullability), as these are not specified in the interfaces.