Business Logic
noun
say it: “BIZ-nis LOJ-ik” /ˈbɪznɪs ˈlɒdʒɪk/
The rules that make an app do what the business needs, such as prices, discounts and limits.
What is Business Logic?
Business Logic — The rules that make the app do what the business needs: how a discount is worked out, when an order can ship, how many books a member may borrow. It lives in services, apart from the web code and the database code, so it can be tested on its own.
class LoanService
{
public const int MaxBooks = 5;
public bool CanBorrow(int booksOut) => booksOut < MaxBooks; // a business rule
}
In a sentence
- “The five-book limit is business logic, so it lives in LoanService, not in the controller.”
Level: Apprentice · More Software Development terms at this level
Updated