维护旧项目_为什么您的旧版软件难以维护-以及如何处理。

维护旧项目

Believe it or not, some organizations still rely on legacy software to carry out operations even though newer and more versatile options are available. We know that “old is gold”, but legacy applications cannot glitter forever. As such, these old and outdated programs have become hard to maintain.

信不信由你,即使有较新的和更通用的选项可用,一些组织仍然依靠旧版软件来执行操作。 我们知道“古老就是黄金”,但是旧版应用程序无法永远闪烁。 因此,这些旧的和过时的程序已变得难以维护。

Recently, the U.S. Government Accountability Office (GAO) gave a report that pointed out the most critical federal legacy systems that need to be modernized. This is because they are based on antiquated programming languages, are prone to security loopholes, and are difficult to maintain.

最近,美国政府问责局(GAO)发表了一份报告 ,指出了需要现代化的最关键的联邦遗留系统。 这是因为它们基于过时的编程语言,容易出现安全漏洞,并且难以维护。

Are you in the same shoes?

你穿同一双鞋吗?

In this article, I’m going to talk frankly about the challenges you'll face when maintaining legacy software applications, and how you can overcome them.

在本文中,我将坦诚地谈论维护旧版软件应用程序时将面临的挑战,以及如何克服这些挑战。

旧版系统效率低下 (Legacy systems are inefficient)

Software maintenance is important – it helps enhance the efficiency of the product and narrows the margin for error. Without sufficient maintenance, an application can become inefficient and difficult to operate.

软件维护很重要–它有助于提高产品效率并缩小错误余地。 没有足够的维护,应用程序可能会变得效率低下且难以操作。

First of all, maintaining a legacy system can be difficult because the code used is old when compared to the code used in any modern software. Old code usually tends to be bulky, lengthy, and incompatible with most modern systems.

首先,维护遗留系统可能很困难,因为与任何现代软件中使用的代码相比,所使用的代码是旧的。 旧代码通常趋于庞大,冗长,并且与大多数现代系统不兼容。

For example, JavaScript arrow functions, which were introduced in ES6 in 2015, offer developers a way to write shorter and cleaner function syntax, which is easier to maintain.

例如,2015年ES6中引入JavaScript箭头函数为开发人员提供了一种编写更简短的函数语法的方法,该语法更易于维护。

let total = (x, y) => x + y;/* This arrow function is a shorter form of:
let total = function(x, y) {return x + y;
};
*/console.log(total(5, 2) ); 
// 7

维护费用高 (High maintenance costs)

Another challenge facing most legacy systems is the high cost of maintenance, which may be out of reach for most enterprises.

大多数传统系统面临的另一个挑战是维护成本高昂,这对于大多数企业而言可能是无法承受的。

For example, according to the GAO report mentioned above, the U.S. government planned to spend more than $90 billion in 2019 on IT services, most of which went towards maintaining aging systems.

例如,根据上述GAO报告,美国政府计划在2019年在IT服务上花费超过900亿美元,其中大部分用于维护老化的系统。

Furthermore, as technology is evolving, compliance is becoming a major issue for the protection of consumer-facing applications. Achieving compliance with legacy systems is time-consuming and expensive. It will not happen as quickly compared to new applications who are often compliant by default. It also requires a lot of testing to ensure a legacy infrastructure is compliant with the given regulations.

此外,随着技术的发展,合规性已成为保护面向消费者的应用程序的主要问题。 实现与旧系统的合规性既耗时又昂贵。 与通常默认情况下兼容的新应用程序相比,它不会那么快发生。 它还需要进行大量测试,以确保旧式基础结构符合给定的法规。

The cost of maintaining a legacy system often increases with time, as it slowly becomes obsolete due to technological enhancements. Also, modification of an existing system is a risky venture, which requires a lot of time and resources.

维护遗留系统的成本通常会随着时间的流逝而增加,因为随着技术的增强,它逐渐变得过时。 另外,修改现有系统是冒险的,需要大量时间和资源。

缺乏足够的技能 (Lack of sufficient skill sets)

For legacy software to be maintained, you need a developer conversant with its operations. However, most developers are future-proofing their applications with new technologies. So, getting someone who can work with an old system can be a challenge.

为了维护旧版软件,您需要一个熟悉其操作的开发人员。 但是,大多数开发人员正在使用新技术对应用程序进行过时的验证。 因此,找到可以使用旧系统的人可能是一个挑战。

