Step 2 : Class diagram
Step 1 :
First, the meaning of each category ：
1. Product Products
2. User Users
3. Order order
4. OrderItem Order item
front 3 It's easy to understand , Order item Need to explain .
For example, you are under a treasure One order , This order includes
Black silk stockings One
Inflatable doll Two
A record is an order item , Corresponding to a commodity , And the number of purchases .
Step 2 :
1. The relationship between product and order item is One to many
A product , Corresponding to multiple order items .
An order item , Corresponding to a product
2. Relationship between order item and order Many to one
There are multiple order items in an order
An order item , It will only appear in one order
3. The relationship between orders and users ： Many to one
An order , Can only belong to one user
A user , You can place multiple orders
The official account of programming , Follow and get the latest tutorials and promotions in real time , thank you .
Q & A area
Too many questions , Page rendering is too slow , To speed up rendering , Only a few questions are displayed on this page at most . also 5 Previous questions , please Click to view
Please... Before asking questions land