refactor(generator): factory method classes — IOFactory, IODispatcher, ClonerFactory (C32d Step 2d)#1132
Merged
Merged
Conversation
…, ClonerFactory (C32d Step 2d) 3 new method classes (parameterized instead of 6 separate): - IOFactoryMethod (Reader/Writer mode) — createModelReader/Writer switch - IODispatcherFactoryMethod (Reader/Writer mode) — dispatcher switch - ClonerFactoryMethod — createModelCloner with unique dispatcher pattern Factory stages now thin wrappers delegating to method classes. Added 5 FQN methods to CodeGenContext. Net -144 lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
3 new method classes for factory stage logic (parameterized to avoid 6 separate classes):
IOFactoryMethodcreateModelReader/Writer(ModelType)switchIODispatcherFactoryMethodcreateModelReader/WriterDispatcher(ModelType, ObjectNode)switchClonerFactoryMethodcreateModelCloner(ModelType)with unique dispatcher constructionFactory stages are now thin wrappers. Net -144 lines.
Smart observation by the agent: reader/writer factories are structurally identical (just class name substitution), so a single parameterized
IOFactoryMethodwithMode.READER/Mode.WRITERhandles both. Cloner has a unique pattern (nested dispatcher construction), so it gets its own class.Context
C32d Step 2d in #1042. Completes the method class extraction — every generated method now has a corresponding method class.
Test plan