News Feed
Sections




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

Knut Urdalen's Blog:
ORM the manual way
August 29, 2007 @ 07:57:00

Knut Urdalen, on seeing some of the recent discussion on why the ActiveRecord pattern sucks and talks about why, when presented with a the need for a database layer, he usually goes back to his own familiar Singleton-based style.

I normally use a simple solution using the Singleton pattern for managing the database connection, the Value Object pattern for all business objects and the Data Mapper pattern to manage the mapping between business objects and the database schema. It's as simple as that '" handcrafted and no magic going on.

The post also includes his code for an example of a database connection - the creation of the Singleton interface class, making the Value Objects and customizing one for the type of "Product".

0 comments voice your opinion now!
orm database layer singleton valueobject example designpattern orm database layer singleton valueobject example designpattern


blog comments powered by Disqus

Similar Posts

Zend Developer Zone: Case Study w/ Zend Core for IBM with DB2 9 - 10k Active DB Connections

Chris Chabot's Blog: phpSocketDaemon

Dave Marshall's Blog: ZFSnippets.com - Zend Framework Code Snippets

Ian Selby's Blog: Put Your PHP App on Steroids - Optimizing with APC Cache

Greg Beaver's Blog: Statistics are back up for pear.php.net


Community Events





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


code install laravel framework configure threedevsandamaybe series refactor symfony2 list release testing developer opinion introduction podcast interview community unittest language

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