refactor(examlense): reorganize backend into package-by-feature slices#13
Merged
Merged
Conversation
Converge the backend on package-by-feature vertical slices. Dissolve the layer-based api/ and persistence/ packages: each domain (exam, section, task, grading, admin) now owns its controller + service + entity + repository + DTOs, alongside the existing parse/solve/lgh slices. Keep cross-cutting technical modules shared (ai, storage, sse, security, config, error, prompts) and add a shared/ package for Access, Patch, and DefaultUser. Split the monolithic Dtos.java into per-slice DTO holders and the cross-domain CrudService into ExamService/SectionService/TaskService. Pure package reshuffle: no endpoint paths or DB schema change. Relocate tests beside their subjects and update the backend README project layout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
yinggez
approved these changes
Jul 15, 2026
yinggez
left a comment
Contributor
There was a problem hiding this comment.
Copilot:
✅ Architecture Refactoring Approved
Excellent execution of a complex package reorganization. The move from layer-based (api/, persistence/) to vertical slices is clean and well-structured.
Strengths:
- ✅ Clear ownership: Each domain slice (exam, section, task, grading, admin) owns its full stack (controller + service + entity + repo + DTOs)
- ✅ Reduced coupling: Cross-cutting modules (ai, storage, sse, security, config, error, prompts) properly centralized; no layer-based bottlenecks
- ✅ Focused services: CrudService decomposed into ExamService, SectionService, TaskService — each single-purpose
- ✅ Monolithic DTO split: Dtos.java eliminated; each slice holds focused DTO records (ExamDtos, SectionDtos, TaskDtos, etc.)
- ✅ Import consistency: All 72 files correctly updated; no dangling or broken references
- ✅ Tests relocated: All tests co-located with their subjects; naming and structure clear
- ✅ Transaction safety preserved: @transactional annotations and atomic operations intact across all services
- ✅ No functional changes: Pure restructuring — no endpoint paths or DB schema changes as promised
- ✅ Follows existing pattern: Aligns cleanly with parse/, solve/, lgh/ slices already in the codebase
Minor: SectionService handles both sections and blocks; consider adding a note in the docstring explaining the operational coupling if future maintainers find this non-obvious.
Ready to merge. 🚀
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.
Converge the backend on package-by-feature vertical slices. Dissolve the layer-based api/ and persistence/ packages: each domain (exam, section, task, grading, admin) now owns its controller + service + entity + repository + DTOs, alongside the existing parse/solve/lgh slices. Keep cross-cutting technical modules shared (ai, storage, sse, security, config, error, prompts) and add a shared/ package for Access, Patch, and DefaultUser.
Split the monolithic Dtos.java into per-slice DTO holders and the cross-domain CrudService into ExamService/SectionService/TaskService. Pure package reshuffle: no endpoint paths or DB schema change. Relocate tests beside their subjects and update the backend README project layout.