Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 1.81 KB

dependency-graph.md

File metadata and controls

38 lines (31 loc) · 1.81 KB

Dependency Graph

This graph shows the package/class-level dependencies within the src directory.

Core System Flow

graph TD
    Main[Main.java] --> AuthService[service.AuthService]
    Main --> LibraryService[service.LibraryService]
    Main --> ConsoleView[view.ConsoleView]
    Main --> InputUtil[util.InputUtil]
    Main --> model[model.*]
    
    AuthService --> UserDAO[dao.UserDAO]
    AuthService --> PasswordUtil[util.PasswordUtil]
    AuthService --> model.User
    
    LibraryService --> BookDAO[dao.BookDAO]
    LibraryService --> IssueDAO[dao.IssueDAO]
    LibraryService --> LibraryException[exception.LibraryException]
    LibraryService --> model.Book
    LibraryService --> model.IssueRecord
    
    dao[dao.*] --> DBConnection[util.DBConnection]
    dao --> model[model.*]
Loading

Layer Constraints

  1. model.* (Data objects) have NO dependencies on any other package in the application. They are pure data.
  2. dao.* depends heavily on java.sql.*, model.*, and util.DBConnection. DAOs do not know about services or views.
  3. service.* relies on dao.* for data and model.* for exchanging data structures. Services are isolated from user I/O.
  4. view.* depends on model.* (for rendering tables) and standard output streams (System.out). It knows nothing of DAOs or DB connections.
  5. Main coordinates the flow. It touches service.*, view.*, and util.InputUtil to orchestrate actions.

Critical Files / High Impact Files

  • src/util/DBConnection.java: Changes to database driver or credentials go here. Breaking this breaks the whole app.
  • src/Main.java: Coordinates all app flow and state (currentUser). Modifying session behavior starts here.
  • src/service/LibraryService.java: The core logic hub. Changing borrowing rules (e.g., maximum books) requires modifying this file.