Refactor: ExecuteUpdate Action Pattern
Summary
Refactor the executeUpdate() method in StatementServiceImpl to follow the Action pattern, extracting the logic into a dedicated ExecuteUpdateAction class.
Context
As part of the ongoing refactoring of StatementServiceImpl (a 2,528-line "God class"), we are extracting each public method into focused Action classes.
- Reference Implementation: The
connect() method (see PR #XXX) serves as the template for this transition.
Task Details
Extract the executeUpdate() logic from the service layer into a standalone action.
- Source Location:
StatementServiceImpl.executeUpdate() (line ~757)
- Target Class:
org.openjproxy.grpc.server.action.statement.ExecuteUpdateAction
- Complexity: Medium (Est. 100-120 lines). Involves statement preparation, parameter binding, execution, and result processing.
Implementation Steps
- Create Action: Implement
ExecuteUpdateAction using Action<StatementRequest, OpResult>.
- Extract Logic: Move the core logic from
StatementServiceImpl to the new class.
- Modularize: Consider creating
ExecuteUpdateInternalAction if logic reuse is required.
- State Management: Update the method to utilize
context.getSessionManager() and other shared state components.
- Delegate: Update the original service method to delegate calls:
public void executeUpdate(StatementRequest request, StreamObserver<OpResult> responseObserver) {
new ExecuteUpdateAction(actionContext).execute(request, responseObserver);
}
- Verify: Compile and execute the test suite.
Reference & Resources
| Resource |
Path/Link |
| Migration Guide |
../documents/designs/STATEMENTSERVICE_ACTION_PATTERN_MIGRATION.md |
| Reference PR |
PR #XXX (Connect Method) |
| Target Package |
org.openjproxy.grpc.server.action.statement |
Acceptance Criteria
Refactor: ExecuteUpdate Action Pattern
Summary
Refactor the
executeUpdate()method inStatementServiceImplto follow the Action pattern, extracting the logic into a dedicatedExecuteUpdateActionclass.Context
As part of the ongoing refactoring of
StatementServiceImpl(a 2,528-line "God class"), we are extracting each public method into focused Action classes.connect()method (see PR #XXX) serves as the template for this transition.Task Details
Extract the
executeUpdate()logic from the service layer into a standalone action.StatementServiceImpl.executeUpdate()(line ~757)org.openjproxy.grpc.server.action.statement.ExecuteUpdateActionImplementation Steps
ExecuteUpdateActionusingAction<StatementRequest, OpResult>.StatementServiceImplto the new class.ExecuteUpdateInternalActionif logic reuse is required.context.getSessionManager()and other shared state components.Reference & Resources
../documents/designs/STATEMENTSERVICE_ACTION_PATTERN_MIGRATION.mdorg.openjproxy.grpc.server.action.statementAcceptance Criteria
ExecuteUpdateActionclass created.StatementServiceImpl.ExecuteUpdateInternalAction) created if architectural complexity requires it.StatementServiceImpl.executeUpdate()correctly delegates to the new action.