-
Notifications
You must be signed in to change notification settings - Fork 11
Open
0 / 10 of 1 issue completedOpen
0 / 10 of 1 issue completed
Copy link
Description
Goal:
Refactor the application architecture by isolating all business logic from the Windows Forms UI. This will create a stable, comprehensively tested foundation (OpNode.Core) essential for supporting a Free/Pro tiered business model.
Rationale:
The current tight coupling with WinForms prevents reliable unit testing. This Epic restructures the application to handle naming conventions, core operations (e.g., ulu:op="sum"), and robust bidirectional serialization (XML and JSON) in a decoupled, testable library.
Epic Roadmap and Sub-Issues
Phase 1: Architectural Decoupling and Naming Conventions
Issue 1.1: Setup OpNode.Core and Test Projects
- Create
OpNode.Core(Class Library) for business logic. - Create
OpNode.Core.Tests(Unit Test Project). - Configure dependencies. CRITICAL:
OpNode.Coremust have NO dependency onSystem.Windows.Forms. - Define a base
NamingValidatorservice andValidationResultstructure in Core.
Issue 1.2: Refactor and Test Namespace Validation
- Implement
NamingValidator.ValidateNamespace(). - Write comprehensive unit tests for valid, invalid, reserved, and edge-case namespaces.
- Refactor the WinForms UI (e.g., LeftRight control) to use the Core validator.
Issue 1.3: Refactor and Test Prefix Logic
- Implement
NamingValidator.ValidatePrefix(). - Write unit tests covering standard and reserved prefixes.
- Refactor the WinForms UI.
Issue 1.4: Define and Test Suffix/Versioning Logic
- Implement
NamingValidator.ValidateSuffix(). - Write unit tests for suffix and versioning formats.
- Refactor the WinForms UI.
Phase 2: Data Modeling and Core Operations
Issue 2.1: Define the PNode/OpNode Data Model (DTO)
- Define the
PNodeclass structure. - Ensure the model supports hierarchical structures, namespaces, prefixes, suffixes, and attributes.
Issue 2.2: Define Operation Schema and Abstractions (ulu:op)
- Define an
IOperationinterface (or abstract class) with anExecute()method. - Create an
OperationResolverorOperationFactorythat maps the string identifier (e.g.,"sum") to a concreteIOperationinstance.
Issue 2.3: Implement and Test Basic Arithmetic Operations
- Implement
SumOperation,SubtractOperation,MultiplyOperation, andDivideOperation. - Write comprehensive unit tests for these operations, including edge cases (e.g., division by zero, overflow).
Phase 3: Serialization and Interoperability
Issue 3.1: Implement and Test XML Serialization Round-Tripping
- Implement
NodeXmlSerializer. - Ensure serialization correctly generates the required XML structure, including namespaces and attributes (e.g.,
<Node xmlns:ulu="..." ulu:op="sum" version="...">). - Write Round-Trip Tests: Serialize -> Deserialize -> Assert the resulting object is identical to the original.
Issue 3.2: Implement and Test JSON Serialization Round-Tripping
- Define the JSON schema (deciding how to represent XML-like concepts such as
ulu:opin JSON). - Implement
NodeJsonSerializer(usingSystem.Text.Json). - Write Round-Trip Tests for JSON.
Issue 3.3: Cross-Format Integrity Testing
- Implement tests to verify that a
PNodeserialized to XML and the samePNodeserialized to JSON can both be deserialized back into identical object structures.
This Epic will track the creation and progress of all sub-issues/tasks described above. Each sub-issue can be created as a separate GitHub issue and linked to this Epic for holistic tracking of architectural refactor and modernization.
Sub-issues
Metadata
Metadata
Assignees
Labels
No labels