Designing the business logic
When designing your business logic, it is important to think about how your app will need to access your data and what operations it will need to perform. We've defined many of these as part of the data models in the prior data model diagrams—these are the actions that our app can perform on the data. Generally this logic is pretty simple—nearly all of it boils down to something as follows:
- Retrieve (
SELECT
) data from tables - Add (
INSERT
) data into tables - Update (
UPDATE
) data in tables - Remove (
DELETE
) data from tables - Return data back to the app
We won't take up valuable space in this chapter by including all the code for the business logic—it's pretty boring. Instead, look at the database directory in the code package for this book. Also, note that the backend database was designed to be simple and easy to understand; the design we use is not the most secure model. Data, views, and stored procedures are usually separated into separate...