dcsimg
June 18, 2018
Hot Topics:

Add Refactoring to Your PHP Development with MySQL Stored Procedures and Views

  • July 13, 2010
  • By Jason Gilmore
  • Send Email »
  • More Articles »

A common programming mistake is heavily intermingling the application logic and the domain model. In particular, it's so easy to interact with a MySQL database via a PHP-driven website that developers fall prey to less-than-optimal coding strategies. For example, PHP developers who have MySQL on their backends tend to cram an inordinate amount of SQL into their website logic, resulting in undecipherable code that's impossible to maintainable. A number of products have emerged to help developers avoid this practice, most notably MVC frameworks such as the Zend Framework.

However, whether you use an MVC framework or write custom code, you can further separate your application logic from the domain model by taking advantage of MySQL's views and stored procedures. Both features enable you to bundle more of the domain model's logic within the database server itself, thereby minimizing the number of changes you'll need to make later due to code refactoring -- not to mention assigning more control over domain model-related matters to a database administrator when working in larger team environments.

In his PHPBuilder.com article, Jason Gilmore introduces MySQL stored procedures and views, and shows you how to use them for refactoring within your PHP development.


Read the full story at PHPBuilder:
Refactor Your PHP Site Using MySQL Stored Procedures and Views






Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date