官术网_书友最值得收藏!

WordPress as a web development framework

In practice, the decision to choose a development framework depends on the complexity of your application. Developers will tend to go for frameworks in most scenarios. It's important to figure out why we go with frameworks for web development. Here is a list of possible reasons that frameworks become a priority in web application development:

  • They provide stable foundations for building custom functionalities
  • Stable frameworks usually have a large development community with active support
  • Frameworks contain built-in modules to address the common aspects of application development such as routing, language support, form validation, user management, and more
  • They have a large number of utility functions to address repetitive tasks

Full stack development frameworks such as Zend, CodeIgniter, and CakePHP adhere to the points mentioned in the preceding section, which in turn become the framework of choice for most developers. Now let's take a look at how WordPress fits into the boots of the web application framework.

MVC versus event-driven architecture

A vast majority of web development frameworks are built to work with the MVC (Model-View-Controller) architecture, where the application is separated into independent layers called models, views, and controllers. In MVC, we have a clear understanding of what goes where and when each of the layers will be integrated in the process.

So, the first thing most developers will look at is the availability of MVC in WordPress. Unfortunately WordPress is not built on top of the MVC architecture. This is one of the main reasons that developers refuse to choose it as a development framework. Even though it is not MVC, we can create a custom execution process to make it work like an MVC application. Unlike other frameworks, it won't have the full capabilities of MVC. But unavailability of an MVC architecture doesn't mean that we cannot develop quality applications with WordPress.

WordPress relies on procedural event-driven architecture with its action hooks and filter system. Once the user makes a request, these actions will get executed in a certain order to provide the response to the user. You can find the complete execution procedure at http://codex.wordpress.org/Plugin_API/Action_Reference.

In an event-driven architecture, both the model and controller code gets scattered throughout the theme files. In the upcoming chapters, we are going to look at how we can separate these concerns with the event-driven architecture, in order to develop maintainable applications.

主站蜘蛛池模板: 平顺县| 四平市| 苗栗县| 通州区| 肥西县| 三原县| 太仓市| 邵阳县| 石屏县| 濮阳县| 德阳市| 大港区| 诏安县| 泸州市| 时尚| 灌云县| 中方县| 屏东县| 石河子市| 沙田区| 长汀县| 安达市| 清水河县| 宜黄县| 宁波市| 邵武市| 定襄县| 洛川县| 岑巩县| 思南县| 台湾省| 靖西县| 湘阴县| 如皋市| 丹阳市| 昭苏县| 博乐市| 海口市| 朔州市| 镇雄县| 左云县|