- Modernizing Legacy Applications in PHP
- Paul M. Jones
- 306字
- 2021-07-14 10:07:00
Chapter 1. Legacy Applications
In its simplest definition, a legacy application is any application that you, as a developer, inherit from someone else. It was written before you arrived, and you had little or no decision-making authority in how it was built.
However, there is a lot more weight to the word legacy among developers. It carries with it connotations of poorly organized, difficult to maintain and improve, hard to understand, untested or untestable, and a series of similar negatives. The application works as a product in that it provides revenue, but as a program, it is brittle and sensitive to change.
Because this is a book specifically about PHP-based legacy applications, I am going to offer some PHP-specific characteristics that I have seen in the field. For our purposes, a legacy application in PHP is one that matches two or more of the following descriptions:
- It uses page scripts placed directly in the document root of the web server.
- It has special index files in some directories to prevent access to those directories.
- It has special logic at the top of some files to
die()
orexit()
if a certain value is not set. - Its architecture is include-oriented instead of class-oriented or object-oriented.
- It has relatively few classes.
- Any class structure that exists is disorganized, disjointed, and otherwise inconsistent.
- It relies more heavily on functions than on class methods.
- Its page scripts, classes, and functions combine the concerns of model, view, and controller into the same scope.
- It shows evidence of one or more incomplete attempts at a rewrite, sometimes as a failed framework integration.
- It has no automated test suite for the developers to run.
These characteristics are probably familiar to anyone who has had to deal with a very old PHP application. They describe what I call a typical PHP application.
- 手機(jī)安全和可信應(yīng)用開發(fā)指南:TrustZone與OP-TEE技術(shù)詳解
- 解構(gòu)產(chǎn)品經(jīng)理:互聯(lián)網(wǎng)產(chǎn)品策劃入門寶典
- 大學(xué)計(jì)算機(jī)應(yīng)用基礎(chǔ)實(shí)踐教程
- iOS應(yīng)用逆向工程(第2版)
- jQuery開發(fā)基礎(chǔ)教程
- Unreal Engine 4 Shaders and Effects Cookbook
- 低代碼平臺(tái)開發(fā)實(shí)踐:基于React
- C++ Fundamentals
- Python網(wǎng)絡(luò)爬蟲技術(shù)與應(yīng)用
- Vue.js 3應(yīng)用開發(fā)與核心源碼解析
- 跟戴銘學(xué)iOS編程:理順核心知識(shí)點(diǎn)
- 邊玩邊學(xué)Scratch3.0少兒趣味編程
- Yii2 By Example
- Android項(xiàng)目實(shí)戰(zhàn):博學(xué)谷
- Spring Boot 2+Thymeleaf企業(yè)應(yīng)用實(shí)戰(zhàn)