For whatever reason, it doesn’t seem common that we talk much about design patterns and WordPress. And that’s odd to me.

Maybe I’m not talking to the right people, maybe I’ve got my head in the sand, maybe it’s just not something about which people share much information, or maybe people who work with WordPress don’t care that much about design patterns at all.

Design Patterns and WordPress

The architecture of WordPress is not the same as using design patterns iin WordPress.

But if you’re using WordPress and you’re building more than a theme or a simple plugin, the odds of you building something more advanced and not taking advantage of design patterns seems highly unlikely.

Whatever the case, if you’re someone who’s working on advanced solutions – perhaps web applications, perhaps having your components talk to third-party components, or whatever the case – then it wouldn’t hurt to have a reference of popular design patterns and antipatterns would it?

Design Patterns and WordPress

About those reasons about:

  • I know that I talk to plenty of the right people in WordPress because there are people from whom I’ve learned (and continue to learn) a ton of information that surpasses much of which a book can teach.
  • I don’t think I have my head in the sand as I try to track with as much information about both software development, the state of web applications, and WordPress as I can (though maybe I’m reading the wrong things).
  • Perhaps people aren’t sharing that much information, but I see a lot of material on GitHub. (Remember, just because it’s not in the form of a blog doesn’t mean it’s not available somewhere :).
  • I refuse to believe that people working with WordPress don’t care about design patterns; otherwise, I question how some of the more advanced solutions wouldn’t have made it as far as they have.

What’s the point of bringing this up, though?

Where’s All The Talk About This?

In the past year or so, I’ve worked on some medium-to-large plugins all of which have had some type of component that will inevitably grow over time or that have been communicating with third-party APIs, components, etc.

And as I try to keep the rust off of the proverbial metal of using design patterns, I began wondering who all in WordPress uses design patterns regularly (so if you’ve got some insight, please don’t hesitate to share it in the comments).

The Resources I Recommend

I also began thinking of the resources I typically recommend to others when they want to learn the basics of design patterns. The following two books are usually my go-to resources:

  1. Head First Design Patterns
  2. Design Patterns: Elements of Reusable Object-Oriented Software

And they are both great, but I recently found myself stumbling across a cool resource simply called Design Patterns at Source Making.

Design Patterns and WordPress

From what I can tell (and from my experience thus far), the site is fantastic. The homepage says:

I’m SourceMaking. I will tell you a lot of stories about good software architecture and teach you how to create it with design patterns. I will guide you through anti-patterns, common pitfalls and mistakes that people make when they plan, create, and manage software projects. In the end, I will teach you how to smell a bad code and improve it with refactoring.

And without belaboring the point (because you can and you should check all of this stuff out on your own time), the site covers:

  • Design Patterns
  • Antipatterns
  • Refactoring
  • UML
  • And some other odds and ends.

So if you’re someone who’s familiar with standard software engineering practices and you’re looking to refresh your memory, then I recommend this site.

Or maybe you’re someone who’s new to the field and looking for a solid guide or understanding for some more advanced concepts, then I recommend this site.

Above all else, though, if you’re looking for gaining an understanding of how to employ design patterns and WordPress together in your projects, this site can help not because it’s WordPress-centric, but because of how it conveys the information.

And because it’s available via a web browser versus, say, a book.

Category:
Resources
Tags:
,

Join the conversation! 5 Comments

  1. An absolutely invaluable resource for design patterns in PHP is this repo on GitHub:

    https://github.com/domnikl/DesignPatternsPHP

    I refer to it constantly. It’s a great way to see how you can implement in practice. It also often mentions where you can find these patterns in the wild (like what PHP framework component uses them).

  2. I’ll recommend our friend Alain Schlesser’s blog for very lucid writing and code that includes design patterns and object oriented programming in general.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.