liveBook · Manning

Business logic

As explained in Building User-Friendly DSLs

The rules and decision-making behavior that encode an organization’s business knowledge in software.

Business logic encodes business knowledge as software behavior. In a car-rental application, it determines a price from the rental period, car type, contract type, holidays, mileage, and marketing discounts. section 1.1

Business logic commonly expresses rules as conditions and consequences:

  • Apply a 10% surcharge when the rental period contains a national holiday. section 1.1
  • Apply a 5% discount to the per-day rate when the rental exceeds a whole week. section 1.1
  • Add an environmental fee of $10 per day when the car is a genuine gas guzzler. section 1.1
Table 1.1 Natural language expressing car rental business knowledge
If the rental period contains a national holiday, then a surcharge rate of 10% is applied to the rental price for that holiday.
If the length of the rental period exceeds a whole week, then a discount rate of 5% is applied to the per-day rate.
If the car is a genuine gas guzzler, then an additional environmental fee of $10/day is applied.

Natural-language rules make the business knowledge behind a price quote explicit and usable by business experts. section 1.1

How Building User-Friendly DSLs covers it

How deep it goes
Explains rules, nested conditionals, and intermediate state, but defers a precise definition of business rules.
Examples
Uses car-rental pricing with holiday surcharges, weekly discounts, environmental fees, car rates, and contract types.
What you can do after
Evaluate how business knowledge becomes conditional software behavior for a car-rental price quote.
How it connects
Connects business logic to business rules, conditional logic, intermediate state, and domain-specific language.

Also explained in

Compare how 10 books explain business logic →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building User-Friendly DSLs. The section links point to the parts of the book it draws on.