We often use the term business logic or business rules when we want to talk about what we should understand when we build a business IT system or just when we try to set the documentation level of an IT system. But most of the examples that I can find in the open space are so trivial that you can’t learn from them. Here are a few examples from ChatGPT:
User Registration
- Business Rule: Users must register before making a purchase.
- Logic: When a user registers, their information (name, email, password) is stored in the user database. Subsequent logins are authenticated against this database.
Product Catalog
- Business Rule: Products are categorized, and users can browse the catalog.
- Logic: Products are organized into categories (e.g., electronics, clothing). Users can view products within categories, search for specific items, and access detailed product information.
Shopping Cart
- Business Rule: Users can add products to a shopping cart for later purchase.
- Logic: A user can add products to their virtual shopping cart. The system keeps track of selected items, quantities, and prices. Users can review and modify their cart before checkout.
Above examples are valid use cases, and from the business side that is potentially not more to say even thought that from a technical perspective there might be substantial specification below. But they are no are not exemplary with respect to where it really matters – which is business logic/rules that goes beyond a one liner. Below you will find a more substantial business logic/rules example.
Business Rules for Salary Articulation
One important principle for expressing salary in a computable way is that we define a base salary and on top of that the increments to manage variations in compensation as a function of business rules. This is shown in the table below.
| Period | Name | Base Rate | Increment |
|---|---|---|---|
| 06:00 – 08:00 | Early Supplement | 1.00 | +0.25 |
| 08:00 – 18:00 | Base Salary | 1.00 | 0.00 |
| 18:00 – 22:00 | Late Supplement | 1.00 | +0.25 |
There is also an increment in relation to overtime. Overtime is is defined as more than 8 hours on a day:
| Criteria | Name | Base Rate | Increment |
| >8 H | Overtime 1 | 1.00 | +0.25 |
One advantage of this model is that there is clear separation of contributions, making extra income (or from employer point of view costs) for working long or odd hours transparent. Additionally, the system typically uses a smaller number of rates, simplifying maintenance in relation to new tariffs, individual and yearly regulations.
If we now make the example that a worker works from 6 AM to 6 PM we will get the following contribution
- Base Salary (06:00 – 18:00):
- Base Rate: 1.00
- Hours: 12
- Early Contribution (06:00 – 08:00):
- Increment: 0.25
- Hours: 2
- Overtime (14:00 – 18:00):
- Increment: 0.25
- Hours: 4
This leads to a payment specification for the day
- Base Salary: 12 x 1 = 12.00
- Early Supplement: 2 x0.25 = 0.5
- Overtime Payment: 4 x 0.25 = 1.00
As said above, the supplements are with this business logic very transparent.
So what are the business rules here?
Before we get to the business rules we actually need to start with the definitions:
- Rate: A salary part which is typically articulated as an amount per hour
- Base Rate: Salary rate without any increments related to odd hours or total work hours
- Increment: Extra rate on top of base rate for work done under certain conditions – for instance based on long or odd hours.
- Tariff: Compensation based on a combination of rates and expressed together with the qualifying rules
So the business rules are:
- All tariffs must be articulated as base + increment.
- All tariffs must have a meaning full name.
- Tariffs can have a rule
- All workable time periods must be covered by tariff.
- All allowed daily work hours must be covered by a tariff.
Extending the example
With the above definitions and precision it is possible to continue with further business rules related to other use cases (we could call the above for salary tariff specification). Examples of related cases could be:
- Per day and per pay-period salary calculation
- Salary break down on worker pay slip and for finance reporting
- Advanced salary contributions
- Hierarchical tariff management
Leave a reply to My IT Architect Principles – sunevangconsult Cancel reply