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 - PHP Tutorial
From the course: PHP: Design Patterns
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Introducing the Action-Domain-Response pattern1m 43s
-
(Locked)
Exploring a use case for the Action-Domain-Response pattern1m 34s
-
(Locked)
The Action-Domain-Response pattern in action1m 11s
-
(Locked)
Challenge: Apply the Action-Domain-Response pattern48s
-
(Locked)
Solution: Apply the Action-Domain-Response pattern2m
-
(Locked)
-
-
-
-
-