Skip to content

Architecture

Middleware is not a layer

A controller reaches into middleware to run business logic. It looks convenient. The middleware has the session, the user, the request body, everything you need. So why bounce through a handler when you can just validate the cart right there? Because the moment you do, your business rule only runs inside an HTTP pipeline, and you just lost the ability to invoke it from anywhere else.

Copy-based framework: own your code

Most PHP frameworks are installed as Composer packages. They end up in vendor/, behind a version constraint, and you interact with them through their public API. You don't read the implementation. You don't modify it. When something breaks after an update, you adapt your code to match the new version.