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

维护旧项目

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 here

  connector() {
    // 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 DB
        
    console.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 here

  addBooks(books) {
    for (let book of books) {
      book.addDate()
    }

    // some code here

    booksRecords.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 here

  newBooks(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 here

     booksRecords.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 here

  addBooks(books) {
    for (let book of books) {
      book.addDate()
    }

    // some code here

    booksRecords.getNumberOfBooks().add(books)
  }

  // some code here
}

Here is how to solve the problem through wrapping:

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

class BooksData {
  // some code here

  addBooks(books) {
    // some smart logic to get books
    this.addMoreNewBooks(moreBooks)
  }

  addMoreNewBooks(books) {
    for (let book of books) {
      book.addDate()
    }

    // some code here

    booksRecords.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/

维护旧项目

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Linux钉钉旧版本的安装包通常指的是钉钉在某个特定旧版系统中的软件包,这些包可能不适用于最新系统或者已经停止维护。在Linux中,安装软件通常使用包管理器,如apt(Debian/Ubuntu)、yum(Red Hat/CentOS)或zypper(SUSE)。如果你想要安装旧版本的钉钉,你需要找到对应的官方或第三方仓库提供的旧版软件包。 以下是安装步骤的一般指导: 1. **查找包文件**:首先,你需要找到对应Linux发行版和钉钉版本的.deb(Debian/Ubuntu)或.rpm(Red Hat/CentOS)安装文件。这通常可以在钉钉官网的下载历史页面,或者第三方源(如社区维护的存储库)找到。 2. **获取权限**:如果是从非官方源下载,可能需要管理员权限(使用`sudo`)。 3. **使用包管理器**: - apt-get(Debian/Ubuntu): `sudo apt-get install <package_name>` - yum(Red Hat/CentOS): `sudo yum install <package_name>` - zypper(SUSE): `sudo zypper install <package_name>` 4. **确认版本**:安装完成后,你可以通过`dpkg -l | grep钉钉`或`rpm -q钉钉`命令检查是否成功安装了指定的旧版本。 **相关问题--:** 1. 如何验证Linux系统上已安装软件的版本? 2. 钉钉软件包依赖的其他软件包是什么? 3. 如何在Linux上手动添加非官方软件源安装旧版软件? 请注意,由于钉钉应用程序可能会频繁更新,长期支持的旧版本可能会变得难以获取。建议直接联系钉钉官方获取最新的支持或寻找替代方案。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值