Skip to content

Spring based back-end side of a courses management system.

Notifications You must be signed in to change notification settings

Jarjanazy/Courses-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Courses-management-system

Spring based back-end side of a courses management system.

How it works:

  • --The project uses the MVC pattern, with a service layer that separates the model layer from the controller layer.

  • --The backend server is listening at port localhost:8080/

  • --We can create, or retrieve objects from the database.

  • --Objects are of classes (Schedule, ClassRoom, Course, Instructor and Slot).

  • --Those objects are related to each other as shown in the ER diagram.

ER-diagram

The requests (example requests are provided in the zip files using Postman):

Where className is one of (Schedule/ClassRoom/Course/Instructor/Slot)

  • --To save an object to the database, we send a POST request with the object data as parameter:

http://localhost:8080/ClassName/save?parameter1=value1

Where className is one of (Schedule/ClassRoom/Course/Instructor/Slot).

  • --We can also get all objects of a certain class by sending a GET request to the corresponding:

http://localhost:8080/ClassName/

Where className is one of (Schedule/ClassRoom/Course/Instructor/Slot).

  • --IMPORTANT NOTE: the h2 database is erased and recreated with a fresh copy on every deployment of the project.

Usage of DTO (Data Transfer Object):

  • --The method was used with Schedule Objects.
  • --The reason for using it is the fact that Schedule class has circular references with other classes, which causes infinite JSON content when returning the Schedule object from the controller.
  • --ScheduleDTO object simply consists of four properties which define a schedule:
    • --Schedule_course_name (String)
    • --schedule_classRoom_name (String)
    • --Schedule_instructor_name (String)
    • --Schedule_slot_id (int)

Thus the ScheduleDTO object is returned instead of the actual Schedule object itself.

Logic in adding new schedules:

  • --The assessment asked to take care of two conditions:
  1. 1)A teacher can't be at two classrooms at the same time.
  2. 2)Two courses can't take place in the same time and classroom.
  • --For the first condition, we simply check the new schedule we are trying to add with every other schedule in the database, if one of the schedule has the same slot and instructor ID, then the schedule can't be added.

  • --For the second one, we check the new schedule we are trying to add with every other schedule in the database, if one of the schedule has the same slot and classroom ID, the schedule can't be added.

About

Spring based back-end side of a courses management system.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published