List and define the data type for all data currently identified for ABC's rental application. Refer to Chapter 2 for the data definitions.
There are several ways to define data types in a project, some developers like to design the classes, and others prefer to define the database schema. Usually, I like to define the data types in applications as they are defined in the database, as relational schemas, because database is the point of truth in any software project, and other software parts can be either designed according to the object-oriented paradigm or functional paradigm. However, according to the virtual requirements defined in chapter 2 of Conger's textbook (2008), the data types and database tables can be defined as follows:
Video Tape:
- ID (Primary Key, Unique)
- Title
- Year of Publishing
- Genre
- Number of Copies
- Barcode Serial Number
Customer:
- ID (Primary Key, Unique)
- Name
- Address
- Phone Number
- Zip Code
- National Card ID
- Credit Card Number
- Credit Card Type
- Credit Card Exp. Date
Rental:
- ID (Primary Key, Unique)
- Customer ID (Foreign Key)
- Video Tape ID (Foreign Key)
- Date
- Return Date
- Status
The "Rental" table is a junction table that is used for each rental event in the system. It will be used then for most of the searching and reporting functionalities by filtering based on the "Customer ID" or "Video Tape ID". It is worth mentioning that the field "Number of Copies" in "Video Tape" table should be decreased and increased based on the Rental's "Status" field, in order to track how many copies are left in the inventory.
Reference
Conger, S. (2008). The New Software Engineering. The Global Text Project