News Feed
Sections




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

Bill Karwin's Blog:
ActiveRecord does not suck
May 29, 2008 @ 17:07:50

Bill Karwin (formerly of Zend and the Zend Framework project) has a new post to his blog defending one of the more abused (both in code and in opinions) design patterns, ActiveRecord:

ActiveRecord is fine. It is a tool that does just what it's designed to do. What sucks is when developers try to make it do other things than what it's intended to do.

He cites his work with the Zend_Db component and how Mike Seth gets it right when he says that the pattern shouldn't be "ActiveRecord-View-Controller". He compares the ideas of a true Model in an MVC application with the incorrect ideas that many developers seem to hold.

A Model is a class that provides a logical component of your application domain. Models are products of OO design, which is a development activity I see get very little attention in the developer blogosphere or the developer tools market.

Models can reference one or many (or no) database tables and are not where the hard work is being done. That's saved for the ORM (or ActiveRecord) to do.

0 comments voice your opinion now!
activerecord designpattern modelviewcontroller mvc model orm


blog comments powered by Disqus

Similar Posts

SitePoint PHP Blog: Ardent: Laravel Models on Steroids

Pádraic Brady's Blog: Complex Web Pages with the Zend Framework?

Zend Developer Zone: Design Patterns I Hate

Matthew Weier O'Phinney's Blog: Autoloading Doctrine and Doctrine entities from Zend Framework

Blog.szajbe.pl: Not so obvious behavior of $uses in CakePHP


Community Events

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


psr7 opinion wordpress library introduction interview series conference api development podcast community extension language release voicesoftheelephpant unittest framework laravel laravel5

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