News Feed
Sections




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

DevShed:
The Active Record Pattern, Concluded
December 29, 2005 @ 10:03:27

DevShed has concluded their series on ActiveRecord today with This new post, the end of the chapter from php|architect's Guide to Design Patterns.

This article, the second of two parts, helps you use design patterns to better organize how your web application interacts with a database. It is excerpted from chapter 14 of the book php|architect's Guide to PHP Design Patterns, written by Jason E. Sweat.

Databases usually just work, but failure is not unheard of. To make sure your code operates correctly under failure conditions, let's simulate a failure using a Mock Object, which stands in for the connection object.

They create the mock object and use it to test the ActiceRecord instance, including (as before) the unit testing code as well. They finish it off with examples of how to search for records and update the records that already exist.

0 comments voice your opinion now!
activerecord mock object database search update activerecord mock object database search update


blog comments powered by Disqus

Similar Posts

Quoderat's Blog: Three simple tips for LAMP web site developers

Federico Cargnelutti's Blog: Database Replication Adapter for Zend Framework Applications

Milw0rm.com: Exploit - PHP5 COM Object Security Bypass (Windows)

Brandon Savage's Blog: Q&A: Answering Some Questions About Object-Oriented Programming

Zend Developer Zone: YAMMY!: DB to YAML conversion shell for CakePHP migrations


Community Events





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


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

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