How oskarowski/sudoku-desktop-game works
Project type and purpose
• This is a multi-module Maven project implementing a desktop Sudoku game with an MVC pattern and JavaFX UI.
• Modules:
• View – JavaFX GUI, controllers, user interactions, save/load strategies
• Model – core domain (board, solver, validation)
• Dao – file-based DAO implementation
• JdbcDao – JDBC/SQLite-based DAO implementation
File structure
• Top-level pom.xml aggregates 4 submodules: View, Model, Dao, JdbcDao.
• View
• App.java, controllers (GameController, MainMenuController), strategy interfaces/implementations for saving/loading.
• Model
• Domain objects (SudokuBoard, rows, columns, fields), solver (BacktrackingSudokuSolver), validation, exceptions, ResourceBundle for messages.
• Dao
• Generic DAO interface, file-based implementation (FileSudokuBoardDao), factory (SudokuBoardDaoFactory), read/write exceptions, logging.
• JdbcDao
• JDBC DAO (JdbcSudokuBoardDao), schema init, SQLite schema SQL, localized exception messages, connection/transaction exceptions.
• Tests in each module use JUnit Jupiter.
README for additional insights
• Confirms MVC, JavaFX, strategies for “Save to File” vs “Save to DB.”
• Dependencies: JOOQ, SQLite, SLF4J/Logback, JavaFX.
a. Main components
• Presentation Layer (View module)
• Domain Layer (Model module)
• Persistence Layer – File DAO (Dao module)
• Persistence Layer – JDBC DAO (JdbcDao module)
• External systems: File System, SQLite DB
• Infrastructure: Logging (SLF4J/Logback), i18n (ResourceBundle)
b. Relationships & interactions
• User → JavaFX View → Controllers
• Controllers ↔ Domain objects (create/validate/solve boards)
• Controllers use Save/Load Strategies → DAO factory → chosen DAO
• File DAO ↔ File System (object serialization)
• JDBC DAO ↔ SQLite DB (via JOOQ/JDBC)
• Model and DAO modules throw localised exceptions caught/logged by View
c. Architectural patterns & design principles
• MVC (View/controllers – Model – no separate Service layer)
• Strategy (SaveSudokuBoardStrategy / SaveSudokuBoardToFileStrategy / SaveSudokuBoardToDatabaseStrategy)
• Factory (SudokuBoardDaoFactory)
• Layered architecture: Presentation → Domain → Persistence
• Single Responsibility (each module focuses on one concern)
d. Key technologies/frameworks
• JavaFX (UI), FXML, ResourceBundle (i18n)
• Maven multi-module
• SLF4J + Logback (logging)
• JUnit Jupiter + JaCoCo (testing & coverage)
• SQLite + JOOQ/JDBC (DB access)
• Java Serialization (file-based DAO)
Elements
• from User → View
• View → Model
• View → Strategy → DaoFactory → (FileDao or JdbcDao)
• FileDao → File System
• JdbcDao → SQLite DB
• Blue for UI components
• Green for domain logic
• Orange for persistence
• Grey for external systems