A very common e-commerce business was selected for the actual combat of SpringCloud Alibaba.
Of course, because it is only for learning SpringCloud Alibaba, the business has been greatly simplified, and here is only a simplified version of the user order business.
1. E-commerce business process
Flow chart of order placement in e-commerce system:
This process is also simplified. Generally, you may not place an order directly after browsing the product, but add it to the shopping cart first. Here we omit this link.
Next, we need to refine the business, and the business process can be refined through the sequence diagram.
2. Timing of deducting inventory
Note that in our swim lane chart, the deduction of inventory is after the user places an order.
In the e-commerce system, there are generally two ways to deduct inventory:
- Order deduction of inventory : Order deduction of inventory is a better way for users to experience, avoiding users to find insufficient inventory when paying. The disadvantage is that it is not suitable for the limited inventory of the product, because the unpaid order will affect other people's purchase of this product.
- Payment and deduction of inventory : Payment and deduction of inventory is very bad for the user experience, because the user may find that the inventory is insufficient when paying. But it is more suitable for businesses like spikes to avoid unpaid orders occupying inventory.
However, when placing an order to reduce inventory, a timeout period should be set. If the payment is not completed within a certain period of time, the inventory should be released in time.
3. E-commerce business process module division
Through the above sequence diagram, we have a clearer understanding of the business of e-commerce orders. Next, we will divide the specific business modules:
- 1. User module : There needs to be a user service for the management of user basic information, including user name, level, etc.
- 2. Commodity module : When users browse commodities, they need to have a commodity module to support them to show users information such as commodity introductions, prices, and so on.
- 3. Order module : The user needs the order module to create an order when placing an order.
- 4. Payment module : The order is created and the user needs to pay. There needs to be a payment module to realize the payment function. After the user successfully completes the payment, the status of the order needs to be changed to "paid".
- 5. Inventory module : After the payment is completed, the operator needs to ship the goods. In this step, the inventory quantity of the corresponding product needs to be deducted. Therefore, an inventory module is required. After the shipment is completed, the order status needs to be changed to "Delivered" .
Of course, the real business is much more complicated than this. We only consider a simple user order business, so the main business modules are these.
We have adopted the vertical division of service division, taking the business as the dimension to complete the division of services.
"Repeating simple things, doing repetitive things seriously, doing serious things creatively!"——
I am a three-point evil, you can call me the third child/three-pointer/third-brother/third-child, a full-stack development capable of cultural and military skills, see you in the next issue!