In some cases, you might need to re-train developers on how the legacy system works, which increases a company’s operating costs.

在某些情况下,您可能需要对开发人员进行有关旧系统如何工作的培训,这会增加公司的运营成本。

Furthermore, managing and controlling changes occurring in the software can be difficult. A lot of time and effort is required to keep the systems operational, which is expensive and time-consuming.

此外,管理和控制软件中发生的更改可能很困难。 要使系统保持运行需要大量时间和精力,这既昂贵又费时。

与其他IT解决方案不兼容 (Incompatibility with other IT solutions)

Currently, there are modern tools that can be used to enable fast and smooth maintenance of software. However, most legacy IT infrastructure is incompatible with such solutions, which complicates their maintenance.

当前,有现代工具可用于实现软件的快速平稳维护。 但是,大多数旧版IT基础架构与此类解决方案不兼容,这使它们的维护复杂化。

If the features in a legacy system are not compatible with those of new IT solutions, developers may find it difficult to integrate them into their environments.

如果旧系统中的功能与新IT解决方案的功能不兼容,则开发人员可能会发现很难将其集成到他们的环境中。

The difficulty of introducing new features to legacy systems also adds to the challenges in their maintenance. Since most legacy systems break easily, trying to restructure and make them more maintainable may not work as expected.

向旧系统中引入新功能的困难也增加了其维护方面的挑战。 由于大多数遗留系统很容易损坏,因此尝试进行重组并使其更易于维护可能无法按预期进行。

应对挑战 (Solutions to the challenges)

To compete favorably in today’s dynamic IT landscape, legacy technologies need modernization. Updated legacy applications lead to more user productivity, reduced maintenance costs, and more helpful experiences.

为了在当今瞬息万变的IT环境中赢得有利的竞争,传统技术需要进行现代化。 更新的旧版应用程序可提高用户的工作效率,降低维护成本,并提供更多有用的体验。

According to recent research by Avanade, modernizing IT systems can lead to a revenue growth of about 14%. Therefore, choosing different software modernization options could lead to significant benefits to your business.

根据Avanade的最新研究,现代化的IT系统可以带来大约14%的收入增长。 因此,选择不同的软件现代化选项可能会为您的业务带来重大利益。

It’s important to note that software should not be declared obsolete just because it’s old. Some of the ‘old’ software may still contain rich features, which can be useful to the optimal functioning of an application.

重要的是要注意,不应仅因为软件过旧就宣布其过时。 某些“旧”软件可能仍包含丰富的功能,这些功能可能有助于优化应用程序的功能。

Therefore, to overcome the challenges of maintaining aging software, developers can opt to refactor the source code of the system. This way, they can use clean and modern code that is reusable and easy to debug.

因此,为了克服维护老化软件的挑战,开发人员可以选择重构系统的源代码。 这样,他们可以使用可重复使用且易于调试的干净现代代码。

In refactoring, you alter your software system to enhance its internal structure. But you don't interfere with the external behavior of the code. This way, the features of the software are optimized due to the code's internal improvements.

在重构中,您可以更改软件系统以增强其内部结构。 但是您不会干扰代码的外部行为。 这样,由于代码的内部改进,软件的功能得以优化。

When refactoring legacy code, updates and modifications should be sufficiently tested to avoid breakages and poor functioning of the application. For example, regression tests can be done to ensure that everything is working as desired.

重构遗留代码时,应充分测试更新和修改,以避免应用程序损坏和运行不佳。 例如,可以进行回归测试以确保一切正常。

Additionally, where resources permit, developers can opt to rewrite the entire source code of the software, while employing modern programming approaches.

此外,在资源允许的情况下,开发人员可以选择重写软件的整个源代码,同时采用现代编程方法。

If you want to continue maintaining your legacy code without breaking it, you can use any of the following three methods:

如果要继续维护旧代码而不破坏它,则可以使用以下三种方法之一:

  1. Identifying change points in the code

    识别代码中的变更点
  2. Isolating your code

    隔离您的代码
  3. Wrapping the code

    包装代码

Let's talk about each of the methods.

让我们谈谈每种方法。

识别代码中的变更点 (Identify change points in the code)

As pointed out earlier, maintaining legacy code can be challenging. Sometimes the issue can be caused by a section that has been poorly programmed. Therefore, you can overcome this by identifying a location that can allow you to change the application's behavior without altering the source code.

