Business Logic
The rules and decisions that determine how a business operation should work.
What is it?
Business logic represents the rules that turn business requirements into system behavior.
It determines what should happen when users or systems perform business operations.
Simple Definition: Business logic is the system's business decision-making logic.
Think of it like...
Think of a company's operating rules.
The backend receives an action.
Business logic decides whether it is allowed and what should happen next.
What does it do?
Where is it used?
Business logic is used in:
Example
Create Order
Scenario: Create Order
Rules:
- Customer must be active.
- Quantity must be greater than 0.
- Available credit must be sufficient.
Flow
How it connects
Do Not Confuse
Validation
Checks whether input has acceptable structure or values.
Business Logic
Applies business decisions and rules.
Topic Glossary
| ENGLISH TERM | 中文 | SIMPLE ENGLISH | 中文小白理解 |
|---|---|---|---|
| Business Logic | 业务逻辑 | Rules that determine how business operations work. | 决定系统业务流程应该如何处理的一组规则。 |
| Business Rule | 业务规则 | One rule defining allowed or required behavior. | 规定业务在什么条件下可以或不可以执行的一条规则。 |
| Workflow | 工作流 | A sequence of business steps. | 一个业务从开始到结束需要经过的一系列步骤。 |
| Condition | 条件 | A rule used to decide what happens next. | 用来判断后续应该执行什么操作的条件。 |
| Calculation | 计算逻辑 | Logic used to calculate business values. | 用来计算价格、金额、数量等业务结果的规则。 |
| Decision | 决策 | A result chosen based on rules and conditions. | 系统根据业务条件判断后得出的处理结果。 |
What to Remember
Business logic represents business rules in software.
It sits between request handling and data operations.
Good business logic should be separated from transport details when practical.