-
Notifications
You must be signed in to change notification settings - Fork 2
Migrate FormObjectToJSON to use visitor pattern #44
Open
Description
Once Delphi.Forms.Visitor (#41) ships, evaluate migrating the JSON
serialization in Delphi.Forms.JSON to use the visitor for traversal.
This migration is less straightforward than NormalizeForm or Statistics
because JSON serialization builds a nested TJSONObject tree that mirrors
the AST hierarchy -- the visitor's flat callback model does not naturally
produce nested output. A stack-based approach in the visitor (push/pop
JSON objects on enter/leave) can work but adds complexity.
Scope
- Evaluate whether the visitor pattern simplifies or complicates the
JSON serialization code - If beneficial: implement a
TJsonVisitorwith a JSON object stack - If not beneficial: document the decision and close as won't-fix
- If migrated: all existing JSON tests pass with identical output
-
FormFileToJSONandFormObjectToJSONpublic API unchanged
Acceptance criteria
- Decision documented (migrate or skip with rationale)
- If migrated: all JSON tests pass, public API unchanged
- If skipped: ticket closed with explanation
Metadata
Metadata
Assignees
Type
Fields
Give feedbackNo fields configured for issues without a type.