Skip to content

refactor(scripting): collapse step POCOs onto virtual dispatch - #244

Merged
fuzzzerd merged 5 commits into
masterfrom
fuzzz/registry-synthesized-factories
Jul 12, 2026
Merged

refactor(scripting): collapse step POCOs onto virtual dispatch#244
fuzzzerd merged 5 commits into
masterfrom
fuzzz/registry-synthesized-factories

Conversation

@fuzzzerd

Copy link
Copy Markdown
Owner

Summary

  • Every typed script-step POCO now derives ScriptStep<TSelf> and overrides only the members whose behavior isn't shape-driven boilerplate (ToXml, ToDisplayLine, PopulateFromXml, PopulateFromDisplay) — collapsing what used to be a 3-category decision tree of hand-wired static factories into one rule
  • StepMetadata.FromXml/FromDisplay delegate properties are gone; StepRegistry registers a single uniform construction closure per step and lets ordinary virtual dispatch pick the right behavior
  • Test suite updated to go through the new typed Parse/StepDisplayFactory.TryCreate paths instead of calling the now-deleted metadata delegates directly

Test plan

  • dotnet build SharpFM.sln — no errors
  • dotnet test SharpFM.sln — 2222 passed (106 + 2116), matching the pre-refactor baseline
  • Swept Steps/ for stale static new / FromXml = / FromDisplayParams references — clean

fuzzzerd added 5 commits July 7, 2026 21:44
- StepRegistry falls back to shape-driven parsing (StepXmlParser /
  StepDisplayParser) when a step's FromXml/FromDisplay is null
- Add ScriptStep<TSelf>, a CRTP base supplying shape-driven
  ToXml/ToDisplayLine/Parse defaults
- Per-step delegates stay explicit for now; trampolines get deleted
  mechanically next
- StepMetadata drops FromXml/FromDisplay entirely; nothing outside
  StepRegistry's own bridge ever read them
- ScriptStep gains PopulateFromXml/PopulateFromDisplay; ScriptStep<TSelf>
  supplies shape-driven defaults and a typed static Parse
- StepRegistry registers one uniform construction closure per step;
  customization is ordinary virtual dispatch, not a delegate lookup
- StepXmlParser/StepDisplayParser expose Populate(instance, ...) to
  populate an existing instance, used by both the typed Parse path and
  the registry's closure
- Every step now derives ScriptStep<TSelf>, including the 7 previously
  hand-XML steps (CommentStep, GoToLayoutStep, PerformScript family,
  TruncateTableStep) that used to stay on plain ScriptStep
- Deleted boilerplate ToXml/ToDisplayLine overrides and FromXml/
  FromDisplayParams trampolines wherever shape-driven defaults suffice
- Converted hand-written FromXml/FromDisplayParams into
  PopulateFromXml/PopulateFromDisplay overrides that mutate the
  constructed instance instead of returning a new one
- One rule replaces the old 3-category (5-bucket) decision tree: derive
  the generic base, override only non-boilerplate members
- Replace direct Metadata.FromXml!/FromDisplay! calls (unsafe now that
  they're gone from StepMetadata) with X.Parse(...) and
  StepDisplayFactory.TryCreate(...)
- NoInteractSemanticTests goes through StepXmlFactory.Create instead of
  a per-metadata delegate lookup
- Add trivial PopulateFromXml/PopulateFromDisplay stubs to the plain-
  ScriptStep test doubles in StepXmlParserTests/StepDisplayRendererTests/
  StepXmlRendererTests, which exercise the shape engine directly and
  never go through virtual dispatch
Advanced FileMaker Scripting Syntax reference still named the deleted
static method; update to match the virtual PopulateFromDisplay override.
@github-actions

Copy link
Copy Markdown

Test Results

✔️ Tests 2222 / 2222 - passed in 17.5s
✔️ Coverage 79.52% - passed with 70% threshold
📏 11364 / 13459 lines covered 🌿 3509 / 5244 branches covered
🔍 click here for more details

✏️ updated for commit 2bc6b3f

@fuzzzerd fuzzzerd changed the title Collapse script-step parsing onto virtual dispatch refactor(scripting): collapse step POCOs onto virtual dispatch Jul 12, 2026
@fuzzzerd
fuzzzerd merged commit 2daf88b into master Jul 12, 2026
6 checks passed
@fuzzzerd
fuzzzerd deleted the fuzzz/registry-synthesized-factories branch July 12, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant