liveBook · Manning

Fact

As explained in Clean Applications with Hexagonal Architecture

A statement of something that has happened, which other components may react to later.

A fact reports that something has already happened; it does not ask another system to do work. The publisher expects no answer and continues, so dispatch is asynchronous. A fact is valid even when nobody is listening. section 10.2

Facts can cross a boundary in either direction. Outbound, a handler can publish an event after the domain approves an article. Inbound, an external platform can report that a scheduled post failed. The publisher need not know who subscribes or what they do. section 10.2

Choose a fact when a use case only needs to inform other systems and can accept that they react later. If the use case needs an answer before continuing, use a request instead. Integration grows the hexagon’s edge, not its core: the domain decides what is allowed, the application layer decides what leaves, and an adapter knows the external system. section 10.4 section 10.7

Article approval

After the domain approves an article, WriteFlow publishes ArticleApproved and moves on; subscribers may react later, or none may be listening. section 10.2

How Clean Applications with Hexagonal Architecture covers it

How deep it goes
Defines facts, contrasts them with requests, and explains their direction, dispatch, and boundary ownership.
Examples
Uses ArticleApproved and a report of scheduled-post failure as outbound and inbound facts.
What you can do after
Apply the distinction by publishing an event when informing others without waiting for an answer.
How it connects
Connects facts to events, requests, domain events, integration events, handlers, and adapters.

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.