如前所述,维护遗留代码可能具有挑战性。 有时,该问题可能是由于某个程序段的编程不正确引起的。 因此,您可以通过确定一个可以在不更改源代码的情况下更改应用程序行为的位置来克服这一问题。

For example, let's say you have the following JavaScript code in a legacy application that connects to a database:

例如,假设您在连接数据库的旧版应用程序中具有以下JavaScript代码:

export class DataConnection {//some code hereconnector() {// some code to connect to database}
}

If you want to run some tests on the above code but the the connector() method is causing problems, you can identify where to modify the code behavior without affecting the source code.

如果要对上面的代码运行一些测试,但是connector()方法引起了问题,则可以确定在不影响源代码的情况下修改代码行为的位置。

In this case, you can extend the DataConnection class and stop it from establishing a connection to an actual database:

在这种情况下,您可以扩展DataConnection类,并阻止其建立与实际数据库的连接:

class FakeConnection extends DataConnection {connector() {// solve the issues of making calls to DBconsole.log("Establishing a connection")}
}

Consequently, after modifying the code behavior without affecting the source code, you can run tests on the code and maintain it without any problems.

因此,在修改代码行为而不影响源代码之后,您可以在代码上运行测试并对其进行维护,而不会出现任何问题。

隔离您的代码 (Isolate your code)

Another technique that can allow you to maintain your legacy code easily is to isolate and make any changes on a different environment. You just need to identify an insertion point where you can call that changed code from the existing legacy code.

可以使您轻松维护遗留代码的另一种技术是隔离并在不同的环境上进行任何更改。 您只需要标识一个插入点,就可以从现有旧代码中调用更改后的代码。

Here is an example:

这是一个例子:

class BooksData {// some code hereaddBooks(books) {for (let book of books) {book.addDate()}// some code herebooksRecords.getNumberOfBooks().add(books)}// some code here
}

Let's say you want to optimize the books reference in the above legacy code, but addBooks() is giving you problems.

假设您想优化上述旧版代码中的书籍参考,但是addBooks()给您带来了问题。

So, you can isolate the code in another new method, like newBooks().

因此,您可以使用另一种新方法(例如newBooks())隔离代码

Then you can run tests on this new method successfully because it is separate from the rest of the code. Afterwards, you can include a call to the new method in the existing, non-changed code. This way, there'll be minimal changes and minimal risks to the legacy code.

然后,您可以对该新方法成功运行测试,因为它与其余代码是分开的。 之后,您可以在未更改的现有代码中包含对新方法的调用。 这样,对遗留代码的更改最少,风险也最小。

Here it is:

这里是:

class BooksData {// some code herenewBooks(books) {// some smart and testable logic to optimize books}addBooks(books) {const newBooks = this.newBooks(books)for (let book of newBooks) {book.addDate()}// some code herebooksRecords.getNumberOfBooks().add(books)}// some code here
}

包装代码 (Wrap the code)

If you want to make changes that should take place before or after the existing code, wrapping it can also be another solution.

如果要进行应在现有代码之前或之后进行的更改,则将其包装也可以是另一种解决方案。

You can achieve this by giving the old method you intend to wrap a new name, adding a new method with the same name and signature just like the old method, and calling the new method from the new method. Lastly, you should place the new logic before or after the previous method call.

您可以通过以下方式实现此目的:给您打算包装新名称的旧方法,添加一个与旧方法一样具有相同名称和签名的新方法,然后从新方法中调用新方法。 最后,您应该将新逻辑放在上一个方法调用之前或之后。

With the new logic, you can run tests or make any changes you want – without affecting the source code.

使用新的逻辑,您可以运行测试或进行所需的任何更改-而不会影响源代码。

For example, here is the code we used previously:

例如,这是我们之前使用的代码:

class BooksData {// some code hereaddBooks(books) {for (let book of books) {book.addDate()}// some code herebooksRecords.getNumberOfBooks().add(books)}// some code here
}

Here is how to solve the problem through wrapping:

这是通过包装解决问题的方法:

class BooksData {// some code hereaddBooks(books) {// some smart logic to get booksthis.addMoreNewBooks(moreBooks)}addMoreNewBooks(books) {for (let book of books) {book.addDate()}// some code herebooksRecords.getNumberOfBooks().add(books)}// some code here
}

结论 (Conclusion)

Although modernizing antique software is complicated, demanding, and risky, the results are usually worth the risk. Continuing to rely on legacy IT systems is the same as continuing to use the post office to send an urgent message, while an email could do the trick at the click of the button.

尽管对古董软件进行现代化改造既复杂,苛刻又有风险,但通常值得承担风险。 继续依赖旧版IT系统与继续使用邮局发送紧急消息的方法相同,而单击按钮则可以通过电子邮件来解决问题。

Furthermore, as a programmer, do you equip yourself with modern coding skills? Or, do you still rely on old approaches?

此外,作为一名程序员,您是否具备现代编码技能? 或者,您仍然依靠旧方法吗?

For example, in the exciting world of JavaScript programming, we’ve witnessed a surge of frameworks, like React and Angular, which are defining the future of the language. Spending some time learning about them could prevent you from falling into obsoleteness.

例如,在令人兴奋JavaScript编程世界中,我们目睹了如React和Angular之类的框架的不断涌现,它们定义了该语言的未来。 花一些时间了解它们可能会防止您过时。

Do you agree?

你同意吗?

翻译自: https://www.freecodecamp.org/news/legacy-software-maintenance-challenges/

维护旧项目

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/news/390409.shtml
繁体地址,请注明出处:http://hk.pswp.cn/news/390409.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

python--内置函数

内置函数现在python一共为我们提供了68个内置函数,讲述过程:一、其他中的12个 (一)执行 字符串 类型代码的执行 1 eval执行有意义的字符串 ,有返回值 print(eval(12))print(eval("print(美丽)")) #美丽 2 ex…

Nancy简单实战之NancyMusicStore(四):实现购物车

原文:Nancy简单实战之NancyMusicStore(四):实现购物车前言 上一篇,我们完成了商品的详情和商品的管理,这一篇我们来完成最后的一个购物车功能。 购物车,不外乎这几个功能:添加商品到购物车,删除购物车中的商…

剑指 Offer 32 - I. 从上到下打印二叉树

从上到下打印出二叉树的每个节点&#xff0c;同一层的节点按照从左到右的顺序打印。 例如: 给定二叉树: [3,9,20,null,null,15,7], 3/ \9 20/ \15 7返回&#xff1a; [3,9,20,15,7] 提示&#xff1a; 节点总数 < 1000 解题思路 使用队列实现层序遍历 代码 /*** …

数据库表命名 单数复数_数据是还是数据是? “数据”一词是单数还是复数?

数据库表命名 单数复数Ill cut right to the chase: the word "data" is plural. Its the plural form of Latin word "datum." Many data. One datum.我将紧追其后&#xff1a;“数据”一词是复数形式。 它是拉丁文“基准”的复数形式。 许多数据。 一个基…

《七步掌握业务分析》读书笔记六

分析技术和呈现格式 词汇表 强有力沟通的一个重要内容是一致地使用术语和惯用语。每次谈话都涉及对术语的共同理解。 工作流图&#xff08;也称为流程图、UNL活动图和过程图&#xff09; 工作流程把一个或多个业务过程的细节可视化地呈现出来&#xff0c;以澄清理解或提出过程改…

Mysql数据库--语句整理/提升/进阶/高级使用技巧

一、基础 1、说明&#xff1a;创建数据库CREATE DATABASE database-name 2、说明&#xff1a;删除数据库drop database dbname3、说明&#xff1a;备份sql server--- 创建 备份数据的 deviceUSE masterEXEC sp_addumpdevice disk, testBack, c:\mssql7backup\MyNwind_1.dat--- …

1104. 二叉树寻路

在一棵无限的二叉树上&#xff0c;每个节点都有两个子节点&#xff0c;树中的节点 逐行 依次按 “之” 字形进行标记。 如下图所示&#xff0c;在奇数行&#xff08;即&#xff0c;第一行、第三行、第五行……&#xff09;中&#xff0c;按从左到右的顺序进行标记&#xff1b;…

javascript 代码_如何开始对JavaScript代码进行单元测试

javascript 代码We all know we should write unit tests. But, its hard to know where to start and how much time to devote to tests compared to actual implementation. So, where to start? And is it just about testing code or do unit tests have other benefits?…

个人作业——软件工程实践总结作业

一、请回望暑假时的第一次作业&#xff0c;你对于软件工程课程的想象 1&#xff09;对比开篇博客你对课程目标和期待&#xff0c;“希望通过实践锻炼&#xff0c;增强计算机专业的能力和就业竞争力”&#xff0c;对比目前的所学所练所得&#xff0c;在哪些方面达到了你的期待和…

(转)在阿里,我们如何管理代码分支?

阿里妹导读&#xff1a;代码分支模式的选择并没有绝对的正确和错误之分&#xff0c;关键是与项目的规模和发布节奏相匹配。阿里协同研发平台在经过众多实践历练后&#xff0c;总结出了一套独创的分支管理方法&#xff1a;AoneFlow&#xff0c;通过兼备灵活高效与简单实用的流程…

WIN10系统 截图或者某些程序时屏幕会自动放大怎么办

右击这个应用程序&#xff0c;兼容性&#xff0c;以兼容模式运行&#xff0c;同时勾选高DPI设置时禁止显示缩放即可

css背景图片添加url_CSS背景图片–如何向您的Div添加图片URL

css背景图片添加urlSay you want to put an image or two on a webpage. One way is to use the background-image CSS property. 假设您要在网页上放置一两个图片。 一种方法是使用background-image CSS属性。 This property applies one or more background images to an el…

golang基础01

1.环境变量&#xff1a;go env//代码目录和第三方库文件set GOPATHC:\Users\hanxiaodong\go//go安装目录set GOROOTC:\Gopath里要配置&#xff1a;goroot/bin;和gopath/bin; gopath目录下三个文件夹&#xff1a;pkg&#xff1a;编译好的库文件 .a 文件bin&#xff1a;可执行文件…

hugo 能做web开发吗_如何自托管Hugo Web应用

hugo 能做web开发吗After hosting with Netlify for a few years, I decided to head back to self hosting. There are a few reasons for that, but the main reasoning was that I had more control over how things worked. 在Netlify托管了几年之后&#xff0c;我决定回到…

资源 | 深度学习课程入门与介绍

【1】Andrew NG Deep Learning.ai http://deeplearning.ai/网易云课堂&#xff08;中文字幕&#xff09;&#xff1a;http://mooc.study.163.com/smartSpec/detail/1001319001.htm推荐理由&#xff1a;Andrew Ng老师是讲课的能手&#xff0c;很多人认识他是从Stanford的经典《机…

PostCSS 以及 cssnext语法

本文是对近两天学习postcss的总结&#xff0c;在这里分享给大家。 如有错误&#xff0c;还请指正&#xff01; 什么是postcss postcss 一种对css编译的工具&#xff0c;类似babel对js的处理&#xff0c;常见的功能如&#xff1a; 1 . 使用下一代css语法 2 . 自动补全浏览器前缀…

5187. 收集足够苹果的最小花园周长

给你一个用无限二维网格表示的花园&#xff0c;每一个 整数坐标处都有一棵苹果树。整数坐标 (i, j) 处的苹果树有 |i| |j| 个苹果。 你将会买下正中心坐标是 (0, 0) 的一块 正方形土地 &#xff0c;且每条边都与两条坐标轴之一平行。 给你一个整数 neededApples &#xff0c…

虚拟机 VMware Workstation12 安装OS X 系统

Windows下虚拟机安装Mac OS X —– VMware Workstation12安装Mac OS X 10.11本文即将介绍WIN虚拟MAC的教程。完整详细教程&#xff08;包含安装中的一些问题&#xff09;【并且适用其他mac os x版本】Windows下 VM12虚拟机安装OS X 10.11(详细教程) 工具/原料 Mac OS X 10.11 镜…

aws dynamodb_DynamoDB备忘单–您需要了解的有关2020 AWS认证开发人员助理认证的Amazon Dynamo DB的所有信息

aws dynamodbThe emergence of cloud services has changed the way we build web-applications. This in turn has changed the responsibilities of a Web Developer. 云服务的出现改变了我们构建Web应用程序的方式。 反过来&#xff0c;这改变了Web开发人员的职责。 We use…

北大CIO走进龙泉寺交流研讨会圆满举行

缘起 2016年4月16日&#xff0c;北京大学信息化与信息管理研究中心秘书长姚乐博士与国家非物质文化遗产蔚县剪纸传承人周淑英女士一起在龙泉寺拜见了中国佛教协会会长、龙泉寺主持学诚法师。在拜见学诚法师时&#xff0c;姚乐博士与学诚法师聊到了“贤二机器僧”和人工智能。姚…