background preloader

Web and Graphic Design Inspiration and Photoshop Tutorials

Web and Graphic Design Inspiration and Photoshop Tutorials

Art and Design by Matthew James Taylor Build seven good object-oriented habits in PHP Make your PHP applications better with object orientation Nathan GoodPublished on October 28, 2008 In the early days of PHP programming, PHP code was limited to being procedural in nature. Procedural code is characterized by the use of procedures for the building blocks of the application. Procedures offer a certain level of reuse by allowing procedures to be called by other procedures. However, without object-oriented language constructs, a programmer can still introduce OO characteristics into PHP code. While purely procedural designs without much modularity run just fine, the advantages of OO design show up in the maintenance. Modularity— one of the key characteristics of good OO design — helps with this maintenance. While there are more than seven habits to building OO software overall, the seven habits here are what you need to make your code fit basic OO design criteria. The seven good PHP OO habits are: Be modest Bad habit: Expose public fields Listing 1. Listing 2. Listing 3.

Related: