News Feed
Sections




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

DevShed:
Refactoring the MySQL Abstraction Class with the Active Record Pattern
April 08, 2009 @ 07:56:18

DevShed has the latest article in their tutorial series looking at the Active Record design pattern posted today. This time they focus on a bit of refactoring to make their MySQL abstraction class a bit easier to use and work better.

As I stated in the end of the [previous] tutorial, however, some methods of this sample class implement redundant business logic, and as a consequence it's necessary to refactor them to fix this issue in a quick and simple manner. Thus, in the next few lines I'll be explaining how to accomplish this process progressively, and as always, accompanied by the corresponding code samples.

They change up some of the CRUD (Create, Read, Update, Delete) functions by dynamically constructing the SQL and updating the fetch functions to allow for more modifiers like "LIKE" or "LIMIT".

0 comments voice your opinion now!
refactor abstraction class activerecord design pattern tutorial


blog comments powered by Disqus

Similar Posts

ThinkPHP Blog: Accessing NTLM secured resources with PHP

Ivan Iordanov's Blog: extending Zend_Db_Table to create NestedSet models

Bob Majdak's Blog: Compile That PHP-GTK2, and More

Ariz Jacinto's Blog: Compiling PHP with MSSQL Server's Native ODBC Driver for Linux as a PDO Driver

PHP-Coding-Practices.com: How I Turned A Slow Array Sort Into A Quick One Using Quicksort Algorithm


Community Events





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


security opinion podcast introduction community version language conference series laravel list library voicesoftheelephpant framework artisanfiles interview composer release symfony tool

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