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

The Action-Domain-Response pattern in action - PHP Tutorial

From the course: PHP: Design Patterns

Start my 1-month free trial

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…

Contents