Skip to content

[SPoA/Clean Code] Move configuration use cases out of WinForms event handlers #60

Description

@github-actions

Audit finding

ConfigurationForm and VisualProfileManagerForm directly:

  • resolve defensive settings snapshots;
  • invoke domain management services;
  • control settings transactions;
  • translate persistence failures;
  • choose notifications/dialog text;
  • manage refresh suppression;
  • build and update views.

This couples application-use-case rules to WinForms controls and causes forms to change for both presentation and domain-flow changes.

Target state

Introduce focused configuration use-case coordinators/presenters that own transactions and return explicit results for the forms to present.

Forms should:

  • translate control events to typed commands;
  • render immutable view models;
  • open dialogs;
  • display returned user messages.

Do not introduce a broad MVVM framework.

Acceptance criteria

  • WinForms classes no longer call domain mutation services directly.
  • Add/enable/remove/assign/edit operations are independently unit-tested.
  • Commit failure recovery and user messages have one application-layer owner.
  • Refresh suppression is expressed as an explicit result/event flow rather than form-specific flags where possible.
  • Forms remain responsible for presentation only.
  • Existing configuration and profile-manager behavior is preserved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions