A-Team-Rowan-University / a-team-website

Servers and database to manage the A-Team
https://a-team-rowan-university.github.io/a-team-website/webdev_lib/
4 stars 5 forks source link

Separate database layer and logic layer #45

Closed timothyhollabaugh closed 5 years ago

timothyhollabaugh commented 5 years ago

The database interaction and business logic should be separated. The database interaction is the Diesel code that talks to the database and handles transforming the data. This allows the business logic to not depend directly on Diesel or the database layout details and makes it easier to read and reason about. Some business logic will be mostly passthroughs, like basic CRUD operations. Other things, like registering for a safety test, require a bit of logic and multiple database calls.