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.
The Action-Domain-Response pattern in action - PHP Tutorial
From the course: PHP: Design Patterns
The Action-Domain-Response pattern in action
- Now this example is quite unique, in that I didn't write any of it. Paul M. Jones, the creator of the Action-Domain-Responder pattern, wrote this simple blog engine as a perfect concept to show how it might work. To get a better grasp of it, let's step through each part. First, the Domain folder has a Blog folder. That is the business logic. It's powered by the factory pattern, to create the proper domain object and then uses the Table Data Gateway to provide database access. Both the factory and the Table Data Gateway are covered in other videos, so I'll skip those for now. Next, using the Web, Blog, Action folder, we have all the actions. As I noted earlier, we have a separate action for each and everything you might want to do. In this case, we need actions for Add, Delete, Edit, and Update. Within each of those they receive a similarly named responder, sets the payload with the domain and pass control to that responder. You can see the BlogUpdateResponder here. Finally, the…
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)
-
-
-
-
-