liveBook · Manning

Business logic

As explained in Clean Applications with Hexagonal Architecture

The rules and processing that express an application's business behavior independently of external technologies.

Business logic expresses the rules and decisions that define an application’s behavior. Keep business-rule decisions in the domain entity or handler, where frameworks and infrastructure cannot take ownership of them. section 1.6 section 2.3.2

To find logic that belongs in the domain, ask what must survive if framework dependencies are removed. Extract those rules into a framework-free package; avoid entities that hold only data and cannot enforce their own invariants. section 2.4.1

Article validity

Rules for what makes an article valid, whether an author exists, or whether a title is duplicated belong in a domain entity or handler—not in a controller or persistence callback. section 2.3.2 section 2.4.1

How Clean Applications with Hexagonal Architecture covers it

How deep it goes
Defines placement through business-rule decisions and a framework-removal test, while deferring full domain-entity construction.
Examples
Uses article validity, author existence, duplicate titles, and rules scattered across services, controllers, and persistence callbacks.
What you can do after
Apply a framework-removal test to identify logic for extraction into a framework-free domain package.
How it connects
Connects domain entities and handlers to dependency inversion, ports, and adapters.

Also explained in

Compare how 15 books explain business logic →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Clean Applications with Hexagonal Architecture. The section links point to the parts of the book it draws on.