News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Paul Jones:
Refactoring To Action-Domain-Responder
June 06, 2014 @ 10:06:15

Paul Jones has a new post to his site today with a more in-depth look at his proposed "Action-Domain-Responder" design pattern and how to refactor an application, based on some with with the Aura framework, to use it.

The v1 version of the Aura framework includes a controller to handle web assets. The idea for this controller was that an Aura package might have images, scripts, and stylesheets that need to be publicly available, but in development you don't necessarily want to copy them to a public document root every time you change them. [...] That v1 version is a mess. The Controller handles the response-building entirely, and there is no Model separation at all. Let's try refactoring it to an Action-Domain-Responder architecture and clean it up some for a v2 version.

Associated code it just linked to, but he does summarize the steps needed to make the transition: extract the domain logic, move responses to a separate class and rename the controller to an action. He also shows how making this separation makes testing easier and links to examples of tests for each. He finishes the post with two final notes about the refactor. One points out that this method isn't the only way to handle this architecture shift and that the action returns a responder, not a response object.

0 comments voice your opinion now!
action domain responder designpattern architecture refactor

Link: http://paul-m-jones.com/archives/6006

blog comments powered by Disqus

Similar Posts

Pádraic Brady's Blog: May's php|architect Magazine - worthy weekend reading

Anthony Ferrara: Mediators - Programming With Anthony

Harry Roberts' Blog: Flexible PHP Interfaces

Nexen.net: PHP Statistics for June 2008

Paul Jones: Action-Domain-Responder and the “Domain Payload” Pattern


Community Events





Don't see your event here?
Let us know!


podcast laravel language voicesoftheelephpant library unittest package api framework symfony release opinion interview zendserver series introduction community install bugfix deployment

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework