Extract LookService from LookCommand and all callers #535

Merged
scion merged 2 commits from refactor/look-service-extraction into master 2026-06-08 13:40:15 -07:00
Owner

LookCommand.doLook() and doLookContainer() were static methods that required
passing RepositoryBundle and SessionAttributeService as parameters to every
call site. This made the call signature verbose and tightly coupled command
classes to infrastructure dependencies.

This change:

  • Extracts look() and lookContainer() into a new @Service LookService class
    with proper Spring DI of RepositoryBundle and SessionAttributeService
  • Updates all callers (LookCommand, GotoCommand, MoveCommand, TeleportCommand,
    TransferCommand, CharacterViewQuestion) to inject LookService via constructor
  • Removes static doLook/doLookContainer methods from LookCommand
  • Updates MoveConfiguration to wire LookService into MoveCommand beans
  • Adds comprehensive unit tests for LookService (room description, HOLYLIGHT
    admin info, other characters, items on ground, LINKDEAD flag, container
    contents)
  • Updates all existing command/question tests to mock LookService instead of
    calling the removed static methods
LookCommand.doLook() and doLookContainer() were static methods that required passing RepositoryBundle and SessionAttributeService as parameters to every call site. This made the call signature verbose and tightly coupled command classes to infrastructure dependencies. This change: - Extracts look() and lookContainer() into a new @Service LookService class with proper Spring DI of RepositoryBundle and SessionAttributeService - Updates all callers (LookCommand, GotoCommand, MoveCommand, TeleportCommand, TransferCommand, CharacterViewQuestion) to inject LookService via constructor - Removes static doLook/doLookContainer methods from LookCommand - Updates MoveConfiguration to wire LookService into MoveCommand beans - Adds comprehensive unit tests for LookService (room description, HOLYLIGHT admin info, other characters, items on ground, LINKDEAD flag, container contents) - Updates all existing command/question tests to mock LookService instead of calling the removed static methods
Extract LookService from LookCommand and all callers
All checks were successful
CI Build & Test / build-and-test (pull_request) Successful in 4m39s
734c6791f0
LookCommand.doLook() and doLookContainer() were static methods that required
passing RepositoryBundle and SessionAttributeService as parameters to every
call site. This made the call signature verbose and tightly coupled command
classes to infrastructure dependencies.

This change:
- Extracts look() and lookContainer() into a new @Service LookService class
  with proper Spring DI of RepositoryBundle and SessionAttributeService
- Updates all callers (LookCommand, GotoCommand, MoveCommand, TeleportCommand,
  TransferCommand, CharacterViewQuestion) to inject LookService via constructor
- Removes static doLook/doLookContainer methods from LookCommand
- Updates MoveConfiguration to wire LookService into MoveCommand beans
- Adds comprehensive unit tests for LookService (room description, HOLYLIGHT
  admin info, other characters, items on ground, LINKDEAD flag, container
  contents)
- Updates all existing command/question tests to mock LookService instead of
  calling the removed static methods
Merge branch 'master' into refactor/look-service-extraction
All checks were successful
CI Build & Test / build-and-test (pull_request) Successful in 4m33s
60995038de
suppress warning
All checks were successful
CI Build & Test / build-and-test (pull_request) Successful in 4m34s
50b4e02224
qwen force-pushed refactor/look-service-extraction from 50b4e02224
All checks were successful
CI Build & Test / build-and-test (pull_request) Successful in 4m34s
to b6a2e8b4d3
All checks were successful
CI Build & Test / build-and-test (pull_request) Successful in 4m39s
2026-06-08 12:09:01 -07:00
Compare
Merge branch 'master' into refactor/look-service-extraction
All checks were successful
CI Build & Test / build-and-test (pull_request) Successful in 4m35s
24ea2dc1a9
scion merged commit d75a6071fe into master 2026-06-08 13:40:15 -07:00
scion deleted branch refactor/look-service-extraction 2026-06-08 13:40:15 -07:00
Sign in to join this conversation.
No description provided.