Connected userCli and SearchCli into App#11
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe pull request refactors the application architecture to introduce structured initialization and dependency management. It moves from direct EntityManager boilerplate to a centralized startup sequence that constructs UserRepository, UserService, UserCLI, and SearchCli, then runs a persistent application loop. SearchCli is refactored to accept dependencies via constructor rather than managing them internally. Changes
Sequence DiagramsequenceDiagram
participant App
participant EMF as EntityManagerFactory
participant UserRepo as UserRepository
participant UserSvc as UserService
participant UserCLI
participant SearchCli
participant Scanner
App->>App: initialize()
App->>EMF: Create & warmup
App->>UserRepo: Construct with EntityManager
App->>UserSvc: Construct with UserRepository
App->>UserCLI: Construct with dependencies
App->>SearchCli: Construct with Scanner & EntityManager
loop appRunning
App->>App: Render login-aware menu
App->>Scanner: Read user input
alt User logged in
App->>UserCLI: Handle user action
App->>SearchCli: bookSearchCli()
else User not logged in
App->>UserCLI: Show login/register
end
end
App->>App: terminate()
App->>EMF: Close factory
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.