1. Home
  2. Framework
  3. What is a software framework?

What is a software framework?

Wikipedia puts it best when it describes a software framework as “a standard way to build and deploy applications”. If we take 10 random plugins from the WordPress repository and compare them, regardless their differences, there will be some similarities:

  1. They (should) all check that the WordPress and PHP versions present are satisfactory.
  2. Some of them define their own helper functions to perform the same relatively simple, repetitive tasks.
  3. Most of them will implement some sort of mechanism to output notices for administrators, check for other dependencies like PHP extensions or other WP plugins, or register their settings fields.

… and the list goes on. The point is, even among a selection of random WordPress plugins, there will be some overlap in functionality. Some will overlap more, some less, but some overlap is there.

What that means for us

That means that if we build 10 plugins, our own 10 plugins will have overlapping code for these repetitive tasks. Moreover, they will also have overlapping code in building the overall plugin class structure.

Chances are that our own 10 plugins will have even more overlapping code than any random selection from the public repository since the functionalities of our plugins are likely to be related in some way.

At its best, there would be lots of repetition in our code. At its worst, there would be considerable overhead in keeping all of this duplicate code updated and bug-free across all of our plugins. And the more duplicate code you have, the likelihood increases that the human factor builds in bugs by mistake, e.g. through silly copy-paste mistakes.

The last thing we want are bugs — worse yet, bugs that our customers would find! Keeping all the code of these repetitive tasks in a central location was the logical thing to do. It wasn’t even the first time we’ve done that!

So what is a framework?

A software framework is a central repository of abstractions and functionalities meant to enforce certain coding standards and to be reused across multiple projects.

By using a framework, we can ensure the same code quality and build logic throughout all of our WordPress plugins. Furthermore, bugs discovered in the reusable parts of the code need only be fixed once to be fixed across all of our plugins. And it keeps the learning curve of tinkering with our plugins’ code minimal — once you’ve worked with one, you know exactly how the others are likely to work!

Updated on May 21, 2021

Was this article helpful?

Related Articles

Want to use our framework?
If you want to learn more about our framework at the code level, see the developer documentation.
Developer documentation