Skip to content

refactor(config): single-purpose composable classes#557

Open
MattSturgeon wants to merge 4 commits into
MinecraftFreecam:mainfrom
MattSturgeon:decouple-config-dto
Open

refactor(config): single-purpose composable classes#557
MattSturgeon wants to merge 4 commits into
MinecraftFreecam:mainfrom
MattSturgeon:decouple-config-dto

Conversation

@MattSturgeon

Copy link
Copy Markdown
Member

Extracted from #556, this is the general cleanup and refactoring done while working towards splitting off a separate :config Gradle project.

Merging this separately reduces per-PR scope, allowing #556 to focus on moving classes to the new :config project and introducing tests, while this PR focusses on the system cleanup and refactoring.

  • Separated the ModConfig implementation from the DTO class, moving it to a domain adapter ModConfigImpl.
  • Replaced SingletonModConfigController with separate DTO controller and domain-adapter controllers, which are composed in ModConfig.setup().
  • Moved controller registration out of ConfigControllerRegistry.init() and into ModConfig.setup().
  • Extracted different GsonConfigLoader responsibilities into new single-responsibility ConfigLoader and ConfigSerializer implementations, which are composed in ModConfig.setup().

De-couple the raw data (DTO) from domain logic (adapter).
Combine it into ModConfig propper.
Orchestrate & register composable config controllers from ModConfig.setup()

Split up knowledge of DTO and domain adapter.
Extract GsonConfigLoader's responsibilities into single-responsibility
ConfigLoader and ConfigSerializer implementations, which are composed in
`ModConfig.setup()`.
@MattSturgeon
MattSturgeon force-pushed the decouple-config-dto branch from 0982aea to 493e732 Compare July 26, 2026 07:50
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