Skip to content

Migrate NormalizeForm to use visitor pattern #42

Description

@darianmiller

Once Delphi.Forms.Visitor (#41) ships, migrate NormalizeForm in
Delphi.Forms.Normalize to use the visitor for traversal instead of
its ad-hoc recursive NormalizeObject procedure.

The visitor walks the tree; the normalization logic just checks each
object's properties and removes matching ones. This eliminates the
custom recursion through children and collection items.

Scope

  • Implement a TNormalizeVisitor that removes properties per rules
    in VisitObject
  • Replace NormalizeObject recursion with WalkForm(Form, Visitor)
  • NormalizeForm public API unchanged -- still takes TFormFile and
    TFormNormalizeRules
  • All existing normalization tests still pass with identical behavior

Acceptance criteria

  • All 16 normalization tests pass unchanged
  • No ad-hoc recursion remains in Delphi.Forms.Normalize
  • Public API unchanged (backward compatible)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions