Skip to content

[Epic] Separate pNode from Windows Forms and TreeNode – SOLID Refactor Initiative #68

@marcnoon

Description

@marcnoon

Epic Objective

This epic tracks the complete decoupling of the legacy pNode class from the Windows Forms UI framework, specifically the TreeNode dependency, by implementing the SOLID-compliant architecture and migration strategy described in issue #67.

Goal

  • Achieve a fully testable, UI-agnostic core node data model
  • Ensure the core library (pWordLib) contains no direct references to Windows Forms or TreeNode
  • Provide a migration path with minimal disruption to the existing codebase

Tasks (Sub-issues)

  1. Create SOLID Core Interfaces
    • Implement INodeData and related interfaces in a new Interfaces folder.
  2. Implement Pure Data Model
    • Develop PNodeData in Implementation folder with no UI dependencies.
  3. Build Adapter Pattern for UI
    • Implement ITreeNodeAdapter and PNodeTreeAdapter in an Adapters folder to bridge with Windows Forms as needed.
  4. Add Initial Unit Tests for pWordLib library PR 70
    • Build working tests that are debuggable are runable.
  5. Write Comprehensive Unit Tests - Create a test suite for PNodeData focusing on data manipulation, attributes, and operations.
  6. Refactor Existing Code to Use New Interfaces
    • Gradually replace direct usage of pNode/TreeNode with INodeData/adapters throughout the codebase.
  7. Implement Dependency Injection
    • Refactor constructors/services to accept abstractions instead of concrete classes.
  8. Migrate Serialization and XML Logic
    • Move XML/serialization logic out of UI classes into pure service classes.
  9. Remove Legacy Windows Forms Dependencies
    • Deprecate/remove all Windows Forms references from pWordLib except in adapters.
  10. Document the Migration and API Changes
    • Update documentation to reflect the new architecture and usage patterns.
  11. Final Cleanup and Legacy Code Removal
    • Remove/deprecate the old pNode class and related obsolete code.

Each of these tasks will be tracked as a sub-issue under this epic. The epic is considered complete when all sub-issues are resolved, and pWordLib is UI-framework agnostic.


Reference: See Refactor pNode to align with solid principles for full context, architecture, and migration phases.

Acceptance Criteria:

  • No direct references to TreeNode or Windows Forms in core library code
  • All functionalities covered by unit tests
  • Adapters are the only UI-specific bridge
  • Documentation and codebase reflect the new design

This issue serves as the parent epic. Please link all related sub-issues here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions