When adapters depend directly on query handlers, adding or changing a read path can spread wiring changes outward. A query bus gives adapters one entry point: they submit a query, and the bus resolves its handler at runtime. section 4.6.2 section 4.8
Listing 4.19 QueryBus from the Architecture Kernel
public interface QueryBus {
<E, R, Q extends Query> Either<E, R>
query(final Q query); #A
}
The generic contract accepts a query and returns an Either containing either an error or a result. section 4.6.2
A REST controller can validate a GetArticleByIdQuery, pass it to QueryBus, and map the returned ArticleDTO to an HTTP response. The handler fetches through a repository and maps the result to the DTO; the adapter need not know the handler class. section 4.6.3
In a Spring assembly, the bus is wired against Spring's ApplicationContext. Adding a use case means adding a handler, without changing adapter code or wiring updates. section 4.8 section 6.6
