Software development is about repeating yourself intelligently by using functions to encapsulate repetitve code, saving you the hassle of writing it out each time. This doesn’t just mean finding a repeatable pattern and going with it, it’s important to find the right pattern. That is where PHP design patterns come into play. While we often think of this in terms of choosing to write a function or class, or to import a library, this approach also extends to application architecture. The architecture of a framework, CMS, plugin, theme, class, or system is often described as conforming to a pattern. Being […]
It’s Time To Level Up Your PHP Skills
A few years ago I was working on a WordPress-powered web application that used several custom post types, each of which required a different class to query it. The classes included a lot of repetitive code because the queries and a lot of other things I was doing was different. Somewhere during this project, I noticed that the pattern I established and cut and pasted across four different classes was very wrong. I recently came across my first Carl Alexander article on polymorphism in PHP, which introduced me the concept of abstract classes in object-oriented PHP. I re-read the article […]
2 Comments
Join the conversation