New Java movement: Design-driven development practice 1 Requirement Analysis

Source: Internet
Author: User

Here we want to develop a margin lending platform using Java technology and TDD development mode.

First, we need to fully understand the system we want to do. Because the system is usually complex, we need to implement it in stages. In the first stage, we first implement a minimum system and then gradually add new functions, this is the core spirit of iterative incremental development.

Our first step is to build a simple financing platform. The specific business model is: users who open an account in the securities company system can borrow money from the securities company to buy stocks on the T day, then, the stock will be sold on the T + 1 day, and the profit will be obtained through the stock price difference. Then the user returns the wire to the securities company and pays a certain amount of service fees.

The business process looks simple. To facilitate the discussion, we first define the following terms:

User
Gold account Jinbi
A gold coin is a virtual currency of the system. The exchange rate between the currency and the renminbi is initially set to. according to national regulations, a gold coin account can only be charged and cannot retrieve cash. In the transaction system, gold coins can be used to pay transaction fees. You can use tenpay and quickmoney to recharge your gold account.
Wallet account purse
The Wallet account saves the user's cash and can be obtained. However, manual transfer is required after approval.
Real-disk capital order
You can actually raise funds to purchase stocks.
Clearing
Sell all stocks in a real Disk
Settlement
The transaction service fee is collected. The process of returning funds to the user's wallet account after the stamp duty, ownership fee, and commission of each stock is collected.
Ticket pending
Pending orders refer to the process in which the user or system directly applies for stock trading on the stock exchange. Orders can be divided into market price orders, commission price orders, and conditional orders. Market price orders are bought or sold according to the latest price orders. The delegated price order is the price specified by the user, which is listed on the stock exchange. In the current system, the conditional order is mainly used for stop loss.
Withdraw ticket
Cancel the listing transaction request. On the day T + 1, the system automatically issues a conditional order for each user (used for stop loss ). When a user wants to conduct a market or commission price transaction, the system first revokes the original condition ticket and then sends the current user's transaction request to the stock exchange for a pending order transaction.
Stop Loss point
When the user's stock price is lost, the system will automatically trade the stock at the market price. Stop Loss points are currently 8% and 12%.
Currency exchange rate
The exchange rate between the gold coins and the RMB, initially set.
System Account
The system account is my account, which is the fund pool of our system. This account is used to borrow money from users for stock trading when applying for a real disk. This account is obtained by lending to the finance or financial institution, and the borrower's interest needs to be paid according to the billing period.
Stock Account
We open a stock trading account for the user. The user applies for stock trading, first transfers the money to this account, and then implements real stock trading.

The specific requirements can be described through the Application Scenario:

User Registration

Gold account recharge

Wallet account recharge

Wallet account withdrawal

Real-disk Application

T-day stock purchase

T + 1 sell shares

Timeout Liquidation

Stop clearing

Unsold stock Processing

User settlement

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.