Request::factory('widgets/stats') inside a controller. A colleague looked at this line last week and asked the question I hear most often about Kohana: you already have a request, why make another one?

I keep answering it at the desk. So I will write it down once. Short notes, mostly backend, mostly PHP. This is the first.

The answer is composition. Take a dashboard. A stats block, a recent orders block, a notifications block. Each one needs its own data and its own logic. You can put all of it into one action. It works. In a month it is 300 lines and nobody wants to open it.

With HMVC each block is a small controller, and the page controller only collects them:

$stats = Request::factory('widgets/stats')->execute()->body();

The internal request goes through normal routing and the normal lifecycle. The block does not know it is internal. Tomorrow the same block renders alone, for AJAX, without a single change. This is the good part.

The bad part. It is very easy to start calling controllers like functions. Ten internal requests per page, each with its own queries, each with the full routing overhead. This is not composition anymore. This is a service layer hiding behind URLs.

I know because the ten-request page was mine. It felt clean while I wrote it.

My rule now: HMVC is for blocks that are also pages, or at least AJAX endpoints. If nobody ever asks for the thing over HTTP, it is a plain class. Not everything needs a route.