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

Ilia Alshanetsky's Blog: Domain Distribution by City

Wouter Lagerweij's Blog: Reading Up: Books Every Programmer Should Read

Web Mozarts: Symfony2 Form Architecture

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 9)

Matthew Weier O'Phinney: Better Understanding Controllers Through Basic Patterns


Community Events





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


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

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