Order Data Model
This lesson connects the architecture model to persistent data. You will create
an ERD for the order subsystem, add the orders and order_items tables, and
document their one-to-many relationship.
Create the ERD
Create a diagram named Order data model, select the ERD type, and bind it
to the checkout and order subsystem described by the model.
Loading image...
Tables and Columns
Add the orders table with its identifier, customer, status, and creation
timestamp. Add order_items with identifiers for the order and product, plus
the quantity.
Loading image...
Loading image...
Relationship and Cardinalities
Create a relationship from orders to order_items. Set the source to exactly
one and the target to one or more, then switch the item table to a compact view.
Loading image...
Loading image...
Timeline
00:00— purpose of the data model;00:06— creating and binding the ERD;00:35— adding the orders table;01:02— defining columns;01:42— adding order items;02:20— relationship and cardinalities;02:50— compact final diagram.
Previous lesson: Your First Component Interface.
Next lesson: First Class Diagram.