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:
Decoupling models from the database Data Access Object pattern in PHP
January 05, 2009 @ 21:22:26

In this new post to his blog Jani Hartikainen looks at implementing the Data Access Object pattern in your PHP applications.

The advantage of this is that you can easily implement different methods to persist objects without having to rewrite parts of your code. I'm again going to use the programming language quiz game I wrote as an example. Since I initially wrote it to use Doctrine ORM directly, and both the old and new code are available, you can easily see how the code was improved.

He starts off with a look at the pattern itself (including a diagram of how an example would work with Doctrine) followed by the creation of the models for his Questions example. Add in the factory to create an instance and an exmaple of it in action and you're there.

0 comments voice your opinion now!
decouple model data access object designpattern tutorial doctrine


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: Remote objects and Zend_Amf

PHPit.net: Building a simple MVC system with PHP5

DevShed: Introducing SimpleXML in PHP 5

Eran Galperin's Blog: Profiling queries with Zend_Db and optimizing them by hand

Tim Koschuetzki's Blog: How To Transform HTML To Textile Markup - The CakePHP TextileHelper Revisite


Community Events

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


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

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