Skip to content

JDBC project for TDT4145 Data Modelling, Databases and Database Management Systems

Notifications You must be signed in to change notification settings

clauswrm/TDT4145-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Training Diary

JDBC project for TDT4145 Data Modelling, Databases and Database Management Systems

By Ask Sommervoll, Claus Martinsen, Henrik Fauskanger and Nora Bodin

About

For this small project we implemented a Active Domain Object pattern for database access, providing a simple programmatic interface for retrieving and operating on the data.

WARNINIG: Because of the nature of this project, norwegian and english is used interchangebly in the source code (the GUI is in norwegian). It's bad practice but oh well...

How to run

  1. Run the updated SQL script for creating the required database structure on your preffered MySQL server.

  2. Run release_1.0.jar or the main method in the source code to launch the application.

  3. Click the Instillinger button to access database settings. Change the URL, username and password to match your setup.

Classes

Persistence

Our Active Domain Object classes represent the entities we care about in the database and provides the necessary methods for interacting with them.

The most important methods of all ADOs is:

  • .save(), which saves the objects state to the database.
  • .getAll() (static), which fetches all objects of a certain type (rows from a certain table) from the database.
  • .getById(int id) (static), which fetches a object with a certain ID from the database.

For in-depth information about how the classes work, see the respective JavaDoc.

Persistence diagram

UI

We use JavaFX for our GUI and have one Controller for each screen in the application. The controllers use our Active Domain Objects to interact with the database, decoupling UI from database logic.

Page is an Enum for all FXML pages.

TrainingApp is the Application which launches the JavaFX GUI.

UI diagram