News Feed
Sections




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

Stephan Hochdörfer:
Controller classes vs. Action classes
May 19, 2014 @ 10:52:31

In this new post to his site Stephan Hochdörfer covers some of his own thoughts about the recently proposed application structure from Paul Jones, the "Action-Domain-Response" pattern. In this post Stephan compares the typical controller classes with an action class.

First of all I do have the feeling that controller classes make it harder to structure your logic. I have seen a lot of "God Controllers" that do a shitload of stuff. Stuff that is not really related to each other. [...] action classes tend to be rather small, typically less than 100 loc for us. That also helps a lot when trying to understand what`s going on. I am aware that there are developers out there who are afraid when it comes to dealing with a lot of classes. [...] That`s another bonus point for action classes: It is easier to search for a class name than a method name in most IDEs.

He goes on to talk more about "God controller" classes, their dependencies and how that compares to action classes only taking in what they need. He touches on the reusability of action classes as opposed to controllers and how they come in handy for storing common logic.

0 comments voice your opinion now!
controller action class compare logic dependency

Link: http://blog.bitexpert.de/blog/controller-classes-vs.-action-classes

blog comments powered by Disqus

Similar Posts

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

Richard Heyes' Blog: SMTP for PHP 5

Alexander Netkachev's Blog: 404 error with Zend Framework Front Controller

Brian Swan's Blog: MSSQL vs. SQLSRV: What’s the Difference? (Part 2)

DevShed: Migrating Class Code for a MIME Email to PHP 5


Community Events





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


package podcast update library symfony security community laravel series language release interview composer introduction version framework voicesoftheelephpant install tool opinion

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