Skip to content

MurtadhaAlobaidi/soundgood-music-school

Repository files navigation

Description This project "Soundgood Music School" on KTH-Data Storage Paradigms(IV1351). The purpose is to facilitate information handling and business transactions for the Soundgood music school company, by developing a database which handles all the school's data and also an application that can handle some of the transactions.

Architecture

This project follows the Model-View-Controller (MVC) architectural pattern:

Model

  • Located in src/main/java/model/
  • Contains the business logic and data structures
  • Includes classes like Instrument and InstrumentDTO that represent the core domain objects
  • Handles business rules and data validation through exceptions like RentException

View

  • Located in src/main/java/view/
  • Manages the user interface and command-line interaction
  • BlockingInterpreter handles user input and command interpretation
  • Presents data to users through formatted console output
  • Implements commands through the Command interface

Controller

  • Located in src/main/java/controller/
  • Acts as an intermediary between Model and View
  • Processes user commands from the View
  • Coordinates with the Model layer and database operations
  • Uses SchoolDAO for database interactions

Built With languages

TOOLS

This tools was helpeing to built this project.You can download them from here:

To connect java application with the database using JDBC.

We used Eclipse to build a Maven-project and connected a database with JAVA using JDBC.

You need to add the JDBC file to your project on Eclipse.You can download them from here:

PostgreSQL JDBC Driver Postgresql JDBC

How to Execute

  1. Clone this git repository. git clone https://github.com/mhaao/Soundgood-Music-School.git
  2. Change to the newly created directory cd soundgood-music-school. cd "soundgood-music-school"
    1. Change the url to match your database. You can find that in <SchoolDAO>
  3. Create a database that can be reached with postgres database.sql and insert.sql. That all tables and data you need to a database called soundgood-music-school.
  4. Build the project with the command mvn install
  5. Run the program with the command mvn exec:java

Commands for the Soundgood Music School project

  • help displays all commands.
  • list lists all instruments that are available to rent. The listing shall show brand and price for each listed instrument.
  • ensembles List all ensembles held during the next week. For each ensemble tell whether it's full booked.
  • rent Shows the all rented and terminate instruments.
  • rent <student_id> <instrument_id> Student can rent specify instrument. Remember that a student is not allowed to rent more than two instruments at the same time.
  • terminate <student_id> <instrument_id> Terminate an ongoing rental.
  • quit quits the application.

Created by