-
Notifications
You must be signed in to change notification settings - Fork 0
Notes on Backend
This project uses Util classes to avoid repeated code and make methods as easy and succinct as possible! Find out what util methods are available here
This class contains a method to clear the database for testing, as well as methods to create and save every object type to the database. Feel free to add more to it and document them here!
- clearDatabase
- createAndSaveAccount
- createAndSaveItem
- createAndSaveTheme
- createAndSaveSource
- createAndSavePracticeSession
This class contains methods to create DTO objects from their non DTO versions
- convertAccountToDto
Our Application uses Springs Global exception handler to throw a custom exception called a GlobalException. This exception contains both a message and an Http Status. The exception is used as follows:
-
Service methods, which handle the business logic of the application, throw GlobalExceptions with the appropriate message and Http Status. For the most part, they are the only methods that throw these exceptions, though Controller methods may do so in rare cases too
-
Controller methods call service methods, but do not need to worry about exception handling - therefore, there are no try / catch blocks. Exceptions that bubble to the surface are handled completely by Spring