One Endpoint for Everything: The Adapter Pattern

We have an API endpoint that takes a command and answers with a redirect, a notice or a warning. A page just wants the link to an order. The Adapter pattern is the small class in between, and the reason it exists isn't that anybody got the API wrong. More …

The Menu That Hides Itself: The Composite Pattern

Every option in our menu declares its own permission rule. No category declares anything, and yet empty categories disappear on their own. That's the Composite pattern, and it's the reason nobody has to write the rule you'd expect to find. More …