News Feed
Sections




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

Jani Hartikainen's Blog:
You don't need a service layer Fat controllers are okay
May 23, 2011 @ 08:42:15

Jani Hartikainen has a new post to his blog today about why, in your framework-based applications, it's okay to have "fat controllers" instead of a service layer.

Here's a counterpoint to the currently popular view of "fat controllers are bad", and the current fad of everyone and their cousin implementing service layers: You don't need one. Fat controllers are okay too.

He starts by explaining the "why you don't need a service layer" part, mentioning that keeping it in the controller keeps things simple and keeps your code from having to go through extra hoops just to work correctly. He also points out that, just because he recommends "fat controllers" doesn't mean he's advocating code reuse. In fact, just the opposite:

It's fine if you code your things in the controllers, but there comes a point when you should stop that. The moment you realize you're duplicating your code, stop and refactor. This is one of the very basics of software engineering: Avoid duplication by creating functions and classes.
0 comments voice your opinion now!
service layer fat controller opinion complexity kiss


blog comments powered by Disqus

Similar Posts

Anna Filina's Blog: Gender in IT, a Different View

Matthew Weier O'Phinney: On Microframeworks

Grant Lovell: Why PHP doesn’t suck anymore

Brandon Savage's Blog: Scaling Up: Baby Steps (a.k.a. Asking The Right Questions)

Volker Dusch's Blog: How i judge frameworks - Or: Let me code in peace


Community Events

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


voicesoftheelephpant interview opinion introduction list library laravel5 laravel video series community language php7 podcast api framework example release version unittest

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