From the course: PHP: Design Patterns

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Introducing the Action-Domain-Response pattern

Introducing the Action-Domain-Response pattern - PHP Tutorial

From the course: PHP: Design Patterns

Start my 1-month free trial

Introducing the Action-Domain-Response pattern

- Now we'll talk about Action-Domain-Responder, which is a very new pattern and still under some debate. It comes about because as useful and powerful as MVC is, it doesn't quite fit the web. For example, when we talk about the View portion of MVC, we almost exclusively think of HTML templates. But if you think about it, there are two parts to every HTTP response: The headers and the body. When we talk about HTML templates, we're only talking about the body. So what happened to our headers? There's a piece missing in there somewhere. The point of Action-Domain-Responder pattern is to better describe web interactions. Instead of a controller that pulls together a model and view and publishes it, the action portion collects all the required information, and passes all control to the responder. The responder then figures out everything else such as the HTML template, the HTTP response codes, et cetera. The primary benefit of this approach is clarity. When we talk about a response from…

Contents